1
The following changes since commit a1cf5fac2b929ffa2abd1285401f2535ff8c6fea:
1
The following changes since commit 15ef89d2a1a7b93845a6b09c2ee8e1979f6eb30b:
2
2
3
Merge remote-tracking branch 'remotes/armbru/tags/pull-block-2017-02-21' into staging (2017-02-21 13:58:50 +0000)
3
Update version for v7.0.0-rc1 release (2022-03-22 22:58:44 +0000)
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 6135c5e12606b8413708384e3e7d43f6010c5941:
9
for you to fetch changes up to 2539eade4f689eda7e9fe45486f18334bfbafaf0:
10
10
11
qemu-options: Fix broken sheepdog URL (2017-02-21 10:38:09 -0500)
11
hw: Fix misleading hexadecimal format (2022-03-24 10:38:42 +0000)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block patches
14
Pull request
15
16
Philippe found cases where the 0x%d format string was used, leading to
17
misleading output. The patches look harmless and could save people time, so I
18
think it's worth including them in 7.0.
19
15
----------------------------------------------------------------
20
----------------------------------------------------------------
16
21
17
Anton Nefedov (1):
22
Philippe Mathieu-Daudé (2):
18
mirror: do not increase offset during initial zero_or_discard phase
23
block: Fix misleading hexadecimal format
24
hw: Fix misleading hexadecimal format
19
25
20
Jeff Cody (1):
26
block/parallels-ext.c | 2 +-
21
QAPI: Fix blockdev-add example documentation
27
hw/i386/sgx.c | 2 +-
22
28
hw/i386/trace-events | 6 +++---
23
Kevin Wolf (6):
29
hw/misc/trace-events | 4 ++--
24
iscsi: Split URL into individual options
30
hw/scsi/trace-events | 4 ++--
25
iscsi: Handle -iscsi user/password in bdrv_parse_filename()
31
5 files changed, 9 insertions(+), 9 deletions(-)
26
iscsi: Add initiator-name option
27
iscsi: Add header-digest option
28
iscsi: Add timeout option
29
iscsi: Add blockdev-add support
30
31
Thomas Huth (1):
32
qemu-options: Fix broken sheepdog URL
33
34
block/iscsi.c | 353 +++++++++++++++++++++++++++++++--------------------
35
block/mirror.c | 9 +-
36
qapi/block-core.json | 125 +++++++++++++-----
37
qemu-options.hx | 2 +-
38
4 files changed, 317 insertions(+), 172 deletions(-)
39
32
40
--
33
--
41
2.9.3
34
2.35.1
42
35
43
diff view generated by jsdifflib
Deleted patch
1
From: Kevin Wolf <kwolf@redhat.com>
2
1
3
This introduces a .bdrv_parse_filename handler for iscsi which parses an
4
URL if given and translates it to individual options.
5
6
Reviewed-by: Fam Zheng <famz@redhat.com>
7
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8
Signed-off-by: Jeff Cody <jcody@redhat.com>
9
---
10
block/iscsi.c | 193 ++++++++++++++++++++++++++++++++++++++++++----------------
11
1 file changed, 140 insertions(+), 53 deletions(-)
12
13
diff --git a/block/iscsi.c b/block/iscsi.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/block/iscsi.c
16
+++ b/block/iscsi.c
17
@@ -XXX,XX +XXX,XX @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun, Error **errp)
18
}
19
}
20
21
-/* TODO Convert to fine grained options */
22
-static QemuOptsList runtime_opts = {
23
- .name = "iscsi",
24
- .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
25
- .desc = {
26
- {
27
- .name = "filename",
28
- .type = QEMU_OPT_STRING,
29
- .help = "URL to the iscsi image",
30
- },
31
- { /* end of list */ }
32
- },
33
-};
34
-
35
static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
36
int evpd, int pc, void **inq, Error **errp)
37
{
38
@@ -XXX,XX +XXX,XX @@ out:
39
* We support iscsi url's on the form
40
* iscsi://[<username>%<password>@]<host>[:<port>]/<targetname>/<lun>
41
*/
42
+static void iscsi_parse_filename(const char *filename, QDict *options,
43
+ Error **errp)
44
+{
45
+ struct iscsi_url *iscsi_url;
46
+ const char *transport_name;
47
+ char *lun_str;
48
+
49
+ iscsi_url = iscsi_parse_full_url(NULL, filename);
50
+ if (iscsi_url == NULL) {
51
+ error_setg(errp, "Failed to parse URL : %s", filename);
52
+ return;
53
+ }
54
+
55
+#if LIBISCSI_API_VERSION >= (20160603)
56
+ switch (iscsi_url->transport) {
57
+ case TCP_TRANSPORT:
58
+ transport_name = "tcp";
59
+ break;
60
+ case ISER_TRANSPORT:
61
+ transport_name = "iser";
62
+ break;
63
+ default:
64
+ error_setg(errp, "Unknown transport type (%d)",
65
+ iscsi_url->transport);
66
+ return;
67
+ }
68
+#else
69
+ transport_name = "tcp";
70
+#endif
71
+
72
+ qdict_set_default_str(options, "transport", transport_name);
73
+ qdict_set_default_str(options, "portal", iscsi_url->portal);
74
+ qdict_set_default_str(options, "target", iscsi_url->target);
75
+
76
+ lun_str = g_strdup_printf("%d", iscsi_url->lun);
77
+ qdict_set_default_str(options, "lun", lun_str);
78
+ g_free(lun_str);
79
+
80
+ if (iscsi_url->user[0] != '\0') {
81
+ qdict_set_default_str(options, "user", iscsi_url->user);
82
+ qdict_set_default_str(options, "password", iscsi_url->passwd);
83
+ }
84
+
85
+ iscsi_destroy_url(iscsi_url);
86
+}
87
+
88
+/* TODO Add -iscsi options */
89
+static QemuOptsList runtime_opts = {
90
+ .name = "iscsi",
91
+ .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
92
+ .desc = {
93
+ {
94
+ .name = "transport",
95
+ .type = QEMU_OPT_STRING,
96
+ },
97
+ {
98
+ .name = "portal",
99
+ .type = QEMU_OPT_STRING,
100
+ },
101
+ {
102
+ .name = "target",
103
+ .type = QEMU_OPT_STRING,
104
+ },
105
+ {
106
+ .name = "user",
107
+ .type = QEMU_OPT_STRING,
108
+ },
109
+ {
110
+ .name = "password",
111
+ .type = QEMU_OPT_STRING,
112
+ },
113
+ {
114
+ .name = "lun",
115
+ .type = QEMU_OPT_NUMBER,
116
+ },
117
+ { /* end of list */ }
118
+ },
119
+};
120
+
121
static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
122
Error **errp)
123
{
124
IscsiLun *iscsilun = bs->opaque;
125
struct iscsi_context *iscsi = NULL;
126
- struct iscsi_url *iscsi_url = NULL;
127
struct scsi_task *task = NULL;
128
struct scsi_inquiry_standard *inq = NULL;
129
struct scsi_inquiry_supported_pages *inq_vpd;
130
char *initiator_name = NULL;
131
QemuOpts *opts;
132
Error *local_err = NULL;
133
- const char *filename;
134
- int i, ret = 0, timeout = 0;
135
+ const char *transport_name, *portal, *target;
136
+ const char *user, *password;
137
+#if LIBISCSI_API_VERSION >= (20160603)
138
+ enum iscsi_transport_type transport;
139
+#endif
140
+ int i, ret = 0, timeout = 0, lun;
141
142
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
143
qemu_opts_absorb_qdict(opts, options, &local_err);
144
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
145
goto out;
146
}
147
148
- filename = qemu_opt_get(opts, "filename");
149
+ transport_name = qemu_opt_get(opts, "transport");
150
+ portal = qemu_opt_get(opts, "portal");
151
+ target = qemu_opt_get(opts, "target");
152
+ user = qemu_opt_get(opts, "user");
153
+ password = qemu_opt_get(opts, "password");
154
+ lun = qemu_opt_get_number(opts, "lun", 0);
155
156
- iscsi_url = iscsi_parse_full_url(iscsi, filename);
157
- if (iscsi_url == NULL) {
158
- error_setg(errp, "Failed to parse URL : %s", filename);
159
+ if (!transport_name || !portal || !target) {
160
+ error_setg(errp, "Need all of transport, portal and target options");
161
+ ret = -EINVAL;
162
+ goto out;
163
+ }
164
+ if (user && !password) {
165
+ error_setg(errp, "If a user name is given, a password is required");
166
+ ret = -EINVAL;
167
+ goto out;
168
+ }
169
+
170
+ if (!strcmp(transport_name, "tcp")) {
171
+#if LIBISCSI_API_VERSION >= (20160603)
172
+ transport = TCP_TRANSPORT;
173
+ } else if (!strcmp(transport_name, "iser")) {
174
+ transport = ISER_TRANSPORT;
175
+#else
176
+ /* TCP is what older libiscsi versions always use */
177
+#endif
178
+ } else {
179
+ error_setg(errp, "Unknown transport: %s", transport_name);
180
ret = -EINVAL;
181
goto out;
182
}
183
184
memset(iscsilun, 0, sizeof(IscsiLun));
185
186
- initiator_name = parse_initiator_name(iscsi_url->target);
187
+ initiator_name = parse_initiator_name(target);
188
189
iscsi = iscsi_create_context(initiator_name);
190
if (iscsi == NULL) {
191
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
192
goto out;
193
}
194
#if LIBISCSI_API_VERSION >= (20160603)
195
- if (iscsi_init_transport(iscsi, iscsi_url->transport)) {
196
+ if (iscsi_init_transport(iscsi, transport)) {
197
error_setg(errp, ("Error initializing transport."));
198
ret = -EINVAL;
199
goto out;
200
}
201
#endif
202
- if (iscsi_set_targetname(iscsi, iscsi_url->target)) {
203
+ if (iscsi_set_targetname(iscsi, target)) {
204
error_setg(errp, "iSCSI: Failed to set target name.");
205
ret = -EINVAL;
206
goto out;
207
}
208
209
- if (iscsi_url->user[0] != '\0') {
210
- ret = iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user,
211
- iscsi_url->passwd);
212
+ if (user) {
213
+ ret = iscsi_set_initiator_username_pwd(iscsi, user, password);
214
if (ret != 0) {
215
error_setg(errp, "Failed to set initiator username and password");
216
ret = -EINVAL;
217
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
218
}
219
220
/* check if we got CHAP username/password via the options */
221
- parse_chap(iscsi, iscsi_url->target, &local_err);
222
+ parse_chap(iscsi, target, &local_err);
223
if (local_err != NULL) {
224
error_propagate(errp, local_err);
225
ret = -EINVAL;
226
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
227
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
228
229
/* check if we got HEADER_DIGEST via the options */
230
- parse_header_digest(iscsi, iscsi_url->target, &local_err);
231
+ parse_header_digest(iscsi, target, &local_err);
232
if (local_err != NULL) {
233
error_propagate(errp, local_err);
234
ret = -EINVAL;
235
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
236
}
237
238
/* timeout handling is broken in libiscsi before 1.15.0 */
239
- timeout = parse_timeout(iscsi_url->target);
240
+ timeout = parse_timeout(target);
241
#if LIBISCSI_API_VERSION >= 20150621
242
iscsi_set_timeout(iscsi, timeout);
243
#else
244
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
245
}
246
#endif
247
248
- if (iscsi_full_connect_sync(iscsi, iscsi_url->portal, iscsi_url->lun) != 0) {
249
+ if (iscsi_full_connect_sync(iscsi, portal, lun) != 0) {
250
error_setg(errp, "iSCSI: Failed to connect to LUN : %s",
251
iscsi_get_error(iscsi));
252
ret = -EINVAL;
253
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
254
255
iscsilun->iscsi = iscsi;
256
iscsilun->aio_context = bdrv_get_aio_context(bs);
257
- iscsilun->lun = iscsi_url->lun;
258
+ iscsilun->lun = lun;
259
iscsilun->has_write_same = true;
260
261
task = iscsi_do_inquiry(iscsilun->iscsi, iscsilun->lun, 0, 0,
262
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
263
out:
264
qemu_opts_del(opts);
265
g_free(initiator_name);
266
- if (iscsi_url != NULL) {
267
- iscsi_destroy_url(iscsi_url);
268
- }
269
if (task != NULL) {
270
scsi_free_scsi_task(task);
271
}
272
@@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_iscsi = {
273
.format_name = "iscsi",
274
.protocol_name = "iscsi",
275
276
- .instance_size = sizeof(IscsiLun),
277
- .bdrv_needs_filename = true,
278
- .bdrv_file_open = iscsi_open,
279
- .bdrv_close = iscsi_close,
280
- .bdrv_create = iscsi_create,
281
- .create_opts = &iscsi_create_opts,
282
- .bdrv_reopen_prepare = iscsi_reopen_prepare,
283
- .bdrv_reopen_commit = iscsi_reopen_commit,
284
- .bdrv_invalidate_cache = iscsi_invalidate_cache,
285
+ .instance_size = sizeof(IscsiLun),
286
+ .bdrv_parse_filename = iscsi_parse_filename,
287
+ .bdrv_file_open = iscsi_open,
288
+ .bdrv_close = iscsi_close,
289
+ .bdrv_create = iscsi_create,
290
+ .create_opts = &iscsi_create_opts,
291
+ .bdrv_reopen_prepare = iscsi_reopen_prepare,
292
+ .bdrv_reopen_commit = iscsi_reopen_commit,
293
+ .bdrv_invalidate_cache = iscsi_invalidate_cache,
294
295
.bdrv_getlength = iscsi_getlength,
296
.bdrv_get_info = iscsi_get_info,
297
@@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_iser = {
298
.format_name = "iser",
299
.protocol_name = "iser",
300
301
- .instance_size = sizeof(IscsiLun),
302
- .bdrv_needs_filename = true,
303
- .bdrv_file_open = iscsi_open,
304
- .bdrv_close = iscsi_close,
305
- .bdrv_create = iscsi_create,
306
- .create_opts = &iscsi_create_opts,
307
- .bdrv_reopen_prepare = iscsi_reopen_prepare,
308
- .bdrv_reopen_commit = iscsi_reopen_commit,
309
- .bdrv_invalidate_cache = iscsi_invalidate_cache,
310
+ .instance_size = sizeof(IscsiLun),
311
+ .bdrv_parse_filename = iscsi_parse_filename,
312
+ .bdrv_file_open = iscsi_open,
313
+ .bdrv_close = iscsi_close,
314
+ .bdrv_create = iscsi_create,
315
+ .create_opts = &iscsi_create_opts,
316
+ .bdrv_reopen_prepare = iscsi_reopen_prepare,
317
+ .bdrv_reopen_commit = iscsi_reopen_commit,
318
+ .bdrv_invalidate_cache = iscsi_invalidate_cache,
319
320
.bdrv_getlength = iscsi_getlength,
321
.bdrv_get_info = iscsi_get_info,
322
--
323
2.9.3
324
325
diff view generated by jsdifflib
Deleted patch
1
From: Kevin Wolf <kwolf@redhat.com>
2
1
3
This splits the logic in the old parse_chap() function into a part that
4
parses the -iscsi options into the new driver-specific options, and
5
another part that actually applies those options (called apply_chap()
6
now).
7
8
Note that this means that username and password specified with -iscsi
9
only take effect when a URL is provided. This is intentional, -iscsi is
10
a legacy interface only supported for compatibility, new users should
11
use the proper driver-specific options.
12
13
Reviewed-by: Fam Zheng <famz@redhat.com>
14
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
15
Signed-off-by: Jeff Cody <jcody@redhat.com>
16
---
17
block/iscsi.c | 78 +++++++++++++++++++++++++++++++++--------------------------
18
1 file changed, 44 insertions(+), 34 deletions(-)
19
20
diff --git a/block/iscsi.c b/block/iscsi.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/block/iscsi.c
23
+++ b/block/iscsi.c
24
@@ -XXX,XX +XXX,XX @@ retry:
25
return 0;
26
}
27
28
-static void parse_chap(struct iscsi_context *iscsi, const char *target,
29
+static void apply_chap(struct iscsi_context *iscsi, QemuOpts *opts,
30
Error **errp)
31
{
32
- QemuOptsList *list;
33
- QemuOpts *opts;
34
const char *user = NULL;
35
const char *password = NULL;
36
const char *secretid;
37
char *secret = NULL;
38
39
- list = qemu_find_opts("iscsi");
40
- if (!list) {
41
- return;
42
- }
43
-
44
- opts = qemu_opts_find(list, target);
45
- if (opts == NULL) {
46
- opts = QTAILQ_FIRST(&list->head);
47
- if (!opts) {
48
- return;
49
- }
50
- }
51
-
52
user = qemu_opt_get(opts, "user");
53
if (!user) {
54
return;
55
@@ -XXX,XX +XXX,XX @@ out:
56
}
57
}
58
59
+static void iscsi_parse_iscsi_option(const char *target, QDict *options)
60
+{
61
+ QemuOptsList *list;
62
+ QemuOpts *opts;
63
+ const char *user, *password, *password_secret;
64
+
65
+ list = qemu_find_opts("iscsi");
66
+ if (!list) {
67
+ return;
68
+ }
69
+
70
+ opts = qemu_opts_find(list, target);
71
+ if (opts == NULL) {
72
+ opts = QTAILQ_FIRST(&list->head);
73
+ if (!opts) {
74
+ return;
75
+ }
76
+ }
77
+
78
+ user = qemu_opt_get(opts, "user");
79
+ if (user) {
80
+ qdict_set_default_str(options, "user", user);
81
+ }
82
+
83
+ password = qemu_opt_get(opts, "password");
84
+ if (password) {
85
+ qdict_set_default_str(options, "password", password);
86
+ }
87
+
88
+ password_secret = qemu_opt_get(opts, "password-secret");
89
+ if (password_secret) {
90
+ qdict_set_default_str(options, "password-secret", password_secret);
91
+ }
92
+}
93
+
94
/*
95
* We support iscsi url's on the form
96
* iscsi://[<username>%<password>@]<host>[:<port>]/<targetname>/<lun>
97
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_filename(const char *filename, QDict *options,
98
qdict_set_default_str(options, "lun", lun_str);
99
g_free(lun_str);
100
101
+ /* User/password from -iscsi take precedence over those from the URL */
102
+ iscsi_parse_iscsi_option(iscsi_url->target, options);
103
+
104
if (iscsi_url->user[0] != '\0') {
105
qdict_set_default_str(options, "user", iscsi_url->user);
106
qdict_set_default_str(options, "password", iscsi_url->passwd);
107
@@ -XXX,XX +XXX,XX @@ static QemuOptsList runtime_opts = {
108
.type = QEMU_OPT_STRING,
109
},
110
{
111
+ .name = "password-secret",
112
+ .type = QEMU_OPT_STRING,
113
+ },
114
+ {
115
.name = "lun",
116
.type = QEMU_OPT_NUMBER,
117
},
118
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
119
QemuOpts *opts;
120
Error *local_err = NULL;
121
const char *transport_name, *portal, *target;
122
- const char *user, *password;
123
#if LIBISCSI_API_VERSION >= (20160603)
124
enum iscsi_transport_type transport;
125
#endif
126
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
127
transport_name = qemu_opt_get(opts, "transport");
128
portal = qemu_opt_get(opts, "portal");
129
target = qemu_opt_get(opts, "target");
130
- user = qemu_opt_get(opts, "user");
131
- password = qemu_opt_get(opts, "password");
132
lun = qemu_opt_get_number(opts, "lun", 0);
133
134
if (!transport_name || !portal || !target) {
135
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
136
ret = -EINVAL;
137
goto out;
138
}
139
- if (user && !password) {
140
- error_setg(errp, "If a user name is given, a password is required");
141
- ret = -EINVAL;
142
- goto out;
143
- }
144
145
if (!strcmp(transport_name, "tcp")) {
146
#if LIBISCSI_API_VERSION >= (20160603)
147
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
148
goto out;
149
}
150
151
- if (user) {
152
- ret = iscsi_set_initiator_username_pwd(iscsi, user, password);
153
- if (ret != 0) {
154
- error_setg(errp, "Failed to set initiator username and password");
155
- ret = -EINVAL;
156
- goto out;
157
- }
158
- }
159
-
160
/* check if we got CHAP username/password via the options */
161
- parse_chap(iscsi, target, &local_err);
162
+ apply_chap(iscsi, opts, &local_err);
163
if (local_err != NULL) {
164
error_propagate(errp, local_err);
165
ret = -EINVAL;
166
--
167
2.9.3
168
169
diff view generated by jsdifflib
Deleted patch
1
From: Kevin Wolf <kwolf@redhat.com>
2
1
3
This was previously only available with -iscsi. Again, after this patch,
4
the -iscsi option only takes effect if an URL is given. New users are
5
supposed to use the new driver-specific option.
6
7
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
8
Reviewed-by: Fam Zheng <famz@redhat.com>
9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10
Signed-off-by: Jeff Cody <jcody@redhat.com>
11
---
12
block/iscsi.c | 32 +++++++++++++++-----------------
13
1 file changed, 15 insertions(+), 17 deletions(-)
14
15
diff --git a/block/iscsi.c b/block/iscsi.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/block/iscsi.c
18
+++ b/block/iscsi.c
19
@@ -XXX,XX +XXX,XX @@ static void parse_header_digest(struct iscsi_context *iscsi, const char *target,
20
}
21
}
22
23
-static char *parse_initiator_name(const char *target)
24
+static char *get_initiator_name(QemuOpts *opts)
25
{
26
- QemuOptsList *list;
27
- QemuOpts *opts;
28
const char *name;
29
char *iscsi_name;
30
UuidInfo *uuid_info;
31
32
- list = qemu_find_opts("iscsi");
33
- if (list) {
34
- opts = qemu_opts_find(list, target);
35
- if (!opts) {
36
- opts = QTAILQ_FIRST(&list->head);
37
- }
38
- if (opts) {
39
- name = qemu_opt_get(opts, "initiator-name");
40
- if (name) {
41
- return g_strdup(name);
42
- }
43
- }
44
+ name = qemu_opt_get(opts, "initiator-name");
45
+ if (name) {
46
+ return g_strdup(name);
47
}
48
49
uuid_info = qmp_query_uuid(NULL);
50
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
51
{
52
QemuOptsList *list;
53
QemuOpts *opts;
54
- const char *user, *password, *password_secret;
55
+ const char *user, *password, *password_secret, *initiator_name;
56
57
list = qemu_find_opts("iscsi");
58
if (!list) {
59
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
60
if (password_secret) {
61
qdict_set_default_str(options, "password-secret", password_secret);
62
}
63
+
64
+ initiator_name = qemu_opt_get(opts, "initiator-name");
65
+ if (initiator_name) {
66
+ qdict_set_default_str(options, "initiator-name", initiator_name);
67
+ }
68
}
69
70
/*
71
@@ -XXX,XX +XXX,XX @@ static QemuOptsList runtime_opts = {
72
.name = "lun",
73
.type = QEMU_OPT_NUMBER,
74
},
75
+ {
76
+ .name = "initiator-name",
77
+ .type = QEMU_OPT_STRING,
78
+ },
79
{ /* end of list */ }
80
},
81
};
82
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
83
84
memset(iscsilun, 0, sizeof(IscsiLun));
85
86
- initiator_name = parse_initiator_name(target);
87
+ initiator_name = get_initiator_name(opts);
88
89
iscsi = iscsi_create_context(initiator_name);
90
if (iscsi == NULL) {
91
--
92
2.9.3
93
94
diff view generated by jsdifflib
Deleted patch
1
From: Kevin Wolf <kwolf@redhat.com>
2
1
3
This was previously only available with -iscsi. Again, after this patch,
4
the -iscsi option only takes effect if an URL is given. New users are
5
supposed to use the new driver-specific option.
6
7
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
8
Reviewed-by: Fam Zheng <famz@redhat.com>
9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10
Signed-off-by: Jeff Cody <jcody@redhat.com>
11
---
12
block/iscsi.c | 39 +++++++++++++++------------------------
13
1 file changed, 15 insertions(+), 24 deletions(-)
14
15
diff --git a/block/iscsi.c b/block/iscsi.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/block/iscsi.c
18
+++ b/block/iscsi.c
19
@@ -XXX,XX +XXX,XX @@ static void apply_chap(struct iscsi_context *iscsi, QemuOpts *opts,
20
g_free(secret);
21
}
22
23
-static void parse_header_digest(struct iscsi_context *iscsi, const char *target,
24
+static void apply_header_digest(struct iscsi_context *iscsi, QemuOpts *opts,
25
Error **errp)
26
{
27
- QemuOptsList *list;
28
- QemuOpts *opts;
29
const char *digest = NULL;
30
31
- list = qemu_find_opts("iscsi");
32
- if (!list) {
33
- return;
34
- }
35
-
36
- opts = qemu_opts_find(list, target);
37
- if (opts == NULL) {
38
- opts = QTAILQ_FIRST(&list->head);
39
- if (!opts) {
40
- return;
41
- }
42
- }
43
-
44
digest = qemu_opt_get(opts, "header-digest");
45
if (!digest) {
46
- return;
47
- }
48
-
49
- if (!strcmp(digest, "CRC32C")) {
50
+ iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
51
+ } else if (!strcmp(digest, "CRC32C")) {
52
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C);
53
} else if (!strcmp(digest, "NONE")) {
54
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE);
55
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
56
{
57
QemuOptsList *list;
58
QemuOpts *opts;
59
- const char *user, *password, *password_secret, *initiator_name;
60
+ const char *user, *password, *password_secret, *initiator_name,
61
+ *header_digest;
62
63
list = qemu_find_opts("iscsi");
64
if (!list) {
65
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
66
if (initiator_name) {
67
qdict_set_default_str(options, "initiator-name", initiator_name);
68
}
69
+
70
+ header_digest = qemu_opt_get(opts, "header-digest");
71
+ if (header_digest) {
72
+ qdict_set_default_str(options, "header-digest", header_digest);
73
+ }
74
}
75
76
/*
77
@@ -XXX,XX +XXX,XX @@ static QemuOptsList runtime_opts = {
78
.name = "initiator-name",
79
.type = QEMU_OPT_STRING,
80
},
81
+ {
82
+ .name = "header-digest",
83
+ .type = QEMU_OPT_STRING,
84
+ },
85
{ /* end of list */ }
86
},
87
};
88
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
89
goto out;
90
}
91
92
- iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
93
-
94
/* check if we got HEADER_DIGEST via the options */
95
- parse_header_digest(iscsi, target, &local_err);
96
+ apply_header_digest(iscsi, opts, &local_err);
97
if (local_err != NULL) {
98
error_propagate(errp, local_err);
99
ret = -EINVAL;
100
--
101
2.9.3
102
103
diff view generated by jsdifflib
Deleted patch
1
From: Kevin Wolf <kwolf@redhat.com>
2
1
3
This was previously only available with -iscsi. Again, after this patch,
4
the -iscsi option only takes effect if an URL is given. New users are
5
supposed to use the new driver-specific option.
6
7
All -iscsi options have a corresponding driver-specific option for the
8
iscsi block driver now.
9
10
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
11
Reviewed-by: Fam Zheng <famz@redhat.com>
12
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13
Signed-off-by: Jeff Cody <jcody@redhat.com>
14
---
15
block/iscsi.c | 37 +++++++++++--------------------------
16
1 file changed, 11 insertions(+), 26 deletions(-)
17
18
diff --git a/block/iscsi.c b/block/iscsi.c
19
index XXXXXXX..XXXXXXX 100644
20
--- a/block/iscsi.c
21
+++ b/block/iscsi.c
22
@@ -XXX,XX +XXX,XX @@ static char *get_initiator_name(QemuOpts *opts)
23
return iscsi_name;
24
}
25
26
-static int parse_timeout(const char *target)
27
-{
28
- QemuOptsList *list;
29
- QemuOpts *opts;
30
- const char *timeout;
31
-
32
- list = qemu_find_opts("iscsi");
33
- if (list) {
34
- opts = qemu_opts_find(list, target);
35
- if (!opts) {
36
- opts = QTAILQ_FIRST(&list->head);
37
- }
38
- if (opts) {
39
- timeout = qemu_opt_get(opts, "timeout");
40
- if (timeout) {
41
- return atoi(timeout);
42
- }
43
- }
44
- }
45
-
46
- return 0;
47
-}
48
-
49
static void iscsi_nop_timed_event(void *opaque)
50
{
51
IscsiLun *iscsilun = opaque;
52
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
53
QemuOptsList *list;
54
QemuOpts *opts;
55
const char *user, *password, *password_secret, *initiator_name,
56
- *header_digest;
57
+ *header_digest, *timeout;
58
59
list = qemu_find_opts("iscsi");
60
if (!list) {
61
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
62
if (header_digest) {
63
qdict_set_default_str(options, "header-digest", header_digest);
64
}
65
+
66
+ timeout = qemu_opt_get(opts, "timeout");
67
+ if (timeout) {
68
+ qdict_set_default_str(options, "timeout", timeout);
69
+ }
70
}
71
72
/*
73
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_filename(const char *filename, QDict *options,
74
iscsi_destroy_url(iscsi_url);
75
}
76
77
-/* TODO Add -iscsi options */
78
static QemuOptsList runtime_opts = {
79
.name = "iscsi",
80
.head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
81
@@ -XXX,XX +XXX,XX @@ static QemuOptsList runtime_opts = {
82
.name = "header-digest",
83
.type = QEMU_OPT_STRING,
84
},
85
+ {
86
+ .name = "timeout",
87
+ .type = QEMU_OPT_NUMBER,
88
+ },
89
{ /* end of list */ }
90
},
91
};
92
@@ -XXX,XX +XXX,XX @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
93
}
94
95
/* timeout handling is broken in libiscsi before 1.15.0 */
96
- timeout = parse_timeout(target);
97
+ timeout = qemu_opt_get_number(opts, "timeout", 0);
98
#if LIBISCSI_API_VERSION >= 20150621
99
iscsi_set_timeout(iscsi, timeout);
100
#else
101
--
102
2.9.3
103
104
diff view generated by jsdifflib
1
From: Thomas Huth <thuth@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
The sheepdog URL is broken twice: First it uses a duplicated
3
"0x%u" format is very misleading, replace by "0x%x".
4
http:// prefix, second the website seems to have moved to
5
https://sheepdog.github.io/sheepdog/ instead.
6
4
7
Signed-off-by: Thomas Huth <thuth@redhat.com>
5
Found running:
8
Signed-off-by: Jeff Cody <jcody@redhat.com>
6
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' block/
8
9
Inspired-by: Richard Henderson <richard.henderson@linaro.org>
10
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
11
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
12
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
13
Reviewed-by: Denis V. Lunev <den@openvz.org>
14
Message-id: 20220323114718.58714-2-philippe.mathieu.daude@gmail.com
15
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
16
---
10
qemu-options.hx | 2 +-
17
block/parallels-ext.c | 2 +-
11
1 file changed, 1 insertion(+), 1 deletion(-)
18
1 file changed, 1 insertion(+), 1 deletion(-)
12
19
13
diff --git a/qemu-options.hx b/qemu-options.hx
20
diff --git a/block/parallels-ext.c b/block/parallels-ext.c
14
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
15
--- a/qemu-options.hx
22
--- a/block/parallels-ext.c
16
+++ b/qemu-options.hx
23
+++ b/block/parallels-ext.c
17
@@ -XXX,XX +XXX,XX @@ Example
24
@@ -XXX,XX +XXX,XX @@ static int parallels_parse_format_extension(BlockDriverState *bs,
18
qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
25
break;
19
@end example
26
20
27
default:
21
-See also @url{http://http://www.osrg.net/sheepdog/}.
28
- error_setg(errp, "Unknown feature: 0x%" PRIu64, fh.magic);
22
+See also @url{https://sheepdog.github.io/sheepdog/}.
29
+ error_setg(errp, "Unknown feature: 0x%" PRIx64, fh.magic);
23
30
goto fail;
24
@item GlusterFS
31
}
25
GlusterFS is a user space distributed file system.
32
26
--
33
--
27
2.9.3
34
2.35.1
28
35
29
36
diff view generated by jsdifflib
1
From: Kevin Wolf <kwolf@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
This adds blockdev-add support for iscsi devices.
3
"0x%u" format is very misleading, replace by "0x%x".
4
4
5
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
5
Found running:
6
Reviewed-by: Fam Zheng <famz@redhat.com>
6
7
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' hw/
8
Signed-off-by: Jeff Cody <jcody@redhat.com>
8
9
Inspired-by: Richard Henderson <richard.henderson@linaro.org>
10
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
11
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
12
Message-id: 20220323114718.58714-3-philippe.mathieu.daude@gmail.com
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
14
---
10
block/iscsi.c | 14 ++++++----
15
hw/i386/sgx.c | 2 +-
11
qapi/block-core.json | 75 ++++++++++++++++++++++++++++++++++++++++++++++++----
16
hw/i386/trace-events | 6 +++---
12
2 files changed, 79 insertions(+), 10 deletions(-)
17
hw/misc/trace-events | 4 ++--
18
hw/scsi/trace-events | 4 ++--
19
4 files changed, 8 insertions(+), 8 deletions(-)
13
20
14
diff --git a/block/iscsi.c b/block/iscsi.c
21
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
15
index XXXXXXX..XXXXXXX 100644
22
index XXXXXXX..XXXXXXX 100644
16
--- a/block/iscsi.c
23
--- a/hw/i386/sgx.c
17
+++ b/block/iscsi.c
24
+++ b/hw/i386/sgx.c
18
@@ -XXX,XX +XXX,XX @@ static void apply_header_digest(struct iscsi_context *iscsi, QemuOpts *opts,
25
@@ -XXX,XX +XXX,XX @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
19
digest = qemu_opt_get(opts, "header-digest");
20
if (!digest) {
21
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
22
- } else if (!strcmp(digest, "CRC32C")) {
23
+ } else if (!strcmp(digest, "crc32c")) {
24
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C);
25
- } else if (!strcmp(digest, "NONE")) {
26
+ } else if (!strcmp(digest, "none")) {
27
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE);
28
- } else if (!strcmp(digest, "CRC32C-NONE")) {
29
+ } else if (!strcmp(digest, "crc32c-none")) {
30
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C_NONE);
31
- } else if (!strcmp(digest, "NONE-CRC32C")) {
32
+ } else if (!strcmp(digest, "none-crc32c")) {
33
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
34
} else {
35
error_setg(errp, "Invalid header-digest setting : %s", digest);
36
@@ -XXX,XX +XXX,XX @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
37
38
header_digest = qemu_opt_get(opts, "header-digest");
39
if (header_digest) {
40
- qdict_set_default_str(options, "header-digest", header_digest);
41
+ /* -iscsi takes upper case values, but QAPI only supports lower case
42
+ * enum constant names, so we have to convert here. */
43
+ char *qapi_value = g_ascii_strdown(header_digest, -1);
44
+ qdict_set_default_str(options, "header-digest", qapi_value);
45
+ g_free(qapi_value);
46
}
26
}
47
27
48
timeout = qemu_opt_get(opts, "timeout");
28
if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) {
49
diff --git a/qapi/block-core.json b/qapi/block-core.json
29
- error_report("Size of all 'sgx-epc' =0x%"PRIu64" causes EPC to wrap",
30
+ error_report("Size of all 'sgx-epc' =0x%"PRIx64" causes EPC to wrap",
31
sgx_epc->size);
32
exit(EXIT_FAILURE);
33
}
34
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
50
index XXXXXXX..XXXXXXX 100644
35
index XXXXXXX..XXXXXXX 100644
51
--- a/qapi/block-core.json
36
--- a/hw/i386/trace-events
52
+++ b/qapi/block-core.json
37
+++ b/hw/i386/trace-events
38
@@ -XXX,XX +XXX,XX @@ vtd_fault_disabled(void) "Fault processing disabled for context entry"
39
vtd_replay_ce_valid(const char *mode, uint8_t bus, uint8_t dev, uint8_t fn, uint16_t domain, uint64_t hi, uint64_t lo) "%s: replay valid context device %02"PRIx8":%02"PRIx8".%02"PRIx8" domain 0x%"PRIx16" hi 0x%"PRIx64" lo 0x%"PRIx64
40
vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8
41
vtd_page_walk_level(uint64_t addr, uint32_t level, uint64_t start, uint64_t end) "walk (base=0x%"PRIx64", level=%"PRIu32") iova range 0x%"PRIx64" - 0x%"PRIx64
42
-vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIu16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d"
43
+vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIx16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d"
44
vtd_page_walk_one_skip_map(uint64_t iova, uint64_t mask, uint64_t translated) "iova 0x%"PRIx64" mask 0x%"PRIx64" translated 0x%"PRIx64
45
vtd_page_walk_one_skip_unmap(uint64_t iova, uint64_t mask) "iova 0x%"PRIx64" mask 0x%"PRIx64
46
vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to unable to read"
47
vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set"
48
vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)"
49
vtd_as_unmap_whole(uint8_t bus, uint8_t slot, uint8_t fn, uint64_t iova, uint64_t size) "Device %02x:%02x.%x start 0x%"PRIx64" size 0x%"PRIx64
50
-vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIu16", iova 0x%"PRIx64
51
-vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIu16" %d"
52
+vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIx16", iova 0x%"PRIx64
53
+vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIx16" %d"
54
vtd_irq_generate(uint64_t addr, uint64_t data) "addr 0x%"PRIx64" data 0x%"PRIx64
55
vtd_reg_read(uint64_t addr, uint64_t size) "addr 0x%"PRIx64" size 0x%"PRIx64
56
vtd_reg_write(uint64_t addr, uint64_t size, uint64_t val) "addr 0x%"PRIx64" size 0x%"PRIx64" value 0x%"PRIx64
57
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
58
index XXXXXXX..XXXXXXX 100644
59
--- a/hw/misc/trace-events
60
+++ b/hw/misc/trace-events
53
@@ -XXX,XX +XXX,XX @@
61
@@ -XXX,XX +XXX,XX @@
54
# @nfs: Since 2.8
62
# See docs/devel/tracing.rst for syntax documentation.
55
# @replication: Since 2.8
63
56
# @ssh: Since 2.8
64
# allwinner-cpucfg.c
57
+# @iscsi: Since 2.9
65
-allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIu32
58
#
66
+allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIx32
59
# Since: 2.0
67
allwinner_cpucfg_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
60
##
68
allwinner_cpucfg_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
61
{ 'enum': 'BlockdevDriver',
69
62
'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
70
@@ -XXX,XX +XXX,XX @@ imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08
63
'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
71
64
- 'host_device', 'http', 'https', 'luks', 'nbd', 'nfs', 'null-aio',
72
# mos6522.c
65
- 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw',
73
mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d"
66
- 'replication', 'ssh', 'vdi', 'vhdx', 'vmdk', 'vpc',
74
-mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRId64 " delta_next=0x%"PRId64
67
- 'vvfat' ] }
75
+mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRIx64 " delta_next=0x%"PRIx64
68
+ 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
76
mos6522_set_sr_int(void) "set sr_int"
69
+ 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
77
mos6522_write(uint64_t addr, const char *name, uint64_t val) "reg=0x%"PRIx64 " [%s] val=0x%"PRIx64
70
+ 'quorum', 'raw', 'replication', 'ssh', 'vdi', 'vhdx', 'vmdk',
78
mos6522_read(uint64_t addr, const char *name, unsigned val) "reg=0x%"PRIx64 " [%s] val=0x%x"
71
+ 'vpc', 'vvfat' ] }
79
diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events
72
80
index XXXXXXX..XXXXXXX 100644
73
##
81
--- a/hw/scsi/trace-events
74
# @BlockdevOptionsFile:
82
+++ b/hw/scsi/trace-events
75
@@ -XXX,XX +XXX,XX @@
83
@@ -XXX,XX +XXX,XX @@ lsi_bad_phase_interrupt(void) "Phase mismatch interrupt"
76
'*logfile': 'str' } }
84
lsi_bad_selection(uint32_t id) "Selected absent target %"PRIu32
77
85
lsi_do_dma_unavailable(void) "DMA no data available"
78
##
86
lsi_do_dma(uint64_t addr, int len) "DMA addr=0x%"PRIx64" len=%d"
79
+# @IscsiTransport:
87
-lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRId32
80
+#
88
+lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRIx32
81
+# An enumeration of libiscsi transport types
89
lsi_add_msg_byte_error(void) "MSG IN data too long"
82
+#
90
lsi_add_msg_byte(uint8_t data) "MSG IN 0x%02x"
83
+# Since: 2.9
91
lsi_reselect(int id) "Reselected target %d"
84
+##
92
@@ -XXX,XX +XXX,XX @@ lsi_do_msgout_noop(void) "MSG: No Operation"
85
+{ 'enum': 'IscsiTransport',
93
lsi_do_msgout_extended(uint8_t msg, uint8_t len) "Extended message 0x%x (len %d)"
86
+ 'data': [ 'tcp', 'iser' ] }
94
lsi_do_msgout_ignored(const char *msg) "%s (ignored)"
87
+
95
lsi_do_msgout_simplequeue(uint8_t select_tag) "SIMPLE queue tag=0x%x"
88
+##
96
-lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRId32
89
+# @IscsiHeaderDigest:
97
+lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRIx32
90
+#
98
lsi_do_msgout_clearqueue(uint32_t tag) "MSG: CLEAR QUEUE tag=0x%"PRIx32
91
+# An enumeration of header digests supported by libiscsi
99
lsi_do_msgout_busdevicereset(uint32_t tag) "MSG: BUS DEVICE RESET tag=0x%"PRIx32
92
+#
100
lsi_do_msgout_select(int id) "Select LUN %d"
93
+# Since: 2.9
94
+##
95
+{ 'enum': 'IscsiHeaderDigest',
96
+ 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
97
+ 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
98
+
99
+##
100
+# @BlockdevOptionsIscsi:
101
+#
102
+# @transport The iscsi transport type
103
+#
104
+# @portal The address of the iscsi portal
105
+#
106
+# @target The target iqn name
107
+#
108
+# @lun #optional LUN to connect to. Defaults to 0.
109
+#
110
+# @user #optional User name to log in with. If omitted, no CHAP
111
+# authentication is performed.
112
+#
113
+# @password-secret #optional The ID of a QCryptoSecret object providing
114
+# the password for the login. This option is required if
115
+# @user is specified.
116
+#
117
+# @initiator-name #optional The iqn name we want to identify to the target
118
+# as. If this option is not specified, an initiator name is
119
+# generated automatically.
120
+#
121
+# @header-digest #optional The desired header digest. Defaults to
122
+# none-crc32c.
123
+#
124
+# @timeout #optional Timeout in seconds after which a request will
125
+# timeout. 0 means no timeout and is the default.
126
+#
127
+# Driver specific block device options for iscsi
128
+#
129
+# Since: 2.9
130
+##
131
+{ 'struct': 'BlockdevOptionsIscsi',
132
+ 'data': { 'transport': 'IscsiTransport',
133
+ 'portal': 'str',
134
+ 'target': 'str',
135
+ '*lun': 'int',
136
+ '*user': 'str',
137
+ '*password-secret': 'str',
138
+ '*initiator-name': 'str',
139
+ '*header-digest': 'IscsiHeaderDigest',
140
+ '*timeout': 'int' } }
141
+
142
+##
143
# @ReplicationMode:
144
#
145
# An enumeration of replication modes.
146
@@ -XXX,XX +XXX,XX @@
147
'host_device':'BlockdevOptionsFile',
148
'http': 'BlockdevOptionsCurl',
149
'https': 'BlockdevOptionsCurl',
150
-# TODO iscsi: Wait for structured options
151
+ 'iscsi': 'BlockdevOptionsIscsi',
152
'luks': 'BlockdevOptionsLUKS',
153
'nbd': 'BlockdevOptionsNbd',
154
'nfs': 'BlockdevOptionsNfs',
155
--
101
--
156
2.9.3
102
2.35.1
157
103
158
104
diff view generated by jsdifflib
Deleted patch
1
Signed-off-by: Jeff Cody <jcody@redhat.com>
2
---
3
qapi/block-core.json | 50 +++++++++++++++++++++++++-------------------------
4
1 file changed, 25 insertions(+), 25 deletions(-)
5
1
6
diff --git a/qapi/block-core.json b/qapi/block-core.json
7
index XXXXXXX..XXXXXXX 100644
8
--- a/qapi/block-core.json
9
+++ b/qapi/block-core.json
10
@@ -XXX,XX +XXX,XX @@
11
# 1.
12
# -> { "execute": "blockdev-add",
13
# "arguments": {
14
-# "options" : { "driver": "qcow2",
15
-# "file": { "driver": "file",
16
-# "filename": "test.qcow2" } } } }
17
+# "driver": "qcow2",
18
+# "node-name": "test1",
19
+# "file": {
20
+# "driver": "file",
21
+# "filename": "test.qcow2"
22
+# }
23
+# }
24
+# }
25
# <- { "return": {} }
26
#
27
# 2.
28
# -> { "execute": "blockdev-add",
29
# "arguments": {
30
-# "options": {
31
-# "driver": "qcow2",
32
-# "node-name": "node0",
33
-# "discard": "unmap",
34
-# "cache": {
35
-# "direct": true,
36
-# "writeback": true
37
+# "driver": "qcow2",
38
+# "node-name": "node0",
39
+# "discard": "unmap",
40
+# "cache": {
41
+# "direct": true
42
# },
43
# "file": {
44
-# "driver": "file",
45
-# "filename": "/tmp/test.qcow2"
46
+# "driver": "file",
47
+# "filename": "/tmp/test.qcow2"
48
# },
49
# "backing": {
50
-# "driver": "raw",
51
-# "file": {
52
-# "driver": "file",
53
-# "filename": "/dev/fdset/4"
54
+# "driver": "raw",
55
+# "file": {
56
+# "driver": "file",
57
+# "filename": "/dev/fdset/4"
58
# }
59
# }
60
-# }
61
# }
62
# }
63
#
64
@@ -XXX,XX +XXX,XX @@
65
#
66
# -> { "execute": "blockdev-add",
67
# "arguments": {
68
-# "options": {
69
-# "driver": "qcow2",
70
-# "node-name": "node0",
71
-# "file": {
72
-# "driver": "file",
73
-# "filename": "test.qcow2"
74
-# }
75
-# }
76
+# "driver": "qcow2",
77
+# "node-name": "node0",
78
+# "file": {
79
+# "driver": "file",
80
+# "filename": "test.qcow2"
81
+# }
82
# }
83
# }
84
# <- { "return": {} }
85
--
86
2.9.3
87
88
diff view generated by jsdifflib
Deleted patch
1
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
2
1
3
If explicit zeroing out before mirroring is required for the target image,
4
it moves the block job offset counter to EOF, then offset and len counters
5
count the image size twice. There is no harm but stats are confusing,
6
specifically the progress of the operation is always reported as 99% by
7
management tools.
8
9
The patch skips offset increase for the first "technical" pass over the
10
image. This should not cause any further harm.
11
12
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
13
Signed-off-by: Denis V. Lunev <den@openvz.org>
14
Reviewed-by: Eric Blake <eblake@redhat.com>
15
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
16
Message-id: 1486045515-8009-1-git-send-email-den@openvz.org
17
CC: Jeff Cody <jcody@redhat.com>
18
CC: Kevin Wolf <kwolf@redhat.com>
19
CC: Max Reitz <mreitz@redhat.com>
20
CC: Eric Blake <eblake@redhat.com>
21
Signed-off-by: Jeff Cody <jcody@redhat.com>
22
---
23
block/mirror.c | 9 +++++++--
24
1 file changed, 7 insertions(+), 2 deletions(-)
25
26
diff --git a/block/mirror.c b/block/mirror.c
27
index XXXXXXX..XXXXXXX 100644
28
--- a/block/mirror.c
29
+++ b/block/mirror.c
30
@@ -XXX,XX +XXX,XX @@ typedef struct MirrorBlockJob {
31
bool waiting_for_io;
32
int target_cluster_sectors;
33
int max_iov;
34
+ bool initial_zeroing_ongoing;
35
} MirrorBlockJob;
36
37
typedef struct MirrorOp {
38
@@ -XXX,XX +XXX,XX @@ static void mirror_iteration_done(MirrorOp *op, int ret)
39
if (s->cow_bitmap) {
40
bitmap_set(s->cow_bitmap, chunk_num, nb_chunks);
41
}
42
- s->common.offset += (uint64_t)op->nb_sectors * BDRV_SECTOR_SIZE;
43
+ if (!s->initial_zeroing_ongoing) {
44
+ s->common.offset += (uint64_t)op->nb_sectors * BDRV_SECTOR_SIZE;
45
+ }
46
}
47
-
48
qemu_iovec_destroy(&op->qiov);
49
g_free(op);
50
51
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
52
return 0;
53
}
54
55
+ s->initial_zeroing_ongoing = true;
56
for (sector_num = 0; sector_num < end; ) {
57
int nb_sectors = MIN(end - sector_num,
58
QEMU_ALIGN_DOWN(INT_MAX, s->granularity) >> BDRV_SECTOR_BITS);
59
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
60
mirror_throttle(s);
61
62
if (block_job_is_cancelled(&s->common)) {
63
+ s->initial_zeroing_ongoing = false;
64
return 0;
65
}
66
67
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
68
}
69
70
mirror_wait_for_all_io(s);
71
+ s->initial_zeroing_ongoing = false;
72
}
73
74
/* First part, loop on the sectors and initialize the dirty bitmap. */
75
--
76
2.9.3
77
78
diff view generated by jsdifflib