summaryrefslogtreecommitdiff
path: root/block/iscsi.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-12-08 14:23:11 +0100
committerJeff Cody <jcody@redhat.com>2017-02-21 10:37:34 -0500
commit31eb1202d391f7e35307c7aaddb03224efcba331 (patch)
treeca97770fa2bfda64defdc3b57f3205eefacfea01 /block/iscsi.c
parent1d56010482be1a29d02fbbf2cee46633298a5e81 (diff)
downloadqemu-31eb1202d391f7e35307c7aaddb03224efcba331.tar.gz
iscsi: Add blockdev-add support
This adds blockdev-add support for iscsi devices. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r--block/iscsi.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 3adb9b1fbd..c4f813bfd2 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1291,13 +1291,13 @@ static void apply_header_digest(struct iscsi_context *iscsi, QemuOpts *opts,
digest = qemu_opt_get(opts, "header-digest");
if (!digest) {
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
- } else if (!strcmp(digest, "CRC32C")) {
+ } else if (!strcmp(digest, "crc32c")) {
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C);
- } else if (!strcmp(digest, "NONE")) {
+ } else if (!strcmp(digest, "none")) {
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE);
- } else if (!strcmp(digest, "CRC32C-NONE")) {
+ } else if (!strcmp(digest, "crc32c-none")) {
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C_NONE);
- } else if (!strcmp(digest, "NONE-CRC32C")) {
+ } else if (!strcmp(digest, "none-crc32c")) {
iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);
} else {
error_setg(errp, "Invalid header-digest setting : %s", digest);
@@ -1576,7 +1576,11 @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
header_digest = qemu_opt_get(opts, "header-digest");
if (header_digest) {
- qdict_set_default_str(options, "header-digest", header_digest);
+ /* -iscsi takes upper case values, but QAPI only supports lower case
+ * enum constant names, so we have to convert here. */
+ char *qapi_value = g_ascii_strdown(header_digest, -1);
+ qdict_set_default_str(options, "header-digest", qapi_value);
+ g_free(qapi_value);
}
timeout = qemu_opt_get(opts, "timeout");