1
The following changes since commit ee135aa0428fe5af2af7be04ff16d2b596a9330a:
1
The following changes since commit 9c125d17e9402c232c46610802e5931b3639d77b:
2
2
3
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.1-20180821' into staging (2018-08-21 13:27:11 +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 26bf474ba92c76e61bea51726e22da6dfd185296:
9
for you to fetch changes up to d45c83328feab2e4083991693160f0a417cfd9b0:
10
10
11
block: iotest to catch abort on forced blockjob cancel (2018-08-21 15:20:37 -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 job 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
Jeff Cody (2):
21
Liu Yiding (1):
18
block: for jobs, do not clear user_paused until after the resume
22
virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option
19
block: iotest to catch abort on forced blockjob cancel
20
23
21
job.c | 2 +-
24
Sakshi Kaushik (1):
22
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
25
Implements Backend Program conventions for vhost-user-scsi
23
tests/qemu-iotests/229.out | 23 +++++++++
26
24
tests/qemu-iotests/group | 1 +
27
Stefan Hajnoczi (1):
25
4 files changed, 120 insertions(+), 1 deletion(-)
28
contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
26
create mode 100755 tests/qemu-iotests/229
29
27
create mode 100644 tests/qemu-iotests/229.out
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(-)
28
35
29
--
36
--
30
2.17.1
37
2.35.1
31
32
diff view generated by jsdifflib
New patch
1
From: Sakshi Kaushik <sakshikaushik717@gmail.com>
1
2
3
Signed-off-by: Sakshi Kaushik <sakshikaushik717@gmail.com>
4
Message-id: 20220406162410.8536-1-sakshikaushik717@gmail.com
5
6
[Name the iSCSI URL long option --iscsi-uri instead of --iscsi_uri for
7
consistency, fix --fd which was rejected due to an outdated
8
--socket-path check, and add missing entries[] terminator.
9
--Stefan]
10
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12
---
13
contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++--------
14
1 file changed, 52 insertions(+), 25 deletions(-)
15
16
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
19
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
20
@@ -XXX,XX +XXX,XX @@ fail:
21
22
/** vhost-user-scsi **/
23
24
+static int opt_fdnum = -1;
25
+static char *opt_socket_path;
26
+static gboolean opt_print_caps;
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;
134
--
135
2.35.1
diff view generated by jsdifflib
1
Signed-off-by: Jeff Cody <jcody@redhat.com>
1
The GLib documentation says "a NULL-terminated array of GOptionEntrys"
2
Reviewed-by: John Snow <jsnow@redhat.com>
2
so we'd better make sure there is a terminator that lets
3
Message-id: df317f617fbe5affcf699cb8560e7b0c2e028a64.1534868459.git.jcody@redhat.com
3
g_option_context_add_main_entries() know when the end of the array has
4
Signed-off-by: Jeff Cody <jcody@redhat.com>
4
been reached.
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>
5
---
10
---
6
tests/qemu-iotests/229 | 95 ++++++++++++++++++++++++++++++++++++++
11
contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-
7
tests/qemu-iotests/229.out | 23 +++++++++
12
1 file changed, 2 insertions(+), 1 deletion(-)
8
tests/qemu-iotests/group | 1 +
9
3 files changed, 119 insertions(+)
10
create mode 100755 tests/qemu-iotests/229
11
create mode 100644 tests/qemu-iotests/229.out
12
13
13
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229
14
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
14
new file mode 100755
15
index XXXXXXX..XXXXXXX
16
--- /dev/null
17
+++ b/tests/qemu-iotests/229
18
@@ -XXX,XX +XXX,XX @@
19
+#!/bin/bash
20
+#
21
+# Test for force canceling a running blockjob that is paused in
22
+# an error state.
23
+#
24
+# Copyright (C) 2018 Red Hat, Inc.
25
+#
26
+# This program is free software; you can redistribute it and/or modify
27
+# it under the terms of the GNU General Public License as published by
28
+# the Free Software Foundation; either version 2 of the License, or
29
+# (at your option) any later version.
30
+#
31
+# This program is distributed in the hope that it will be useful,
32
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+# GNU General Public License for more details.
35
+#
36
+# You should have received a copy of the GNU General Public License
37
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
38
+#
39
+
40
+# creator
41
+owner=jcody@redhat.com
42
+
43
+seq="$(basename $0)"
44
+echo "QA output created by $seq"
45
+
46
+here="$PWD"
47
+status=1    # failure is the default!
48
+
49
+_cleanup()
50
+{
51
+ _cleanup_qemu
52
+ _cleanup_test_img
53
+ rm -f "$TEST_IMG" "$DEST_IMG"
54
+}
55
+trap "_cleanup; exit \$status" 0 1 2 3 15
56
+
57
+# get standard environment, filters and checks
58
+. ./common.rc
59
+. ./common.filter
60
+. ./common.qemu
61
+
62
+# Needs backing file and backing format support
63
+_supported_fmt qcow2 qed
64
+_supported_proto file
65
+_supported_os Linux
66
+
67
+
68
+DEST_IMG="$TEST_DIR/d.$IMGFMT"
69
+TEST_IMG="$TEST_DIR/b.$IMGFMT"
70
+
71
+_make_test_img 2M
72
+
73
+# destination for mirror will be too small, causing error
74
+TEST_IMG=$DEST_IMG _make_test_img 1M
75
+
76
+$QEMU_IO -c 'write 0 2M' "$TEST_IMG" | _filter_qemu_io
77
+
78
+_launch_qemu -drive id=testdisk,file="$TEST_IMG",format="$IMGFMT"
79
+
80
+_send_qemu_cmd $QEMU_HANDLE \
81
+ "{'execute': 'qmp_capabilities'}" \
82
+ 'return'
83
+
84
+echo
85
+echo '=== Starting drive-mirror, causing error & stop ==='
86
+echo
87
+
88
+_send_qemu_cmd $QEMU_HANDLE \
89
+ "{'execute': 'drive-mirror',
90
+ 'arguments': {'device': 'testdisk',
91
+ 'mode': 'absolute-paths',
92
+ 'format': '$IMGFMT',
93
+ 'target': '$DEST_IMG',
94
+ 'sync': 'full',
95
+ 'mode': 'existing',
96
+ 'on-source-error': 'stop',
97
+ 'on-target-error': 'stop' }}" \
98
+ "JOB_STATUS_CHANGE.*pause"
99
+
100
+echo
101
+echo '=== Force cancel job paused in error state ==='
102
+echo
103
+
104
+success_or_failure="y" _send_qemu_cmd $QEMU_HANDLE \
105
+ "{'execute': 'block-job-cancel',
106
+ 'arguments': { 'device': 'testdisk',
107
+ 'force': true}}" \
108
+ "BLOCK_JOB_CANCELLED" "Assertion"
109
+
110
+# success, all done
111
+echo "*** done"
112
+rm -f $seq.full
113
+status=0
114
diff --git a/tests/qemu-iotests/229.out b/tests/qemu-iotests/229.out
115
new file mode 100644
116
index XXXXXXX..XXXXXXX
117
--- /dev/null
118
+++ b/tests/qemu-iotests/229.out
119
@@ -XXX,XX +XXX,XX @@
120
+QA output created by 229
121
+Formatting 'TEST_DIR/b.IMGFMT', fmt=IMGFMT size=2097152
122
+Formatting 'TEST_DIR/d.IMGFMT', fmt=IMGFMT size=1048576
123
+wrote 2097152/2097152 bytes at offset 0
124
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
125
+{"return": {}}
126
+
127
+=== Starting drive-mirror, causing error & stop ===
128
+
129
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "testdisk"}}
130
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}}
131
+{"return": {}}
132
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "testdisk", "operation": "write", "action": "stop"}}
133
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "paused", "id": "testdisk"}}
134
+
135
+=== Force cancel job paused in error state ===
136
+
137
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "testdisk"}}
138
+{"return": {}}
139
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "testdisk", "operation": "write", "action": "stop"}}
140
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "testdisk"}}
141
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "testdisk", "len": 2097152, "offset": 1048576, "speed": 0, "type": "mirror"}}
142
+*** done
143
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
144
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
145
--- a/tests/qemu-iotests/group
16
--- a/contrib/vhost-user-blk/vhost-user-blk.c
146
+++ b/tests/qemu-iotests/group
17
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
147
@@ -XXX,XX +XXX,XX @@
18
@@ -XXX,XX +XXX,XX @@ static GOptionEntry entries[] = {
148
225 rw auto quick
19
{"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file,
149
226 auto quick
20
"block device or file path", "PATH"},
150
227 auto quick
21
{ "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only,
151
+229 auto quick
22
- "Enable read-only", NULL }
23
+ "Enable read-only", NULL },
24
+ { NULL, },
25
};
26
27
int main(int argc, char **argv)
152
--
28
--
153
2.17.1
29
2.35.1
154
155
diff view generated by jsdifflib
1
The function job_cancel_async() will always cause an assert for blockjob
1
From: Liu Yiding <liuyd.fnst@fujitsu.com>
2
user resume. We set job->user_paused to false, and then call
3
job->driver->user_resume(). In the case of blockjobs, this is the
4
block_job_user_resume() function.
5
2
6
In that function, we assert that job.user_paused is set to true.
3
virtiofsd has introduced killpriv_v2/no_killpriv_v2 for a while. Add
7
Unfortunately, right before calling this function, it has explicitly
4
description of it to docs/helper.
8
been set to false.
9
5
10
The fix is pretty simple: set job->user_paused to false only after the
6
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
11
job user_resume() function has been called.
7
Message-Id: <20220421095151.2231099-1-liuyd.fnst@fujitsu.com>
12
8
13
Reviewed-by: John Snow <jsnow@redhat.com>
9
[Small documentation fixes: s/as client supports/as the client supports/
14
Reviewed-by: Eric Blake <eblake@redhat.com>
10
and s/. /. /.
15
Signed-off-by: Jeff Cody <jcody@redhat.com>
11
--Stefan]
16
Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459.git.jcody@redhat.com
12
17
Signed-off-by: Jeff Cody <jcody@redhat.com>
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
18
---
14
---
19
job.c | 2 +-
15
docs/tools/virtiofsd.rst | 5 +++++
20
1 file changed, 1 insertion(+), 1 deletion(-)
16
tools/virtiofsd/helper.c | 3 +++
17
2 files changed, 8 insertions(+)
21
18
22
diff --git a/job.c b/job.c
19
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
23
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
24
--- a/job.c
21
--- a/docs/tools/virtiofsd.rst
25
+++ b/job.c
22
+++ b/docs/tools/virtiofsd.rst
26
@@ -XXX,XX +XXX,XX @@ static void job_cancel_async(Job *job, bool force)
23
@@ -XXX,XX +XXX,XX @@ Options
27
{
24
label. Server will try to set that label on newly created file
28
if (job->user_paused) {
25
atomically wherever possible.
29
/* Do not call job_enter here, the caller will handle it. */
26
30
- job->user_paused = false;
27
+ * killpriv_v2|no_killpriv_v2 -
31
if (job->driver->user_resume) {
28
+ Enable/disable ``FUSE_HANDLE_KILLPRIV_V2`` support. KILLPRIV_V2 is enabled
32
job->driver->user_resume(job);
29
+ by default as long as the client supports it. Enabling this option helps
33
}
30
+ with performance in write path.
34
+ job->user_paused = false;
31
+
35
assert(job->pause_count > 0);
32
.. option:: --socket-path=PATH
36
job->pause_count--;
33
37
}
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
38
--
49
--
39
2.17.1
50
2.35.1
40
41
diff view generated by jsdifflib