1
The following changes since commit 8cb41fda78c7ebde0dd248c6afe1d336efb0de50:
1
The following changes since commit 9c125d17e9402c232c46610802e5931b3639d77b:
2
2
3
Merge remote-tracking branch 'remotes/philmd/tags/machine-20211101' into staging (2021-11-02 05:53:45 -0400)
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://github.com/XanClic/qemu.git tags/pull-block-2021-11-02
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 7da9623cc078229caf07c290e16401ccdb9408d2:
9
for you to fetch changes up to d45c83328feab2e4083991693160f0a417cfd9b0:
10
10
11
block/vpc: Add a sanity check that fixed-size images have the right type (2021-11-02 12:47:51 +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
Emanuele Giuseppe Esposito (1):
14
Pull request
15
pylint: fix errors and warnings generated by tests/qemu-iotests/297
16
15
17
Eric Blake (1):
16
Small contrib/vhost-user-blk, contrib/vhost-user-scsi, and tools/virtiofsd
18
qemu-img: Consistent docs for convert -F
17
improvements.
19
18
20
Thomas Huth (1):
19
----------------------------------------------------------------
21
block/vpc: Add a sanity check that fixed-size images have the right
22
type
23
20
24
Thomas Weißschuh (1):
21
Liu Yiding (1):
25
vmdk: allow specification of tools version
22
virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option
26
23
27
docs/tools/qemu-img.rst | 2 +-
24
Sakshi Kaushik (1):
28
qapi/block-core.json | 3 +++
25
Implements Backend Program conventions for vhost-user-scsi
29
block/vmdk.c | 24 ++++++++++++++++++++----
26
30
block/vpc.c | 3 ++-
27
Stefan Hajnoczi (1):
31
qemu-img-cmds.hx | 2 +-
28
contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
32
tests/qemu-iotests/129 | 18 +++++++++---------
29
33
tests/qemu-iotests/310 | 16 ++++++++--------
30
docs/tools/virtiofsd.rst | 5 ++
34
tests/qemu-iotests/check | 11 ++++++-----
31
contrib/vhost-user-blk/vhost-user-blk.c | 3 +-
35
tests/qemu-iotests/iotests.py | 7 ++++---
32
contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++--------
36
tests/qemu-iotests/tests/image-fleecing | 4 ++--
33
tools/virtiofsd/helper.c | 3 +
37
10 files changed, 56 insertions(+), 34 deletions(-)
34
4 files changed, 62 insertions(+), 26 deletions(-)
38
35
39
--
36
--
40
2.31.1
37
2.35.1
41
42
diff view generated by jsdifflib
Deleted patch
1
From: Eric Blake <eblake@redhat.com>
2
1
3
Use consistent capitalization, and fix a missed line (we duplicate the
4
qemu-img synopses in too many places).
5
6
Fixes: 1899bf4737 (qemu-img: Add -F shorthand to convert)
7
Signed-off-by: Eric Blake <eblake@redhat.com>
8
Message-Id: <20210921142812.2631605-1-eblake@redhat.com>
9
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
10
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
11
---
12
docs/tools/qemu-img.rst | 2 +-
13
qemu-img-cmds.hx | 2 +-
14
2 files changed, 2 insertions(+), 2 deletions(-)
15
16
diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
17
index XXXXXXX..XXXXXXX 100644
18
--- a/docs/tools/qemu-img.rst
19
+++ b/docs/tools/qemu-img.rst
20
@@ -XXX,XX +XXX,XX @@ Command description:
21
4
22
Error on reading data
23
24
-.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps [--skip-broken-bitmaps]] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE [-F backing_fmt]] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME
25
+.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps [--skip-broken-bitmaps]] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE [-F BACKING_FMT]] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME
26
27
Convert the disk image *FILENAME* or a snapshot *SNAPSHOT_PARAM*
28
to disk image *OUTPUT_FILENAME* using format *OUTPUT_FMT*. It can
29
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
30
index XXXXXXX..XXXXXXX 100644
31
--- a/qemu-img-cmds.hx
32
+++ b/qemu-img-cmds.hx
33
@@ -XXX,XX +XXX,XX @@ ERST
34
DEF("convert", img_convert,
35
"convert [--object objectdef] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file [-F backing_fmt]] [-o options] [-l snapshot_param] [-S sparse_size] [-r rate_limit] [-m num_coroutines] [-W] [--salvage] filename [filename2 [...]] output_filename")
36
SRST
37
-.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] [--salvage] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME
38
+.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE [-F BACKING_FMT]] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] [--salvage] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME
39
ERST
40
41
DEF("create", img_create,
42
--
43
2.31.1
44
45
diff view generated by jsdifflib
1
From: Thomas Weißschuh <thomas.weissschuh.ext@zeiss.com>
1
From: Sakshi Kaushik <sakshikaushik717@gmail.com>
2
2
3
VMDK files support an attribute that represents the version of the guest
3
Signed-off-by: Sakshi Kaushik <sakshikaushik717@gmail.com>
4
tools that are installed on the disk.
4
Message-id: 20220406162410.8536-1-sakshikaushik717@gmail.com
5
This attribute is used by vSphere before a machine has been started to
6
determine if the VM has the guest tools installed.
7
This is important when configuring "Operating system customizations" in
8
vSphere, as it checks for the presence of the guest tools before
9
allowing those customizations.
10
Thus when the VM has not yet booted normally it would be impossible to
11
customize it, therefore preventing a customized first-boot.
12
5
13
The attribute should not hurt on disks that do not have the guest tools
6
[Name the iSCSI URL long option --iscsi-uri instead of --iscsi_uri for
14
installed and indeed the VMware tools also unconditionally add this
7
consistency, fix --fd which was rejected due to an outdated
15
attribute.
8
--socket-path check, and add missing entries[] terminator.
16
(Defaulting to the value "2147483647", as is done in this patch)
9
--Stefan]
17
10
18
Signed-off-by: Thomas Weißschuh <thomas.weissschuh.ext@zeiss.com>
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19
Message-Id: <20210913130419.13241-1-thomas.weissschuh.ext@zeiss.com>
20
[hreitz: Added missing '#' in block-core.json]
21
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
22
---
12
---
23
qapi/block-core.json | 3 +++
13
contrib/vhost-user-scsi/vhost-user-scsi.c | 77 +++++++++++++++--------
24
block/vmdk.c | 24 ++++++++++++++++++++----
14
1 file changed, 52 insertions(+), 25 deletions(-)
25
2 files changed, 23 insertions(+), 4 deletions(-)
26
15
27
diff --git a/qapi/block-core.json b/qapi/block-core.json
16
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
28
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
29
--- a/qapi/block-core.json
18
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
30
+++ b/qapi/block-core.json
19
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
31
@@ -XXX,XX +XXX,XX @@
20
@@ -XXX,XX +XXX,XX @@ fail:
32
# @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
21
33
# @hwversion: Hardware version. The meaningful options are "4" or "6".
22
/** vhost-user-scsi **/
34
# Default: "4".
23
35
+# @toolsversion: VMware guest tools version.
24
+static int opt_fdnum = -1;
36
+# Default: "2147483647" (Since 6.2)
25
+static char *opt_socket_path;
37
# @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
26
+static gboolean opt_print_caps;
38
# Default: false.
27
+static char *iscsi_uri;
39
#
28
+
40
@@ -XXX,XX +XXX,XX @@
29
+static GOptionEntry entries[] = {
41
'*backing-file': 'str',
30
+ { "print-capabilities", 'c', 0, G_OPTION_ARG_NONE, &opt_print_caps,
42
'*adapter-type': 'BlockdevVmdkAdapterType',
31
+ "Print capabilities", NULL },
43
'*hwversion': 'str',
32
+ { "fd", 'f', 0, G_OPTION_ARG_INT, &opt_fdnum,
44
+ '*toolsversion': 'str',
33
+ "Use inherited fd socket", "FDNUM" },
45
'*zeroed-grain': 'bool' } }
34
+ { "iscsi-uri", 'i', 0, G_OPTION_ARG_FILENAME, &iscsi_uri,
46
35
+ "iSCSI URI to connect to", "FDNUM" },
47
36
+ { "socket-path", 's', 0, G_OPTION_ARG_FILENAME, &opt_socket_path,
48
diff --git a/block/vmdk.c b/block/vmdk.c
37
+ "Use UNIX socket path", "PATH" },
49
index XXXXXXX..XXXXXXX 100644
38
+ { NULL, }
50
--- a/block/vmdk.c
39
+};
51
+++ b/block/vmdk.c
40
+
52
@@ -XXX,XX +XXX,XX @@
41
int main(int argc, char **argv)
53
#define VMDK_ZEROED (-3)
42
{
54
43
VusDev *vdev_scsi = NULL;
55
#define BLOCK_OPT_ZEROED_GRAIN "zeroed_grain"
44
- char *unix_fn = NULL;
56
+#define BLOCK_OPT_TOOLSVERSION "toolsversion"
45
- char *iscsi_uri = NULL;
57
46
- int lsock = -1, csock = -1, opt, err = EXIT_SUCCESS;
58
typedef struct {
47
+ int lsock = -1, csock = -1, err = EXIT_SUCCESS;
59
uint32_t version;
48
60
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
49
- while ((opt = getopt(argc, argv, "u:i:")) != -1) {
61
BlockdevVmdkAdapterType adapter_type,
50
- switch (opt) {
62
const char *backing_file,
51
- case 'h':
63
const char *hw_version,
52
- goto help;
64
+ const char *toolsversion,
53
- case 'u':
65
bool compat6,
54
- unix_fn = g_strdup(optarg);
66
bool zeroed_grain,
55
- break;
67
vmdk_create_extent_fn extent_fn,
56
- case 'i':
68
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
57
- iscsi_uri = g_strdup(optarg);
69
"ddb.geometry.cylinders = \"%" PRId64 "\"\n"
58
- break;
70
"ddb.geometry.heads = \"%" PRIu32 "\"\n"
59
- default:
71
"ddb.geometry.sectors = \"63\"\n"
60
- goto help;
72
- "ddb.adapterType = \"%s\"\n";
61
- }
73
+ "ddb.adapterType = \"%s\"\n"
62
+ GError *error = NULL;
74
+ "ddb.toolsVersion = \"%s\"\n";
63
+ GOptionContext *context;
75
64
+
76
ext_desc_lines = g_string_new(NULL);
65
+ context = g_option_context_new(NULL);
77
66
+ g_option_context_add_main_entries(context, entries, NULL);
78
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
67
+ if (!g_option_context_parse(context, &argc, &argv, &error)) {
79
if (!hw_version) {
68
+ g_printerr("Option parsing failed: %s\n", error->message);
80
hw_version = "4";
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;
81
}
77
}
82
+ if (!toolsversion) {
78
- if (!unix_fn || !iscsi_uri) {
83
+ toolsversion = "2147483647";
79
+
84
+ }
80
+ if (!iscsi_uri) {
85
81
goto help;
86
if (adapter_type != BLOCKDEV_VMDK_ADAPTER_TYPE_IDE) {
82
}
87
/* that's the number of heads with which vmware operates when
83
88
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
84
- lsock = unix_sock_new(unix_fn);
89
size /
85
- if (lsock < 0) {
90
(int64_t)(63 * number_heads * BDRV_SECTOR_SIZE),
86
- goto err;
91
number_heads,
87
+ if (opt_socket_path) {
92
- BlockdevVmdkAdapterType_str(adapter_type));
88
+ lsock = unix_sock_new(opt_socket_path);
93
+ BlockdevVmdkAdapterType_str(adapter_type),
89
+ if (lsock < 0) {
94
+ toolsversion);
90
+ exit(EXIT_FAILURE);
95
desc_len = strlen(desc);
91
+ }
96
/* the descriptor offset = 0x200 */
92
+ } else if (opt_fdnum < 0) {
97
if (!split && !flat) {
93
+ g_print("%s\n", g_option_context_get_help(context, true, NULL));
98
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
94
+ exit(EXIT_FAILURE);
99
BlockdevVmdkAdapterType adapter_type_enum;
95
+ } else {
100
char *backing_file = NULL;
96
+ lsock = opt_fdnum;
101
char *hw_version = NULL;
97
}
102
+ char *toolsversion = NULL;
98
103
char *fmt = NULL;
99
csock = accept(lsock, NULL, NULL);
104
BlockdevVmdkSubformat subformat;
100
@@ -XXX,XX +XXX,XX @@ out:
105
int ret = 0;
101
if (vdev_scsi) {
106
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
102
g_main_loop_unref(vdev_scsi->loop);
107
adapter_type = qemu_opt_get_del(opts, BLOCK_OPT_ADAPTER_TYPE);
103
g_free(vdev_scsi);
108
backing_file = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FILE);
104
- unlink(unix_fn);
109
hw_version = qemu_opt_get_del(opts, BLOCK_OPT_HWVERSION);
105
+ unlink(opt_socket_path);
110
+ toolsversion = qemu_opt_get_del(opts, BLOCK_OPT_TOOLSVERSION);
106
}
111
compat6 = qemu_opt_get_bool_del(opts, BLOCK_OPT_COMPAT6, false);
107
if (csock >= 0) {
112
if (strcmp(hw_version, "undefined") == 0) {
108
close(csock);
113
g_free(hw_version);
109
@@ -XXX,XX +XXX,XX @@ out:
114
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
110
if (lsock >= 0) {
115
.opts = opts,
111
close(lsock);
116
};
112
}
117
ret = vmdk_co_do_create(total_size, subformat, adapter_type_enum,
113
- g_free(unix_fn);
118
- backing_file, hw_version, compat6, zeroed_grain,
114
+ g_free(opt_socket_path);
119
- vmdk_co_create_opts_cb, &data, errp);
115
g_free(iscsi_uri);
120
+ backing_file, hw_version, toolsversion, compat6,
116
121
+ zeroed_grain, vmdk_co_create_opts_cb, &data, errp);
117
return err;
122
118
@@ -XXX,XX +XXX,XX @@ err:
123
exit:
119
goto out;
124
g_free(backing_fmt);
120
125
g_free(adapter_type);
121
help:
126
g_free(backing_file);
122
- fprintf(stderr, "Usage: %s [ -u unix_sock_path -i iscsi_uri ] | [ -h ]\n",
127
g_free(hw_version);
123
+ fprintf(stderr, "Usage: %s [ -s socket-path -i iscsi-uri -f fd -p print-capabilities ] | [ -h ]\n",
128
+ g_free(toolsversion);
124
argv[0]);
129
g_free(fmt);
125
- fprintf(stderr, " -u path to unix socket\n");
130
g_free(desc);
126
- fprintf(stderr, " -i iscsi uri for lun 0\n");
131
g_free(path);
127
+ fprintf(stderr, " -s, --socket-path=SOCKET_PATH path to unix socket\n");
132
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn vmdk_co_create(BlockdevCreateOptions *create_options,
128
+ fprintf(stderr, " -i, --iscsi-uri=ISCSI_URI iscsi uri for lun 0\n");
133
opts->adapter_type,
129
+ fprintf(stderr, " -f, --fd=FILE_DESCRIPTOR file-descriptor\n");
134
opts->backing_file,
130
+ fprintf(stderr, " -p, --print-capabilities=PRINT_CAPABILITIES denotes print-capabilities\n");
135
opts->hwversion,
131
fprintf(stderr, " -h print help and quit\n");
136
+ opts->toolsversion,
132
137
false,
133
goto err;
138
opts->zeroed_grain,
139
vmdk_co_create_cb,
140
@@ -XXX,XX +XXX,XX @@ static QemuOptsList vmdk_create_opts = {
141
.help = "VMDK hardware version",
142
.def_value_str = "undefined"
143
},
144
+ {
145
+ .name = BLOCK_OPT_TOOLSVERSION,
146
+ .type = QEMU_OPT_STRING,
147
+ .help = "VMware guest tools version",
148
+ },
149
{
150
.name = BLOCK_OPT_SUBFMT,
151
.type = QEMU_OPT_STRING,
152
--
134
--
153
2.31.1
135
2.35.1
154
155
diff view generated by jsdifflib
1
From: Thomas Huth <thuth@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
The code in vpc.c uses BDRVVPCState->footer.type in various places
6
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4
to decide whether the image is a fixed-size (VHD_FIXED) or a dynamic
7
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
5
(VHD_DYNAMIC) image. However, we never check that this field really
8
Message-id: 20220411150057.3009667-1-stefanha@redhat.com
6
contains VHD_FIXED if we detected a fixed size image in vpc_open(),
9
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
so a wrong value here could cause quite some trouble during runtime.
8
9
Suggested-by: Kevin Wolf <kwolf@redhat.com>
10
Signed-off-by: Thomas Huth <thuth@redhat.com>
11
Message-Id: <20211012082702.792259-1-thuth@redhat.com>
12
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
13
---
10
---
14
block/vpc.c | 3 ++-
11
contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-
15
1 file changed, 2 insertions(+), 1 deletion(-)
12
1 file changed, 2 insertions(+), 1 deletion(-)
16
13
17
diff --git a/block/vpc.c b/block/vpc.c
14
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
18
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
19
--- a/block/vpc.c
16
--- a/contrib/vhost-user-blk/vhost-user-blk.c
20
+++ b/block/vpc.c
17
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
21
@@ -XXX,XX +XXX,XX @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
18
@@ -XXX,XX +XXX,XX @@ static GOptionEntry entries[] = {
22
if (ret < 0) {
19
{"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file,
23
goto fail;
20
"block device or file path", "PATH"},
24
}
21
{ "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only,
25
- if (strncmp(footer->creator, "conectix", 8)) {
22
- "Enable read-only", NULL }
26
+ if (strncmp(footer->creator, "conectix", 8) ||
23
+ "Enable read-only", NULL },
27
+ be32_to_cpu(footer->type) != VHD_FIXED) {
24
+ { NULL, },
28
error_setg(errp, "invalid VPC image");
25
};
29
ret = -EINVAL;
26
30
goto fail;
27
int main(int argc, char **argv)
31
--
28
--
32
2.31.1
29
2.35.1
33
34
diff view generated by jsdifflib
1
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
1
From: Liu Yiding <liuyd.fnst@fujitsu.com>
2
2
3
Test 297 in tests/qemu-iotests currently fails: pylint has
3
virtiofsd has introduced killpriv_v2/no_killpriv_v2 for a while. Add
4
learned new things to check, or we simply missed them.
4
description of it to docs/helper.
5
5
6
All fixes in this patch are related to additional spaces used
6
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
7
or wrong indentation. No functional change intended.
7
Message-Id: <20220421095151.2231099-1-liuyd.fnst@fujitsu.com>
8
8
9
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
9
[Small documentation fixes: s/as client supports/as the client supports/
10
Message-Id: <20211008062821.1010967-2-eesposit@redhat.com>
10
and s/. /. /.
11
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
11
--Stefan]
12
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12
---
14
---
13
tests/qemu-iotests/129 | 18 +++++++++---------
15
docs/tools/virtiofsd.rst | 5 +++++
14
tests/qemu-iotests/310 | 16 ++++++++--------
16
tools/virtiofsd/helper.c | 3 +++
15
tests/qemu-iotests/check | 11 ++++++-----
17
2 files changed, 8 insertions(+)
16
tests/qemu-iotests/iotests.py | 7 ++++---
17
tests/qemu-iotests/tests/image-fleecing | 4 ++--
18
5 files changed, 29 insertions(+), 27 deletions(-)
19
18
20
diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129
19
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
21
index XXXXXXX..XXXXXXX 100755
22
--- a/tests/qemu-iotests/129
23
+++ b/tests/qemu-iotests/129
24
@@ -XXX,XX +XXX,XX @@ class TestStopWithBlockJob(iotests.QMPTestCase):
25
self.do_test_stop("drive-backup", device="drive0",
26
target=self.target_img, format=iotests.imgfmt,
27
sync="full",
28
- x_perf={ 'max-chunk': 65536,
29
- 'max-workers': 8 })
30
+ x_perf={'max-chunk': 65536,
31
+ 'max-workers': 8})
32
33
def test_block_commit(self):
34
# Add overlay above the source node so that we actually use a
35
@@ -XXX,XX +XXX,XX @@ class TestStopWithBlockJob(iotests.QMPTestCase):
36
'1G')
37
38
result = self.vm.qmp('blockdev-add', **{
39
- 'node-name': 'overlay',
40
- 'driver': iotests.imgfmt,
41
- 'file': {
42
- 'driver': 'file',
43
- 'filename': self.overlay_img
44
- }
45
- })
46
+ 'node-name': 'overlay',
47
+ 'driver': iotests.imgfmt,
48
+ 'file': {
49
+ 'driver': 'file',
50
+ 'filename': self.overlay_img
51
+ }
52
+ })
53
self.assert_qmp(result, 'return', {})
54
55
result = self.vm.qmp('blockdev-snapshot',
56
diff --git a/tests/qemu-iotests/310 b/tests/qemu-iotests/310
57
index XXXXXXX..XXXXXXX 100755
58
--- a/tests/qemu-iotests/310
59
+++ b/tests/qemu-iotests/310
60
@@ -XXX,XX +XXX,XX @@ with iotests.FilePath('base.img') as base_img_path, \
61
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 3M 1M') == 0
62
assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
63
'-F', iotests.imgfmt, mid_img_path) == 0
64
- assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 2M 1M') == 0
65
- assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 4M 1M') == 0
66
+ assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 2M 1M') == 0
67
+ assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 4M 1M') == 0
68
assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
69
'-F', iotests.imgfmt, top_img_path) == 0
70
- assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') == 0
71
+ assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') == 0
72
73
# 0 1 2 3 4
74
# top 2
75
@@ -XXX,XX +XXX,XX @@ with iotests.FilePath('base.img') as base_img_path, \
76
assert qemu_img('rebase', '-u', '-b', '', '-f', iotests.imgfmt,
77
top_img_path) == 0
78
79
- assert qemu_io_silent(top_img_path, '-c', 'read -P 0 0 1M') == 0
80
- assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') == 0
81
- assert qemu_io_silent(top_img_path, '-c', 'read -P 3 2M 1M') == 0
82
- assert qemu_io_silent(top_img_path, '-c', 'read -P 0 3M 1M') == 0
83
- assert qemu_io_silent(top_img_path, '-c', 'read -P 3 4M 1M') == 0
84
+ assert qemu_io_silent(top_img_path, '-c', 'read -P 0 0 1M') == 0
85
+ assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') == 0
86
+ assert qemu_io_silent(top_img_path, '-c', 'read -P 3 2M 1M') == 0
87
+ assert qemu_io_silent(top_img_path, '-c', 'read -P 0 3M 1M') == 0
88
+ assert qemu_io_silent(top_img_path, '-c', 'read -P 3 4M 1M') == 0
89
90
log('Done')
91
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
92
index XXXXXXX..XXXXXXX 100755
93
--- a/tests/qemu-iotests/check
94
+++ b/tests/qemu-iotests/check
95
@@ -XXX,XX +XXX,XX @@ def make_argparser() -> argparse.ArgumentParser:
96
97
p.add_argument('-d', dest='debug', action='store_true', help='debug')
98
p.add_argument('-p', dest='print', action='store_true',
99
- help='redirects qemu\'s stdout and stderr to the test output')
100
+ help='redirects qemu\'s stdout and stderr to '
101
+ 'the test output')
102
p.add_argument('-gdb', action='store_true',
103
- help="start gdbserver with $GDB_OPTIONS options \
104
- ('localhost:12345' if $GDB_OPTIONS is empty)")
105
+ help="start gdbserver with $GDB_OPTIONS options "
106
+ "('localhost:12345' if $GDB_OPTIONS is empty)")
107
p.add_argument('-valgrind', action='store_true',
108
- help='use valgrind, sets VALGRIND_QEMU environment '
109
- 'variable')
110
+ help='use valgrind, sets VALGRIND_QEMU environment '
111
+ 'variable')
112
113
p.add_argument('-misalign', action='store_true',
114
help='misalign memory allocations')
115
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
116
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
117
--- a/tests/qemu-iotests/iotests.py
21
--- a/docs/tools/virtiofsd.rst
118
+++ b/tests/qemu-iotests/iotests.py
22
+++ b/docs/tools/virtiofsd.rst
119
@@ -XXX,XX +XXX,XX @@ def _post_shutdown(self) -> None:
23
@@ -XXX,XX +XXX,XX @@ Options
120
super()._post_shutdown()
24
label. Server will try to set that label on newly created file
121
if not qemu_valgrind or not self._popen:
25
atomically wherever possible.
122
return
26
123
- valgrind_filename = f"{test_dir}/{self._popen.pid}.valgrind"
27
+ * killpriv_v2|no_killpriv_v2 -
124
+ valgrind_filename = f"{test_dir}/{self._popen.pid}.valgrind"
28
+ Enable/disable ``FUSE_HANDLE_KILLPRIV_V2`` support. KILLPRIV_V2 is enabled
125
if self.exitcode() == 99:
29
+ by default as long as the client supports it. Enabling this option helps
126
with open(valgrind_filename, encoding='utf-8') as f:
30
+ with performance in write path.
127
print(f.read())
31
+
128
@@ -XXX,XX +XXX,XX @@ def write(self, arg=None):
32
.. option:: --socket-path=PATH
129
33
130
class ReproducibleTestRunner(unittest.TextTestRunner):
34
Listen on vhost-user UNIX domain socket at PATH.
131
def __init__(self, stream: Optional[TextIO] = None,
35
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
132
- resultclass: Type[unittest.TestResult] = ReproducibleTestResult,
36
index XXXXXXX..XXXXXXX 100644
133
- **kwargs: Any) -> None:
37
--- a/tools/virtiofsd/helper.c
134
+ resultclass: Type[unittest.TestResult] =
38
+++ b/tools/virtiofsd/helper.c
135
+ ReproducibleTestResult,
39
@@ -XXX,XX +XXX,XX @@ void fuse_cmdline_help(void)
136
+ **kwargs: Any) -> None:
40
" -o announce_submounts Announce sub-mount points to the guest\n"
137
rstream = ReproducibleStreamWrapper(stream or sys.stdout)
41
" -o posix_acl/no_posix_acl Enable/Disable posix_acl. (default: disabled)\n"
138
super().__init__(stream=rstream, # type: ignore
42
" -o security_label/no_security_label Enable/Disable security label. (default: disabled)\n"
139
descriptions=True,
43
+ " -o killpriv_v2/no_killpriv_v2\n"
140
diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/tests/image-fleecing
44
+ " Enable/Disable FUSE_HANDLE_KILLPRIV_V2.\n"
141
index XXXXXXX..XXXXXXX 100755
45
+ " (default: enabled as long as client supports it)\n"
142
--- a/tests/qemu-iotests/tests/image-fleecing
46
);
143
+++ b/tests/qemu-iotests/tests/image-fleecing
47
}
144
@@ -XXX,XX +XXX,XX @@ def do_test(use_cbw, base_img_path, fleece_img_path, nbd_sock_path, vm):
145
146
nbd_uri = 'nbd+unix:///%s?socket=%s' % (tmp_node, nbd_sock_path)
147
log(vm.qmp('nbd-server-start',
148
- {'addr': { 'type': 'unix',
149
- 'data': { 'path': nbd_sock_path } } }))
150
+ {'addr': {'type': 'unix',
151
+ 'data': {'path': nbd_sock_path}}}))
152
153
log(vm.qmp('nbd-server-add', device=tmp_node))
154
48
155
--
49
--
156
2.31.1
50
2.35.1
157
158
diff view generated by jsdifflib