1 | The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935: | 1 | The following changes since commit 9c125d17e9402c232c46610802e5931b3639d77b: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100) | 3 | Merge tag 'pull-tcg-20220420' of https://gitlab.com/rth7680/qemu into staging (2022-04-20 16:43:11 -0700) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request | 7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a: | 9 | for you to fetch changes up to d45c83328feab2e4083991693160f0a417cfd9b0: |
10 | 10 | ||
11 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100) | 11 | virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option (2022-04-21 12:05:15 +0200) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Pull request |
15 | 15 | ||
16 | The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the | 16 | Small contrib/vhost-user-blk, contrib/vhost-user-scsi, and tools/virtiofsd |
17 | request needs to be resubmitted. | 17 | improvements. |
18 | |||
19 | The MAINTAINERS changes carry no risk and we might as well include them in QEMU | ||
20 | 6.1. | ||
21 | 18 | ||
22 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
23 | 20 | ||
24 | Fabian Ebner (1): | 21 | Liu Yiding (1): |
25 | block/io_uring: resubmit when result is -EAGAIN | 22 | virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option |
26 | 23 | ||
27 | Philippe Mathieu-Daudé (1): | 24 | Sakshi Kaushik (1): |
28 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver | 25 | Implements Backend Program conventions for vhost-user-scsi |
29 | 26 | ||
30 | Stefano Garzarella (1): | 27 | Stefan Hajnoczi (1): |
31 | MAINTAINERS: add Stefano Garzarella as io_uring reviewer | 28 | contrib/vhost-user-blk: add missing GOptionEntry NULL terminator |
32 | 29 | ||
33 | MAINTAINERS | 2 ++ | 30 | docs/tools/virtiofsd.rst | 5 ++ |
34 | block/io_uring.c | 16 +++++++++++++++- | 31 | contrib/vhost-user-blk/vhost-user-blk.c | 3 +- |
35 | 2 files changed, 17 insertions(+), 1 deletion(-) | 32 | contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++-------- |
33 | tools/virtiofsd/helper.c | 3 + | ||
34 | 4 files changed, 62 insertions(+), 26 deletions(-) | ||
36 | 35 | ||
37 | -- | 36 | -- |
38 | 2.31.1 | 37 | 2.35.1 |
39 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Sakshi Kaushik <sakshikaushik717@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | I'm interested in following the activity around the NVMe bdrv. | 3 | Signed-off-by: Sakshi Kaushik <sakshikaushik717@gmail.com> |
4 | Message-id: 20220406162410.8536-1-sakshikaushik717@gmail.com | ||
4 | 5 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | [Name the iSCSI URL long option --iscsi-uri instead of --iscsi_uri for |
6 | Message-id: 20210728183340.2018313-1-philmd@redhat.com | 7 | consistency, fix --fd which was rejected due to an outdated |
8 | --socket-path check, and add missing entries[] terminator. | ||
9 | --Stefan] | ||
10 | |||
7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 11 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
8 | --- | 12 | --- |
9 | MAINTAINERS | 1 + | 13 | contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++-------- |
10 | 1 file changed, 1 insertion(+) | 14 | 1 file changed, 52 insertions(+), 25 deletions(-) |
11 | 15 | ||
12 | diff --git a/MAINTAINERS b/MAINTAINERS | 16 | diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c |
13 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/MAINTAINERS | 18 | --- a/contrib/vhost-user-scsi/vhost-user-scsi.c |
15 | +++ b/MAINTAINERS | 19 | +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c |
16 | @@ -XXX,XX +XXX,XX @@ F: block/null.c | 20 | @@ -XXX,XX +XXX,XX @@ fail: |
17 | NVMe Block Driver | 21 | |
18 | M: Stefan Hajnoczi <stefanha@redhat.com> | 22 | /** vhost-user-scsi **/ |
19 | R: Fam Zheng <fam@euphon.net> | 23 | |
20 | +R: Philippe Mathieu-Daudé <philmd@redhat.com> | 24 | +static int opt_fdnum = -1; |
21 | L: qemu-block@nongnu.org | 25 | +static char *opt_socket_path; |
22 | S: Supported | 26 | +static gboolean opt_print_caps; |
23 | F: block/nvme* | 27 | +static char *iscsi_uri; |
28 | + | ||
29 | +static GOptionEntry entries[] = { | ||
30 | + { "print-capabilities", 'c', 0, G_OPTION_ARG_NONE, &opt_print_caps, | ||
31 | + "Print capabilities", NULL }, | ||
32 | + { "fd", 'f', 0, G_OPTION_ARG_INT, &opt_fdnum, | ||
33 | + "Use inherited fd socket", "FDNUM" }, | ||
34 | + { "iscsi-uri", 'i', 0, G_OPTION_ARG_FILENAME, &iscsi_uri, | ||
35 | + "iSCSI URI to connect to", "FDNUM" }, | ||
36 | + { "socket-path", 's', 0, G_OPTION_ARG_FILENAME, &opt_socket_path, | ||
37 | + "Use UNIX socket path", "PATH" }, | ||
38 | + { NULL, } | ||
39 | +}; | ||
40 | + | ||
41 | int main(int argc, char **argv) | ||
42 | { | ||
43 | VusDev *vdev_scsi = NULL; | ||
44 | - char *unix_fn = NULL; | ||
45 | - char *iscsi_uri = NULL; | ||
46 | - int lsock = -1, csock = -1, opt, err = EXIT_SUCCESS; | ||
47 | + int lsock = -1, csock = -1, err = EXIT_SUCCESS; | ||
48 | |||
49 | - while ((opt = getopt(argc, argv, "u:i:")) != -1) { | ||
50 | - switch (opt) { | ||
51 | - case 'h': | ||
52 | - goto help; | ||
53 | - case 'u': | ||
54 | - unix_fn = g_strdup(optarg); | ||
55 | - break; | ||
56 | - case 'i': | ||
57 | - iscsi_uri = g_strdup(optarg); | ||
58 | - break; | ||
59 | - default: | ||
60 | - goto help; | ||
61 | - } | ||
62 | + GError *error = NULL; | ||
63 | + GOptionContext *context; | ||
64 | + | ||
65 | + context = g_option_context_new(NULL); | ||
66 | + g_option_context_add_main_entries(context, entries, NULL); | ||
67 | + if (!g_option_context_parse(context, &argc, &argv, &error)) { | ||
68 | + g_printerr("Option parsing failed: %s\n", error->message); | ||
69 | + exit(EXIT_FAILURE); | ||
70 | + } | ||
71 | + | ||
72 | + if (opt_print_caps) { | ||
73 | + g_print("{\n"); | ||
74 | + g_print(" \"type\": \"scsi\"\n"); | ||
75 | + g_print("}\n"); | ||
76 | + goto out; | ||
77 | } | ||
78 | - if (!unix_fn || !iscsi_uri) { | ||
79 | + | ||
80 | + if (!iscsi_uri) { | ||
81 | goto help; | ||
82 | } | ||
83 | |||
84 | - lsock = unix_sock_new(unix_fn); | ||
85 | - if (lsock < 0) { | ||
86 | - goto err; | ||
87 | + if (opt_socket_path) { | ||
88 | + lsock = unix_sock_new(opt_socket_path); | ||
89 | + if (lsock < 0) { | ||
90 | + exit(EXIT_FAILURE); | ||
91 | + } | ||
92 | + } else if (opt_fdnum < 0) { | ||
93 | + g_print("%s\n", g_option_context_get_help(context, true, NULL)); | ||
94 | + exit(EXIT_FAILURE); | ||
95 | + } else { | ||
96 | + lsock = opt_fdnum; | ||
97 | } | ||
98 | |||
99 | csock = accept(lsock, NULL, NULL); | ||
100 | @@ -XXX,XX +XXX,XX @@ out: | ||
101 | if (vdev_scsi) { | ||
102 | g_main_loop_unref(vdev_scsi->loop); | ||
103 | g_free(vdev_scsi); | ||
104 | - unlink(unix_fn); | ||
105 | + unlink(opt_socket_path); | ||
106 | } | ||
107 | if (csock >= 0) { | ||
108 | close(csock); | ||
109 | @@ -XXX,XX +XXX,XX @@ out: | ||
110 | if (lsock >= 0) { | ||
111 | close(lsock); | ||
112 | } | ||
113 | - g_free(unix_fn); | ||
114 | + g_free(opt_socket_path); | ||
115 | g_free(iscsi_uri); | ||
116 | |||
117 | return err; | ||
118 | @@ -XXX,XX +XXX,XX @@ err: | ||
119 | goto out; | ||
120 | |||
121 | help: | ||
122 | - fprintf(stderr, "Usage: %s [ -u unix_sock_path -i iscsi_uri ] | [ -h ]\n", | ||
123 | + fprintf(stderr, "Usage: %s [ -s socket-path -i iscsi-uri -f fd -p print-capabilities ] | [ -h ]\n", | ||
124 | argv[0]); | ||
125 | - fprintf(stderr, " -u path to unix socket\n"); | ||
126 | - fprintf(stderr, " -i iscsi uri for lun 0\n"); | ||
127 | + fprintf(stderr, " -s, --socket-path=SOCKET_PATH path to unix socket\n"); | ||
128 | + fprintf(stderr, " -i, --iscsi-uri=ISCSI_URI iscsi uri for lun 0\n"); | ||
129 | + fprintf(stderr, " -f, --fd=FILE_DESCRIPTOR file-descriptor\n"); | ||
130 | + fprintf(stderr, " -p, --print-capabilities=PRINT_CAPABILITIES denotes print-capabilities\n"); | ||
131 | fprintf(stderr, " -h print help and quit\n"); | ||
132 | |||
133 | goto err; | ||
24 | -- | 134 | -- |
25 | 2.31.1 | 135 | 2.35.1 |
26 | diff view generated by jsdifflib |
1 | From: Fabian Ebner <f.ebner@proxmox.com> | 1 | The GLib documentation says "a NULL-terminated array of GOptionEntrys" |
---|---|---|---|
2 | so we'd better make sure there is a terminator that lets | ||
3 | g_option_context_add_main_entries() know when the end of the array has | ||
4 | been reached. | ||
2 | 5 | ||
3 | Linux SCSI can throw spurious -EAGAIN in some corner cases in its | 6 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
4 | completion path, which will end up being the result in the completed | 7 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> |
5 | io_uring request. | 8 | Message-id: 20220411150057.3009667-1-stefanha@redhat.com |
6 | |||
7 | Resubmitting such requests should allow block jobs to complete, even | ||
8 | if such spurious errors are encountered. | ||
9 | |||
10 | Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com> | ||
11 | Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> | ||
12 | Signed-off-by: Fabian Ebner <f.ebner@proxmox.com> | ||
13 | Message-id: 20210729091029.65369-1-f.ebner@proxmox.com | ||
14 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 9 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
15 | --- | 10 | --- |
16 | block/io_uring.c | 16 +++++++++++++++- | 11 | contrib/vhost-user-blk/vhost-user-blk.c | 3 ++- |
17 | 1 file changed, 15 insertions(+), 1 deletion(-) | 12 | 1 file changed, 2 insertions(+), 1 deletion(-) |
18 | 13 | ||
19 | diff --git a/block/io_uring.c b/block/io_uring.c | 14 | diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c |
20 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/block/io_uring.c | 16 | --- a/contrib/vhost-user-blk/vhost-user-blk.c |
22 | +++ b/block/io_uring.c | 17 | +++ b/contrib/vhost-user-blk/vhost-user-blk.c |
23 | @@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s) | 18 | @@ -XXX,XX +XXX,XX @@ static GOptionEntry entries[] = { |
24 | total_bytes = ret + luringcb->total_read; | 19 | {"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file, |
25 | 20 | "block device or file path", "PATH"}, | |
26 | if (ret < 0) { | 21 | { "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only, |
27 | - if (ret == -EINTR) { | 22 | - "Enable read-only", NULL } |
28 | + /* | 23 | + "Enable read-only", NULL }, |
29 | + * Only writev/readv/fsync requests on regular files or host block | 24 | + { NULL, }, |
30 | + * devices are submitted. Therefore -EAGAIN is not expected but it's | 25 | }; |
31 | + * known to happen sometimes with Linux SCSI. Submit again and hope | 26 | |
32 | + * the request completes successfully. | 27 | int main(int argc, char **argv) |
33 | + * | ||
34 | + * For more information, see: | ||
35 | + * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u | ||
36 | + * | ||
37 | + * If the code is changed to submit other types of requests in the | ||
38 | + * future, then this workaround may need to be extended to deal with | ||
39 | + * genuine -EAGAIN results that should not be resubmitted | ||
40 | + * immediately. | ||
41 | + */ | ||
42 | + if (ret == -EINTR || ret == -EAGAIN) { | ||
43 | luring_resubmit(s, luringcb); | ||
44 | continue; | ||
45 | } | ||
46 | -- | 28 | -- |
47 | 2.31.1 | 29 | 2.35.1 |
48 | diff view generated by jsdifflib |
1 | From: Stefano Garzarella <sgarzare@redhat.com> | 1 | From: Liu Yiding <liuyd.fnst@fujitsu.com> |
---|---|---|---|
2 | 2 | ||
3 | I've been working with io_uring for a while so I'd like to help | 3 | virtiofsd has introduced killpriv_v2/no_killpriv_v2 for a while. Add |
4 | with reviews. | 4 | description of it to docs/helper. |
5 | 5 | ||
6 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> | 6 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> |
7 | Message-Id: <20210728131515.131045-1-sgarzare@redhat.com> | 7 | Message-Id: <20220421095151.2231099-1-liuyd.fnst@fujitsu.com> |
8 | |||
9 | [Small documentation fixes: s/as client supports/as the client supports/ | ||
10 | and s/. /. /. | ||
11 | --Stefan] | ||
12 | |||
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 13 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
9 | --- | 14 | --- |
10 | MAINTAINERS | 1 + | 15 | docs/tools/virtiofsd.rst | 5 +++++ |
11 | 1 file changed, 1 insertion(+) | 16 | tools/virtiofsd/helper.c | 3 +++ |
17 | 2 files changed, 8 insertions(+) | ||
12 | 18 | ||
13 | diff --git a/MAINTAINERS b/MAINTAINERS | 19 | diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst |
14 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/MAINTAINERS | 21 | --- a/docs/tools/virtiofsd.rst |
16 | +++ b/MAINTAINERS | 22 | +++ b/docs/tools/virtiofsd.rst |
17 | @@ -XXX,XX +XXX,XX @@ Linux io_uring | 23 | @@ -XXX,XX +XXX,XX @@ Options |
18 | M: Aarushi Mehta <mehta.aaru20@gmail.com> | 24 | label. Server will try to set that label on newly created file |
19 | M: Julia Suvorova <jusual@redhat.com> | 25 | atomically wherever possible. |
20 | M: Stefan Hajnoczi <stefanha@redhat.com> | 26 | |
21 | +R: Stefano Garzarella <sgarzare@redhat.com> | 27 | + * killpriv_v2|no_killpriv_v2 - |
22 | L: qemu-block@nongnu.org | 28 | + Enable/disable ``FUSE_HANDLE_KILLPRIV_V2`` support. KILLPRIV_V2 is enabled |
23 | S: Maintained | 29 | + by default as long as the client supports it. Enabling this option helps |
24 | F: block/io_uring.c | 30 | + with performance in write path. |
31 | + | ||
32 | .. option:: --socket-path=PATH | ||
33 | |||
34 | Listen on vhost-user UNIX domain socket at PATH. | ||
35 | diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c | ||
36 | index XXXXXXX..XXXXXXX 100644 | ||
37 | --- a/tools/virtiofsd/helper.c | ||
38 | +++ b/tools/virtiofsd/helper.c | ||
39 | @@ -XXX,XX +XXX,XX @@ void fuse_cmdline_help(void) | ||
40 | " -o announce_submounts Announce sub-mount points to the guest\n" | ||
41 | " -o posix_acl/no_posix_acl Enable/Disable posix_acl. (default: disabled)\n" | ||
42 | " -o security_label/no_security_label Enable/Disable security label. (default: disabled)\n" | ||
43 | + " -o killpriv_v2/no_killpriv_v2\n" | ||
44 | + " Enable/Disable FUSE_HANDLE_KILLPRIV_V2.\n" | ||
45 | + " (default: enabled as long as client supports it)\n" | ||
46 | ); | ||
47 | } | ||
48 | |||
25 | -- | 49 | -- |
26 | 2.31.1 | 50 | 2.35.1 |
27 | diff view generated by jsdifflib |