mirror of https://gitee.com/openkylin/qemu.git
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJZQbChAAoJEL2+eyfA3jBXNQ4QAIOwL7b6cirCuClTb9aWL2bL 9CZycs2wsXeWiC4kfQkKbdtbzq39FAb+9GCQrw/pMsMulCrfaabi5376FmekRWi1 1v9o1O81jgcQLExVBiaLxA6kA2lfpN0+H2byz2PJg2mjDPaTvoxjp8XLS2u0eZni FcaEQ1WSYIgYUTkNCcC7bt+FQChAA8QoxxTwJ0QCk/sYyWzJSg+fOtx1R3mzhh2j CDUVeLmHGwi2nSDp0AhD/+taUsMGab7TZSftOjjDDqfNEQWMy4erax4e0cun5vXb mGrSQeP1YHNje/T6nsQm6eCT2rcfkmcLHnhCVk2k0uDmCJeZIhE1TM0kzKYa4O+W mjJZdT4mskpC4rJJC/qS+9hOqy70aeRq6EK9NBqzu8KAt8MtRKTgfEHAyhaejljM aiReCF89ulUPVGD6p2SfYASItZs1ICtmVJb9PIIsBdUZMPKXWo6tBaZvB6CPEKp6 7nfau4kQ/anpDnGx4lBmC9D4pe72L4BFn69nF59viQguIX5cb60dwczWqVAtVlGh r+xNBpkHjnE3sWfM04+Sg0H8kQpnoBPQdqTdEw+asXUphDuz095YqK1hLhwh2fkb TVs7VaV6nYYLxwjYczecTgEJhZm0bBpEV4rSU9HURfSg3uX/Fo+xYZcgGSR3aHIA Ft+uI1M8EAPannzVNTlh =cEKt -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging # gpg: Signature made Wed 14 Jun 2017 22:54:41 BST # gpg: using RSA key 0xBDBE7B27C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057 * remotes/cody/tags/block-pull-request: block/iscsi: enable filename option and parsing block/rbd: enable filename option and parsing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
5837aaac25
|
@ -1732,6 +1732,10 @@ static QemuOptsList runtime_opts = {
|
|||
.name = "timeout",
|
||||
.type = QEMU_OPT_NUMBER,
|
||||
},
|
||||
{
|
||||
.name = "filename",
|
||||
.type = QEMU_OPT_STRING,
|
||||
},
|
||||
{ /* end of list */ }
|
||||
},
|
||||
};
|
||||
|
@ -1747,12 +1751,27 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
char *initiator_name = NULL;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
const char *transport_name, *portal, *target;
|
||||
const char *transport_name, *portal, *target, *filename;
|
||||
#if LIBISCSI_API_VERSION >= (20160603)
|
||||
enum iscsi_transport_type transport;
|
||||
#endif
|
||||
int i, ret = 0, timeout = 0, lun;
|
||||
|
||||
/* If we are given a filename, parse the filename, with precedence given to
|
||||
* filename encoded options */
|
||||
filename = qdict_get_try_str(options, "filename");
|
||||
if (filename) {
|
||||
error_report("Warning: 'filename' option specified. "
|
||||
"This is an unsupported option, and may be deprecated "
|
||||
"in the future");
|
||||
iscsi_parse_filename(filename, options, &local_err);
|
||||
if (local_err) {
|
||||
ret = -EINVAL;
|
||||
error_propagate(errp, local_err);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
|
@ -1967,6 +1986,7 @@ out:
|
|||
}
|
||||
memset(iscsilun, 0, sizeof(IscsiLun));
|
||||
}
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
22
block/rbd.c
22
block/rbd.c
|
@ -340,6 +340,10 @@ static QemuOptsList runtime_opts = {
|
|||
.type = QEMU_OPT_STRING,
|
||||
.help = "Legacy rados key/value option parameters",
|
||||
},
|
||||
{
|
||||
.name = "filename",
|
||||
.type = QEMU_OPT_STRING,
|
||||
},
|
||||
{ /* end of list */ }
|
||||
},
|
||||
};
|
||||
|
@ -541,12 +545,27 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
{
|
||||
BDRVRBDState *s = bs->opaque;
|
||||
const char *pool, *snap, *conf, *user, *image_name, *keypairs;
|
||||
const char *secretid;
|
||||
const char *secretid, *filename;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
char *mon_host = NULL;
|
||||
int r;
|
||||
|
||||
/* If we are given a filename, parse the filename, with precedence given to
|
||||
* filename encoded options */
|
||||
filename = qdict_get_try_str(options, "filename");
|
||||
if (filename) {
|
||||
error_report("Warning: 'filename' option specified. "
|
||||
"This is an unsupported option, and may be deprecated "
|
||||
"in the future");
|
||||
qemu_rbd_parse_filename(filename, options, &local_err);
|
||||
if (local_err) {
|
||||
r = -EINVAL;
|
||||
error_propagate(errp, local_err);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
|
@ -665,6 +684,7 @@ failed_shutdown:
|
|||
failed_opts:
|
||||
qemu_opts_del(opts);
|
||||
g_free(mon_host);
|
||||
exit:
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue