1 | The following changes since commit 7260438b7056469610ee166f7abe9ff8a26b8b16: | 1 | The following changes since commit 9c125d17e9402c232c46610802e5931b3639d77b: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging (2019-01-14 11:41:43 +0000) | 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 | git://github.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 fef1660132b0f25bf2d275d7f986ddcfe19a4426: | 9 | for you to fetch changes up to d45c83328feab2e4083991693160f0a417cfd9b0: |
10 | 10 | ||
11 | aio-posix: Fix concurrent aio_poll/set_fd_handler. (2019-01-14 14:09:41 +0000) | 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 | No user-visible changes. | 16 | Small contrib/vhost-user-blk, contrib/vhost-user-scsi, and tools/virtiofsd |
17 | improvements. | ||
17 | 18 | ||
18 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
19 | 20 | ||
20 | Remy Noel (2): | 21 | Liu Yiding (1): |
21 | aio-posix: Unregister fd from ctx epoll when removing fd_handler. | 22 | virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option |
22 | aio-posix: Fix concurrent aio_poll/set_fd_handler. | ||
23 | 23 | ||
24 | util/aio-posix.c | 90 +++++++++++++++++++++++++++++------------------- | 24 | Sakshi Kaushik (1): |
25 | util/aio-win32.c | 67 ++++++++++++++++------------------- | 25 | Implements Backend Program conventions for vhost-user-scsi |
26 | 2 files changed, 84 insertions(+), 73 deletions(-) | 26 | |
27 | Stefan Hajnoczi (1): | ||
28 | contrib/vhost-user-blk: add missing GOptionEntry NULL terminator | ||
29 | |||
30 | docs/tools/virtiofsd.rst | 5 ++ | ||
31 | contrib/vhost-user-blk/vhost-user-blk.c | 3 +- | ||
32 | contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++-------- | ||
33 | tools/virtiofsd/helper.c | 3 + | ||
34 | 4 files changed, 62 insertions(+), 26 deletions(-) | ||
27 | 35 | ||
28 | -- | 36 | -- |
29 | 2.20.1 | 37 | 2.35.1 |
30 | |||
31 | diff view generated by jsdifflib |
1 | From: Remy Noel <remy.noel@blade-group.com> | 1 | From: Sakshi Kaushik <sakshikaushik717@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | It is possible for an io_poll callback to be concurrently executed along | 3 | Signed-off-by: Sakshi Kaushik <sakshikaushik717@gmail.com> |
4 | with an aio_set_fd_handlers. This can cause all sorts of problems, like | 4 | Message-id: 20220406162410.8536-1-sakshikaushik717@gmail.com |
5 | a NULL callback or a bad opaque pointer. | ||
6 | 5 | ||
7 | This changes set_fd_handlers so that it no longer modify existing handlers | 6 | [Name the iSCSI URL long option --iscsi-uri instead of --iscsi_uri for |
8 | entries and instead, always insert those after having proper initialisation. | 7 | consistency, fix --fd which was rejected due to an outdated |
8 | --socket-path check, and add missing entries[] terminator. | ||
9 | --Stefan] | ||
9 | 10 | ||
10 | Tested-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
11 | Signed-off-by: Remy Noel <remy.noel@blade-group.com> | ||
12 | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
13 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | ||
14 | Message-id: 20181220152030.28035-3-remy.noel@blade-group.com | ||
15 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 11 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
16 | --- | 12 | --- |
17 | util/aio-posix.c | 89 ++++++++++++++++++++++++++++-------------------- | 13 | contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++-------- |
18 | util/aio-win32.c | 67 ++++++++++++++++-------------------- | 14 | 1 file changed, 52 insertions(+), 25 deletions(-) |
19 | 2 files changed, 82 insertions(+), 74 deletions(-) | ||
20 | 15 | ||
21 | diff --git a/util/aio-posix.c b/util/aio-posix.c | 16 | diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c |
22 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/util/aio-posix.c | 18 | --- a/contrib/vhost-user-scsi/vhost-user-scsi.c |
24 | +++ b/util/aio-posix.c | 19 | +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c |
25 | @@ -XXX,XX +XXX,XX @@ static AioHandler *find_aio_handler(AioContext *ctx, int fd) | 20 | @@ -XXX,XX +XXX,XX @@ fail: |
26 | return NULL; | 21 | |
27 | } | 22 | /** vhost-user-scsi **/ |
28 | 23 | ||
29 | +static bool aio_remove_fd_handler(AioContext *ctx, AioHandler *node) | 24 | +static int opt_fdnum = -1; |
30 | +{ | 25 | +static char *opt_socket_path; |
31 | + /* If the GSource is in the process of being destroyed then | 26 | +static gboolean opt_print_caps; |
32 | + * g_source_remove_poll() causes an assertion failure. Skip | 27 | +static char *iscsi_uri; |
33 | + * removal in that case, because glib cleans up its state during | 28 | + |
34 | + * destruction anyway. | 29 | +static GOptionEntry entries[] = { |
35 | + */ | 30 | + { "print-capabilities", 'c', 0, G_OPTION_ARG_NONE, &opt_print_caps, |
36 | + if (!g_source_is_destroyed(&ctx->source)) { | 31 | + "Print capabilities", NULL }, |
37 | + g_source_remove_poll(&ctx->source, &node->pfd); | 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); | ||
38 | + } | 70 | + } |
39 | + | 71 | + |
40 | + /* If a read is in progress, just mark the node as deleted */ | 72 | + if (opt_print_caps) { |
41 | + if (qemu_lockcnt_count(&ctx->list_lock)) { | 73 | + g_print("{\n"); |
42 | + node->deleted = 1; | 74 | + g_print(" \"type\": \"scsi\"\n"); |
43 | + node->pfd.revents = 0; | 75 | + g_print("}\n"); |
44 | + return false; | 76 | + goto out; |
45 | + } | 77 | } |
46 | + /* Otherwise, delete it for real. We can't just mark it as | 78 | - if (!unix_fn || !iscsi_uri) { |
47 | + * deleted because deleted nodes are only cleaned up while | ||
48 | + * no one is walking the handlers list. | ||
49 | + */ | ||
50 | + QLIST_REMOVE(node, node); | ||
51 | + return true; | ||
52 | +} | ||
53 | + | 79 | + |
54 | void aio_set_fd_handler(AioContext *ctx, | 80 | + if (!iscsi_uri) { |
55 | int fd, | 81 | goto help; |
56 | bool is_external, | 82 | } |
57 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | 83 | |
58 | void *opaque) | 84 | - lsock = unix_sock_new(unix_fn); |
59 | { | 85 | - if (lsock < 0) { |
60 | AioHandler *node; | 86 | - goto err; |
61 | + AioHandler *new_node = NULL; | 87 | + if (opt_socket_path) { |
62 | bool is_new = false; | 88 | + lsock = unix_sock_new(opt_socket_path); |
63 | bool deleted = false; | 89 | + if (lsock < 0) { |
64 | int poll_disable_change; | 90 | + exit(EXIT_FAILURE); |
65 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | ||
66 | qemu_lockcnt_unlock(&ctx->list_lock); | ||
67 | return; | ||
68 | } | ||
69 | - | ||
70 | - /* If the GSource is in the process of being destroyed then | ||
71 | - * g_source_remove_poll() causes an assertion failure. Skip | ||
72 | - * removal in that case, because glib cleans up its state during | ||
73 | - * destruction anyway. | ||
74 | - */ | ||
75 | - if (!g_source_is_destroyed(&ctx->source)) { | ||
76 | - g_source_remove_poll(&ctx->source, &node->pfd); | ||
77 | - } | ||
78 | - | ||
79 | - /* If a read is in progress, just mark the node as deleted */ | ||
80 | - if (qemu_lockcnt_count(&ctx->list_lock)) { | ||
81 | - node->deleted = 1; | ||
82 | - node->pfd.revents = 0; | ||
83 | - } else { | ||
84 | - /* Otherwise, delete it for real. We can't just mark it as | ||
85 | - * deleted because deleted nodes are only cleaned up while | ||
86 | - * no one is walking the handlers list. | ||
87 | - */ | ||
88 | - QLIST_REMOVE(node, node); | ||
89 | - deleted = true; | ||
90 | - } | ||
91 | /* Clean events in order to unregister fd from the ctx epoll. */ | ||
92 | node->pfd.events = 0; | ||
93 | |||
94 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | ||
95 | } else { | ||
96 | poll_disable_change = !io_poll - (node && !node->io_poll); | ||
97 | if (node == NULL) { | ||
98 | - /* Alloc and insert if it's not already there */ | ||
99 | - node = g_new0(AioHandler, 1); | ||
100 | - node->pfd.fd = fd; | ||
101 | - QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, node, node); | ||
102 | - | ||
103 | - g_source_add_poll(&ctx->source, &node->pfd); | ||
104 | is_new = true; | ||
105 | } | ||
106 | + /* Alloc and insert if it's not already there */ | ||
107 | + new_node = g_new0(AioHandler, 1); | ||
108 | |||
109 | /* Update handler with latest information */ | ||
110 | - node->io_read = io_read; | ||
111 | - node->io_write = io_write; | ||
112 | - node->io_poll = io_poll; | ||
113 | - node->opaque = opaque; | ||
114 | - node->is_external = is_external; | ||
115 | + new_node->io_read = io_read; | ||
116 | + new_node->io_write = io_write; | ||
117 | + new_node->io_poll = io_poll; | ||
118 | + new_node->opaque = opaque; | ||
119 | + new_node->is_external = is_external; | ||
120 | |||
121 | - node->pfd.events = (io_read ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0); | ||
122 | - node->pfd.events |= (io_write ? G_IO_OUT | G_IO_ERR : 0); | ||
123 | + if (is_new) { | ||
124 | + new_node->pfd.fd = fd; | ||
125 | + } else { | ||
126 | + new_node->pfd = node->pfd; | ||
127 | + } | 91 | + } |
128 | + g_source_add_poll(&ctx->source, &new_node->pfd); | 92 | + } else if (opt_fdnum < 0) { |
129 | + | 93 | + g_print("%s\n", g_option_context_get_help(context, true, NULL)); |
130 | + new_node->pfd.events = (io_read ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0); | 94 | + exit(EXIT_FAILURE); |
131 | + new_node->pfd.events |= (io_write ? G_IO_OUT | G_IO_ERR : 0); | 95 | + } else { |
132 | + | 96 | + lsock = opt_fdnum; |
133 | + QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, new_node, node); | ||
134 | + } | ||
135 | + if (node) { | ||
136 | + deleted = aio_remove_fd_handler(ctx, node); | ||
137 | } | 97 | } |
138 | 98 | ||
139 | /* No need to order poll_disable_cnt writes against other updates; | 99 | csock = accept(lsock, NULL, NULL); |
140 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | 100 | @@ -XXX,XX +XXX,XX @@ out: |
141 | atomic_set(&ctx->poll_disable_cnt, | 101 | if (vdev_scsi) { |
142 | atomic_read(&ctx->poll_disable_cnt) + poll_disable_change); | 102 | g_main_loop_unref(vdev_scsi->loop); |
143 | 103 | g_free(vdev_scsi); | |
144 | - aio_epoll_update(ctx, node, is_new); | 104 | - unlink(unix_fn); |
145 | + if (new_node) { | 105 | + unlink(opt_socket_path); |
146 | + aio_epoll_update(ctx, new_node, is_new); | ||
147 | + } else if (node) { | ||
148 | + /* Unregister deleted fd_handler */ | ||
149 | + aio_epoll_update(ctx, node, false); | ||
150 | + } | ||
151 | qemu_lockcnt_unlock(&ctx->list_lock); | ||
152 | aio_notify(ctx); | ||
153 | |||
154 | diff --git a/util/aio-win32.c b/util/aio-win32.c | ||
155 | index XXXXXXX..XXXXXXX 100644 | ||
156 | --- a/util/aio-win32.c | ||
157 | +++ b/util/aio-win32.c | ||
158 | @@ -XXX,XX +XXX,XX @@ struct AioHandler { | ||
159 | QLIST_ENTRY(AioHandler) node; | ||
160 | }; | ||
161 | |||
162 | +static void aio_remove_fd_handler(AioContext *ctx, AioHandler *node) | ||
163 | +{ | ||
164 | + /* If aio_poll is in progress, just mark the node as deleted */ | ||
165 | + if (qemu_lockcnt_count(&ctx->list_lock)) { | ||
166 | + node->deleted = 1; | ||
167 | + node->pfd.revents = 0; | ||
168 | + } else { | ||
169 | + /* Otherwise, delete it for real. We can't just mark it as | ||
170 | + * deleted because deleted nodes are only cleaned up after | ||
171 | + * releasing the list_lock. | ||
172 | + */ | ||
173 | + QLIST_REMOVE(node, node); | ||
174 | + g_free(node); | ||
175 | + } | ||
176 | +} | ||
177 | + | ||
178 | void aio_set_fd_handler(AioContext *ctx, | ||
179 | int fd, | ||
180 | bool is_external, | ||
181 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | ||
182 | void *opaque) | ||
183 | { | ||
184 | /* fd is a SOCKET in our case */ | ||
185 | - AioHandler *node; | ||
186 | + AioHandler *old_node; | ||
187 | + AioHandler *node = NULL; | ||
188 | |||
189 | qemu_lockcnt_lock(&ctx->list_lock); | ||
190 | - QLIST_FOREACH(node, &ctx->aio_handlers, node) { | ||
191 | - if (node->pfd.fd == fd && !node->deleted) { | ||
192 | + QLIST_FOREACH(old_node, &ctx->aio_handlers, node) { | ||
193 | + if (old_node->pfd.fd == fd && !old_node->deleted) { | ||
194 | break; | ||
195 | } | ||
196 | } | 106 | } |
197 | 107 | if (csock >= 0) { | |
198 | - /* Are we deleting the fd handler? */ | 108 | close(csock); |
199 | - if (!io_read && !io_write) { | 109 | @@ -XXX,XX +XXX,XX @@ out: |
200 | - if (node) { | 110 | if (lsock >= 0) { |
201 | - /* If aio_poll is in progress, just mark the node as deleted */ | 111 | close(lsock); |
202 | - if (qemu_lockcnt_count(&ctx->list_lock)) { | ||
203 | - node->deleted = 1; | ||
204 | - node->pfd.revents = 0; | ||
205 | - } else { | ||
206 | - /* Otherwise, delete it for real. We can't just mark it as | ||
207 | - * deleted because deleted nodes are only cleaned up after | ||
208 | - * releasing the list_lock. | ||
209 | - */ | ||
210 | - QLIST_REMOVE(node, node); | ||
211 | - g_free(node); | ||
212 | - } | ||
213 | - } | ||
214 | - } else { | ||
215 | + if (io_read || io_write) { | ||
216 | HANDLE event; | ||
217 | long bitmask = 0; | ||
218 | |||
219 | - if (node == NULL) { | ||
220 | - /* Alloc and insert if it's not already there */ | ||
221 | - node = g_new0(AioHandler, 1); | ||
222 | - node->pfd.fd = fd; | ||
223 | - QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, node, node); | ||
224 | - } | ||
225 | + /* Alloc and insert if it's not already there */ | ||
226 | + node = g_new0(AioHandler, 1); | ||
227 | + node->pfd.fd = fd; | ||
228 | |||
229 | node->pfd.events = 0; | ||
230 | if (node->io_read) { | ||
231 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | ||
232 | bitmask |= FD_WRITE | FD_CONNECT; | ||
233 | } | ||
234 | |||
235 | + QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, node, node); | ||
236 | event = event_notifier_get_handle(&ctx->notifier); | ||
237 | WSAEventSelect(node->pfd.fd, event, bitmask); | ||
238 | } | 112 | } |
239 | + if (old_node) { | 113 | - g_free(unix_fn); |
240 | + aio_remove_fd_handler(ctx, old_node); | 114 | + g_free(opt_socket_path); |
241 | + } | 115 | g_free(iscsi_uri); |
242 | 116 | ||
243 | qemu_lockcnt_unlock(&ctx->list_lock); | 117 | return err; |
244 | aio_notify(ctx); | 118 | @@ -XXX,XX +XXX,XX @@ err: |
245 | @@ -XXX,XX +XXX,XX @@ void aio_set_event_notifier(AioContext *ctx, | 119 | goto out; |
246 | if (node) { | 120 | |
247 | g_source_remove_poll(&ctx->source, &node->pfd); | 121 | help: |
248 | 122 | - fprintf(stderr, "Usage: %s [ -u unix_sock_path -i iscsi_uri ] | [ -h ]\n", | |
249 | - /* aio_poll is in progress, just mark the node as deleted */ | 123 | + fprintf(stderr, "Usage: %s [ -s socket-path -i iscsi-uri -f fd -p print-capabilities ] | [ -h ]\n", |
250 | - if (qemu_lockcnt_count(&ctx->list_lock)) { | 124 | argv[0]); |
251 | - node->deleted = 1; | 125 | - fprintf(stderr, " -u path to unix socket\n"); |
252 | - node->pfd.revents = 0; | 126 | - fprintf(stderr, " -i iscsi uri for lun 0\n"); |
253 | - } else { | 127 | + fprintf(stderr, " -s, --socket-path=SOCKET_PATH path to unix socket\n"); |
254 | - /* Otherwise, delete it for real. We can't just mark it as | 128 | + fprintf(stderr, " -i, --iscsi-uri=ISCSI_URI iscsi uri for lun 0\n"); |
255 | - * deleted because deleted nodes are only cleaned up after | 129 | + fprintf(stderr, " -f, --fd=FILE_DESCRIPTOR file-descriptor\n"); |
256 | - * releasing the list_lock. | 130 | + fprintf(stderr, " -p, --print-capabilities=PRINT_CAPABILITIES denotes print-capabilities\n"); |
257 | - */ | 131 | fprintf(stderr, " -h print help and quit\n"); |
258 | - QLIST_REMOVE(node, node); | 132 | |
259 | - g_free(node); | 133 | goto err; |
260 | - } | ||
261 | + aio_remove_fd_handler(ctx, node); | ||
262 | } | ||
263 | } else { | ||
264 | if (node == NULL) { | ||
265 | -- | 134 | -- |
266 | 2.20.1 | 135 | 2.35.1 |
267 | |||
268 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
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. | ||
1 | 5 | ||
6 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
7 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
8 | Message-id: 20220411150057.3009667-1-stefanha@redhat.com | ||
9 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
10 | --- | ||
11 | contrib/vhost-user-blk/vhost-user-blk.c | 3 ++- | ||
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/contrib/vhost-user-blk/vhost-user-blk.c | ||
17 | +++ b/contrib/vhost-user-blk/vhost-user-blk.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static GOptionEntry entries[] = { | ||
19 | {"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file, | ||
20 | "block device or file path", "PATH"}, | ||
21 | { "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only, | ||
22 | - "Enable read-only", NULL } | ||
23 | + "Enable read-only", NULL }, | ||
24 | + { NULL, }, | ||
25 | }; | ||
26 | |||
27 | int main(int argc, char **argv) | ||
28 | -- | ||
29 | 2.35.1 | diff view generated by jsdifflib |
1 | From: Remy Noel <remy.noel@blade-group.com> | 1 | From: Liu Yiding <liuyd.fnst@fujitsu.com> |
---|---|---|---|
2 | 2 | ||
3 | Cleaning the events will cause aio_epoll_update to unregister the fd. | 3 | virtiofsd has introduced killpriv_v2/no_killpriv_v2 for a while. Add |
4 | Otherwise, the fd is kept registered until it is destroyed. | 4 | description of it to docs/helper. |
5 | 5 | ||
6 | Signed-off-by: Remy Noel <remy.noel@blade-group.com> | 6 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> |
7 | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> | 7 | Message-Id: <20220421095151.2231099-1-liuyd.fnst@fujitsu.com> |
8 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | 8 | |
9 | Message-id: 20181220152030.28035-2-remy.noel@blade-group.com | 9 | [Small documentation fixes: s/as client supports/as the client supports/ |
10 | and s/. /. /. | ||
11 | --Stefan] | ||
12 | |||
10 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 13 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
11 | --- | 14 | --- |
12 | util/aio-posix.c | 3 +++ | 15 | docs/tools/virtiofsd.rst | 5 +++++ |
13 | 1 file changed, 3 insertions(+) | 16 | tools/virtiofsd/helper.c | 3 +++ |
17 | 2 files changed, 8 insertions(+) | ||
14 | 18 | ||
15 | diff --git a/util/aio-posix.c b/util/aio-posix.c | 19 | diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst |
16 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/util/aio-posix.c | 21 | --- a/docs/tools/virtiofsd.rst |
18 | +++ b/util/aio-posix.c | 22 | +++ b/docs/tools/virtiofsd.rst |
19 | @@ -XXX,XX +XXX,XX @@ void aio_set_fd_handler(AioContext *ctx, | 23 | @@ -XXX,XX +XXX,XX @@ Options |
20 | QLIST_REMOVE(node, node); | 24 | label. Server will try to set that label on newly created file |
21 | deleted = true; | 25 | atomically wherever possible. |
22 | } | 26 | |
23 | + /* Clean events in order to unregister fd from the ctx epoll. */ | 27 | + * killpriv_v2|no_killpriv_v2 - |
24 | + node->pfd.events = 0; | 28 | + Enable/disable ``FUSE_HANDLE_KILLPRIV_V2`` support. KILLPRIV_V2 is enabled |
29 | + by default as long as the client supports it. Enabling this option helps | ||
30 | + with performance in write path. | ||
25 | + | 31 | + |
26 | poll_disable_change = -!node->io_poll; | 32 | .. option:: --socket-path=PATH |
27 | } else { | 33 | |
28 | poll_disable_change = !io_poll - (node && !node->io_poll); | 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 | |||
29 | -- | 49 | -- |
30 | 2.20.1 | 50 | 2.35.1 |
31 | |||
32 | diff view generated by jsdifflib |