1
The following changes since commit d01beac177d44491d7db8747b79d94e1b53d173b:
1
The following changes since commit 9c125d17e9402c232c46610802e5931b3639d77b:
2
2
3
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20180507-pull-request' into staging (2018-05-08 14:23:02 +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
git://github.com/codyprime/qemu-kvm-jtc.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 a2cb9239b7610ffb00f9ced5cd7640d40b0e1ccf:
9
for you to fetch changes up to d45c83328feab2e4083991693160f0a417cfd9b0:
10
10
11
sheepdog: Fix sd_co_create_opts() memory leaks (2018-05-08 10:47:27 -0400)
11
virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option (2022-04-21 12:05:15 +0200)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block patches
14
Pull request
15
16
Small contrib/vhost-user-blk, contrib/vhost-user-scsi, and tools/virtiofsd
17
improvements.
18
15
----------------------------------------------------------------
19
----------------------------------------------------------------
16
20
17
Kevin Wolf (1):
21
Liu Yiding (1):
18
sheepdog: Fix sd_co_create_opts() memory leaks
22
virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option
19
23
20
Max Reitz (2):
24
Sakshi Kaushik (1):
21
block/mirror: Make cancel always cancel pre-READY
25
Implements Backend Program conventions for vhost-user-scsi
22
iotests: Add test for cancelling a mirror job
23
26
24
Stefan Hajnoczi (1):
27
Stefan Hajnoczi (1):
25
block/mirror: honor ratelimit again
28
contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
26
29
27
block/mirror.c | 14 +++--
30
docs/tools/virtiofsd.rst | 5 ++
28
block/sheepdog.c | 4 +-
31
contrib/vhost-user-blk/vhost-user-blk.c | 3 +-
29
tests/qemu-iotests/185.out | 4 +-
32
contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++--------
30
tests/qemu-iotests/218 | 138 +++++++++++++++++++++++++++++++++++++++++++++
33
tools/virtiofsd/helper.c | 3 +
31
tests/qemu-iotests/218.out | 30 ++++++++++
34
4 files changed, 62 insertions(+), 26 deletions(-)
32
tests/qemu-iotests/group | 1 +
33
6 files changed, 183 insertions(+), 8 deletions(-)
34
create mode 100644 tests/qemu-iotests/218
35
create mode 100644 tests/qemu-iotests/218.out
36
35
37
--
36
--
38
2.13.6
37
2.35.1
39
40
diff view generated by jsdifflib
Deleted patch
1
From: Stefan Hajnoczi <stefanha@redhat.com>
2
1
3
Commit b76e4458b1eb3c32e9824fe6aa51f67d2b251748 ("block/mirror: change
4
the semantic of 'force' of block-job-cancel") accidentally removed the
5
ratelimit in the mirror job.
6
7
Reintroduce the ratelimit but keep the block-job-cancel force=true
8
behavior that was added in commit
9
b76e4458b1eb3c32e9824fe6aa51f67d2b251748.
10
11
Note that block_job_sleep_ns() returns immediately when the job is
12
cancelled. Therefore it's safe to unconditionally call
13
block_job_sleep_ns() - a cancelled job does not sleep.
14
15
This commit fixes the non-deterministic qemu-iotests 185 output. The
16
test relies on the ratelimit to make the job sleep until the 'quit'
17
command is processed. Previously the job could complete before the
18
'quit' command was received since there was no ratelimit.
19
20
Cc: Liang Li <liliang.opensource@gmail.com>
21
Cc: Jeff Cody <jcody@redhat.com>
22
Cc: Kevin Wolf <kwolf@redhat.com>
23
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
24
Message-id: 20180424123527.19168-1-stefanha@redhat.com
25
Signed-off-by: Jeff Cody <jcody@redhat.com>
26
---
27
block/mirror.c | 8 +++++---
28
tests/qemu-iotests/185.out | 4 ++--
29
2 files changed, 7 insertions(+), 5 deletions(-)
30
31
diff --git a/block/mirror.c b/block/mirror.c
32
index XXXXXXX..XXXXXXX 100644
33
--- a/block/mirror.c
34
+++ b/block/mirror.c
35
@@ -XXX,XX +XXX,XX @@ static void coroutine_fn mirror_run(void *opaque)
36
}
37
38
ret = 0;
39
+
40
+ if (s->synced && !should_complete) {
41
+ delay_ns = (s->in_flight == 0 && cnt == 0 ? SLICE_TIME : 0);
42
+ }
43
trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);
44
+ block_job_sleep_ns(&s->common, delay_ns);
45
if (block_job_is_cancelled(&s->common) && s->common.force) {
46
break;
47
- } else if (!should_complete) {
48
- delay_ns = (s->in_flight == 0 && cnt == 0 ? SLICE_TIME : 0);
49
- block_job_sleep_ns(&s->common, delay_ns);
50
}
51
s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
52
}
53
diff --git a/tests/qemu-iotests/185.out b/tests/qemu-iotests/185.out
54
index XXXXXXX..XXXXXXX 100644
55
--- a/tests/qemu-iotests/185.out
56
+++ b/tests/qemu-iotests/185.out
57
@@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.q
58
{"return": {}}
59
Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16
60
{"return": {}}
61
+{"return": {}}
62
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
63
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}}
64
-{"return": {}}
65
-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
66
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}}
67
68
=== Start backup job and exit qemu ===
69
--
70
2.13.6
71
72
diff view generated by jsdifflib
1
From: Max Reitz <mreitz@redhat.com>
1
From: Sakshi Kaushik <sakshikaushik717@gmail.com>
2
2
3
We already have an extensive mirror test (041) which does cover
3
Signed-off-by: Sakshi Kaushik <sakshikaushik717@gmail.com>
4
cancelling a mirror job, especially after it has emitted the READY
4
Message-id: 20220406162410.8536-1-sakshikaushik717@gmail.com
5
event. However, it does not check what exact events are emitted after
6
block-job-cancel is executed. More importantly, it does not use
7
throttling to ensure that it covers the case of block-job-cancel before
8
READY.
9
5
10
It would be possible to add this case to 041, but considering it is
6
[Name the iSCSI URL long option --iscsi-uri instead of --iscsi_uri for
11
already our largest test file, it makes sense to create a new file for
7
consistency, fix --fd which was rejected due to an outdated
12
these cases.
8
--socket-path check, and add missing entries[] terminator.
9
--Stefan]
13
10
14
Signed-off-by: Max Reitz <mreitz@redhat.com>
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15
Message-id: 20180501220509.14152-3-mreitz@redhat.com
16
Signed-off-by: Jeff Cody <jcody@redhat.com>
17
---
12
---
18
tests/qemu-iotests/218 | 138 +++++++++++++++++++++++++++++++++++++++++++++
13
contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++--------
19
tests/qemu-iotests/218.out | 30 ++++++++++
14
1 file changed, 52 insertions(+), 25 deletions(-)
20
tests/qemu-iotests/group | 1 +
21
3 files changed, 169 insertions(+)
22
create mode 100644 tests/qemu-iotests/218
23
create mode 100644 tests/qemu-iotests/218.out
24
15
25
diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218
16
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
26
new file mode 100644
17
index XXXXXXX..XXXXXXX 100644
27
index XXXXXXX..XXXXXXX
18
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
28
--- /dev/null
19
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
29
+++ b/tests/qemu-iotests/218
20
@@ -XXX,XX +XXX,XX @@ fail:
30
@@ -XXX,XX +XXX,XX @@
21
31
+#!/usr/bin/env python
22
/** vhost-user-scsi **/
32
+#
23
33
+# This test covers what happens when a mirror block job is cancelled
24
+static int opt_fdnum = -1;
34
+# in various phases of its existence.
25
+static char *opt_socket_path;
35
+#
26
+static gboolean opt_print_caps;
36
+# Note that this test only checks the emitted events (i.e.
27
+static char *iscsi_uri;
37
+# BLOCK_JOB_COMPLETED vs. BLOCK_JOB_CANCELLED), it does not compare
38
+# whether the target is in sync with the source when the
39
+# BLOCK_JOB_COMPLETED event occurs. This is covered by other tests
40
+# (such as 041).
41
+#
42
+# Copyright (C) 2018 Red Hat, Inc.
43
+#
44
+# This program is free software; you can redistribute it and/or modify
45
+# it under the terms of the GNU General Public License as published by
46
+# the Free Software Foundation; either version 2 of the License, or
47
+# (at your option) any later version.
48
+#
49
+# This program is distributed in the hope that it will be useful,
50
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
51
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52
+# GNU General Public License for more details.
53
+#
54
+# You should have received a copy of the GNU General Public License
55
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
56
+#
57
+# Creator/Owner: Max Reitz <mreitz@redhat.com>
58
+
28
+
59
+import iotests
29
+static GOptionEntry entries[] = {
60
+from iotests import log
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
+};
61
+
40
+
62
+iotests.verify_platform(['linux'])
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;
63
+
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
+ }
64
+
71
+
65
+# Launches the VM, adds two null-co nodes (source and target), and
72
+ if (opt_print_caps) {
66
+# starts a blockdev-mirror job on them.
73
+ g_print("{\n");
67
+#
74
+ g_print(" \"type\": \"scsi\"\n");
68
+# Either both or none of speed and buf_size must be given.
75
+ g_print("}\n");
76
+ goto out;
77
}
78
- if (!unix_fn || !iscsi_uri) {
69
+
79
+
70
+def start_mirror(vm, speed=None, buf_size=None):
80
+ if (!iscsi_uri) {
71
+ vm.launch()
81
goto help;
72
+
82
}
73
+ ret = vm.qmp('blockdev-add',
83
74
+ node_name='source',
84
- lsock = unix_sock_new(unix_fn);
75
+ driver='null-co',
85
- if (lsock < 0) {
76
+ size=1048576)
86
- goto err;
77
+ assert ret['return'] == {}
87
+ if (opt_socket_path) {
78
+
88
+ lsock = unix_sock_new(opt_socket_path);
79
+ ret = vm.qmp('blockdev-add',
89
+ if (lsock < 0) {
80
+ node_name='target',
90
+ exit(EXIT_FAILURE);
81
+ driver='null-co',
91
+ }
82
+ size=1048576)
92
+ } else if (opt_fdnum < 0) {
83
+ assert ret['return'] == {}
93
+ g_print("%s\n", g_option_context_get_help(context, true, NULL));
84
+
94
+ exit(EXIT_FAILURE);
85
+ if speed is not None:
95
+ } else {
86
+ ret = vm.qmp('blockdev-mirror',
96
+ lsock = opt_fdnum;
87
+ job_id='mirror',
97
}
88
+ device='source',
98
89
+ target='target',
99
csock = accept(lsock, NULL, NULL);
90
+ sync='full',
100
@@ -XXX,XX +XXX,XX @@ out:
91
+ speed=speed,
101
if (vdev_scsi) {
92
+ buf_size=buf_size)
102
g_main_loop_unref(vdev_scsi->loop);
93
+ else:
103
g_free(vdev_scsi);
94
+ ret = vm.qmp('blockdev-mirror',
104
- unlink(unix_fn);
95
+ job_id='mirror',
105
+ unlink(opt_socket_path);
96
+ device='source',
106
}
97
+ target='target',
107
if (csock >= 0) {
98
+ sync='full')
108
close(csock);
99
+
109
@@ -XXX,XX +XXX,XX @@ out:
100
+ assert ret['return'] == {}
110
if (lsock >= 0) {
101
+
111
close(lsock);
102
+
112
}
103
+log('')
113
- g_free(unix_fn);
104
+log('=== Cancel mirror job before convergence ===')
114
+ g_free(opt_socket_path);
105
+log('')
115
g_free(iscsi_uri);
106
+
116
107
+log('--- force=false ---')
117
return err;
108
+log('')
118
@@ -XXX,XX +XXX,XX @@ err:
109
+
119
goto out;
110
+with iotests.VM() as vm:
120
111
+ # Low speed so it does not converge
121
help:
112
+ start_mirror(vm, 65536, 65536)
122
- fprintf(stderr, "Usage: %s [ -u unix_sock_path -i iscsi_uri ] | [ -h ]\n",
113
+
123
+ fprintf(stderr, "Usage: %s [ -s socket-path -i iscsi-uri -f fd -p print-capabilities ] | [ -h ]\n",
114
+ log('Cancelling job')
124
argv[0]);
115
+ log(vm.qmp('block-job-cancel', device='mirror', force=False))
125
- fprintf(stderr, " -u path to unix socket\n");
116
+
126
- fprintf(stderr, " -i iscsi uri for lun 0\n");
117
+ log(vm.event_wait('BLOCK_JOB_CANCELLED'),
127
+ fprintf(stderr, " -s, --socket-path=SOCKET_PATH path to unix socket\n");
118
+ filters=[iotests.filter_qmp_event])
128
+ fprintf(stderr, " -i, --iscsi-uri=ISCSI_URI iscsi uri for lun 0\n");
119
+
129
+ fprintf(stderr, " -f, --fd=FILE_DESCRIPTOR file-descriptor\n");
120
+log('')
130
+ fprintf(stderr, " -p, --print-capabilities=PRINT_CAPABILITIES denotes print-capabilities\n");
121
+log('--- force=true ---')
131
fprintf(stderr, " -h print help and quit\n");
122
+log('')
132
123
+
133
goto err;
124
+with iotests.VM() as vm:
125
+ # Low speed so it does not converge
126
+ start_mirror(vm, 65536, 65536)
127
+
128
+ log('Cancelling job')
129
+ log(vm.qmp('block-job-cancel', device='mirror', force=True))
130
+
131
+ log(vm.event_wait('BLOCK_JOB_CANCELLED'),
132
+ filters=[iotests.filter_qmp_event])
133
+
134
+
135
+log('')
136
+log('=== Cancel mirror job after convergence ===')
137
+log('')
138
+
139
+log('--- force=false ---')
140
+log('')
141
+
142
+with iotests.VM() as vm:
143
+ start_mirror(vm)
144
+
145
+ log(vm.event_wait('BLOCK_JOB_READY'),
146
+ filters=[iotests.filter_qmp_event])
147
+
148
+ log('Cancelling job')
149
+ log(vm.qmp('block-job-cancel', device='mirror', force=False))
150
+
151
+ log(vm.event_wait('BLOCK_JOB_COMPLETED'),
152
+ filters=[iotests.filter_qmp_event])
153
+
154
+log('')
155
+log('--- force=true ---')
156
+log('')
157
+
158
+with iotests.VM() as vm:
159
+ start_mirror(vm)
160
+
161
+ log(vm.event_wait('BLOCK_JOB_READY'),
162
+ filters=[iotests.filter_qmp_event])
163
+
164
+ log('Cancelling job')
165
+ log(vm.qmp('block-job-cancel', device='mirror', force=True))
166
+
167
+ log(vm.event_wait('BLOCK_JOB_CANCELLED'),
168
+ filters=[iotests.filter_qmp_event])
169
diff --git a/tests/qemu-iotests/218.out b/tests/qemu-iotests/218.out
170
new file mode 100644
171
index XXXXXXX..XXXXXXX
172
--- /dev/null
173
+++ b/tests/qemu-iotests/218.out
174
@@ -XXX,XX +XXX,XX @@
175
+
176
+=== Cancel mirror job before convergence ===
177
+
178
+--- force=false ---
179
+
180
+Cancelling job
181
+{u'return': {}}
182
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 65536, u'len': 1048576, u'offset': 65536}, u'event': u'BLOCK_JOB_CANCELLED'}
183
+
184
+--- force=true ---
185
+
186
+Cancelling job
187
+{u'return': {}}
188
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 65536, u'len': 1048576, u'offset': 65536}, u'event': u'BLOCK_JOB_CANCELLED'}
189
+
190
+=== Cancel mirror job after convergence ===
191
+
192
+--- force=false ---
193
+
194
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'offset': 1048576}, u'event': u'BLOCK_JOB_READY'}
195
+Cancelling job
196
+{u'return': {}}
197
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'offset': 1048576}, u'event': u'BLOCK_JOB_COMPLETED'}
198
+
199
+--- force=true ---
200
+
201
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'offset': 1048576}, u'event': u'BLOCK_JOB_READY'}
202
+Cancelling job
203
+{u'return': {}}
204
+{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'offset': 1048576}, u'event': u'BLOCK_JOB_CANCELLED'}
205
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
206
index XXXXXXX..XXXXXXX 100644
207
--- a/tests/qemu-iotests/group
208
+++ b/tests/qemu-iotests/group
209
@@ -XXX,XX +XXX,XX @@
210
211 rw auto quick
211
212 rw auto quick
212
213 rw auto quick
213
+218 rw auto quick
214
--
134
--
215
2.13.6
135
2.35.1
216
217
diff view generated by jsdifflib
1
From: Max Reitz <mreitz@redhat.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
Commit b76e4458b1eb3c32e9824fe6aa51f67d2b251748 made the mirror block
6
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4
job respect block-job-cancel's @force flag: With that flag set, it would
7
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
5
now always really cancel, even post-READY.
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(-)
6
13
7
Unfortunately, it had a side effect: Without that flag set, it would now
14
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
8
never cancel, not even before READY. Considering that is an
9
incompatible change and not noted anywhere in the commit or the
10
description of block-job-cancel's @force parameter, this seems
11
unintentional and we should revert to the previous behavior, which is to
12
immediately cancel the job when block-job-cancel is called before source
13
and target are in sync (i.e. before the READY event).
14
15
Cc: qemu-stable@nongnu.org
16
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1572856
17
Reported-by: Yanan Fu <yfu@redhat.com>
18
Signed-off-by: Max Reitz <mreitz@redhat.com>
19
Reviewed-by: Eric Blake <eblake@redhat.com>
20
Message-id: 20180501220509.14152-2-mreitz@redhat.com
21
Reviewed-by: Jeff Cody <jcody@redhat.com>
22
Signed-off-by: Jeff Cody <jcody@redhat.com>
23
---
24
block/mirror.c | 4 +++-
25
1 file changed, 3 insertions(+), 1 deletion(-)
26
27
diff --git a/block/mirror.c b/block/mirror.c
28
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
29
--- a/block/mirror.c
16
--- a/contrib/vhost-user-blk/vhost-user-blk.c
30
+++ b/block/mirror.c
17
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
31
@@ -XXX,XX +XXX,XX @@ static void coroutine_fn mirror_run(void *opaque)
18
@@ -XXX,XX +XXX,XX @@ static GOptionEntry entries[] = {
32
}
19
{"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file,
33
trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);
20
"block device or file path", "PATH"},
34
block_job_sleep_ns(&s->common, delay_ns);
21
{ "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only,
35
- if (block_job_is_cancelled(&s->common) && s->common.force) {
22
- "Enable read-only", NULL }
36
+ if (block_job_is_cancelled(&s->common) &&
23
+ "Enable read-only", NULL },
37
+ (!s->synced || s->common.force))
24
+ { NULL, },
38
+ {
25
};
39
break;
26
40
}
27
int main(int argc, char **argv)
41
s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
42
--
28
--
43
2.13.6
29
2.35.1
44
45
diff view generated by jsdifflib
1
From: Kevin Wolf <kwolf@redhat.com>
1
From: Liu Yiding <liuyd.fnst@fujitsu.com>
2
2
3
Both the option string for the 'redundancy' option and the
3
virtiofsd has introduced killpriv_v2/no_killpriv_v2 for a while. Add
4
SheepdogRedundancy object that is created accordingly could be leaked in
4
description of it to docs/helper.
5
error paths. This fixes the memory leaks.
6
5
7
Reported by Coverity (CID 1390614 and 1390641).
6
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
7
Message-Id: <20220421095151.2231099-1-liuyd.fnst@fujitsu.com>
8
8
9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9
[Small documentation fixes: s/as client supports/as the client supports/
10
Message-id: 20180503153509.22223-1-kwolf@redhat.com
10
and s/. /. /.
11
Reviewed-by: Jeff Cody <jcody@redhat.com>
11
--Stefan]
12
Signed-off-by: Jeff Cody <jcody@redhat.com>
12
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
13
---
14
---
14
block/sheepdog.c | 4 +++-
15
docs/tools/virtiofsd.rst | 5 +++++
15
1 file changed, 3 insertions(+), 1 deletion(-)
16
tools/virtiofsd/helper.c | 3 +++
17
2 files changed, 8 insertions(+)
16
18
17
diff --git a/block/sheepdog.c b/block/sheepdog.c
19
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
18
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
19
--- a/block/sheepdog.c
21
--- a/docs/tools/virtiofsd.rst
20
+++ b/block/sheepdog.c
22
+++ b/docs/tools/virtiofsd.rst
21
@@ -XXX,XX +XXX,XX @@ static SheepdogRedundancy *parse_redundancy_str(const char *opt)
23
@@ -XXX,XX +XXX,XX @@ Options
22
} else {
24
label. Server will try to set that label on newly created file
23
ret = qemu_strtol(n2, NULL, 10, &parity);
25
atomically wherever possible.
24
if (ret < 0) {
26
25
+ g_free(redundancy);
27
+ * killpriv_v2|no_killpriv_v2 -
26
return NULL;
28
+ Enable/disable ``FUSE_HANDLE_KILLPRIV_V2`` support. KILLPRIV_V2 is enabled
27
}
29
+ by default as long as the client supports it. Enabling this option helps
28
30
+ with performance in write path.
29
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn sd_co_create_opts(const char *filename, QemuOpts *opts,
31
+
30
QDict *qdict, *location_qdict;
32
.. option:: --socket-path=PATH
31
QObject *crumpled;
33
32
Visitor *v;
34
Listen on vhost-user UNIX domain socket at PATH.
33
- const char *redundancy;
35
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
34
+ char *redundancy;
36
index XXXXXXX..XXXXXXX 100644
35
Error *local_err = NULL;
37
--- a/tools/virtiofsd/helper.c
36
int ret;
38
+++ b/tools/virtiofsd/helper.c
37
39
@@ -XXX,XX +XXX,XX @@ void fuse_cmdline_help(void)
38
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn sd_co_create_opts(const char *filename, QemuOpts *opts,
40
" -o announce_submounts Announce sub-mount points to the guest\n"
39
fail:
41
" -o posix_acl/no_posix_acl Enable/Disable posix_acl. (default: disabled)\n"
40
qapi_free_BlockdevCreateOptions(create_options);
42
" -o security_label/no_security_label Enable/Disable security label. (default: disabled)\n"
41
qobject_unref(qdict);
43
+ " -o killpriv_v2/no_killpriv_v2\n"
42
+ g_free(redundancy);
44
+ " Enable/Disable FUSE_HANDLE_KILLPRIV_V2.\n"
43
return ret;
45
+ " (default: enabled as long as client supports it)\n"
46
);
44
}
47
}
45
48
46
--
49
--
47
2.13.6
50
2.35.1
48
49
diff view generated by jsdifflib