diff options
author | Ulrich Hecht <uli@suse.de> | 2009-04-14 16:37:42 +0200 |
---|---|---|
committer | Yury Usishchev <y.usishchev@samsung.com> | 2014-12-10 13:47:57 +0300 |
commit | e42dffc94cb2b1d9d53753f45e12bea1d191ed97 (patch) | |
tree | cb02926e46c7585bf9c9b916b8c3502f3b838e21 /block | |
parent | 9a55b1111955914bad2b347190bd82c2535836cc (diff) | |
download | qemu-e42dffc94cb2b1d9d53753f45e12bea1d191ed97.tar.gz qemu-e42dffc94cb2b1d9d53753f45e12bea1d191ed97.tar.bz2 qemu-e42dffc94cb2b1d9d53753f45e12bea1d191ed97.zip |
block/vmdk: Support creation of SCSI VMDK images in qemu-img
Signed-off-by: Ulrich Hecht <uli@suse.de>
[AF: Changed BLOCK_FLAG_SCSI from 8 to 16 for v1.2]
[AF: Rebased onto upstream VMDK SCSI support]
[AF: Rebased onto skipping of image creation in v1.7]
[AF: Simplified in preparation for v1.7.1/v2.0]
[AF: Rebased onto QemuOpts conversion for v2.1]
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'block')
-rw-r--r-- | block/vmdk.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/block/vmdk.c b/block/vmdk.c index 2cbfd3e72..caefe1910 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1818,9 +1818,12 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp) if (qemu_opt_get_bool_del(opts, BLOCK_OPT_ZEROED_GRAIN, false)) { zeroed_grain = true; } + if (qemu_opt_get_bool_del(opts, BLOCK_OPT_SCSI, false)) { + flags |= BLOCK_FLAG_SCSI; + } if (!adapter_type) { - adapter_type = g_strdup("ide"); + adapter_type = g_strdup(flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide"); } else if (strcmp(adapter_type, "ide") && strcmp(adapter_type, "buslogic") && strcmp(adapter_type, "lsilogic") && @@ -2223,6 +2226,11 @@ static QemuOptsList vmdk_create_opts = { .help = "Enable efficient zero writes " "using the zeroed-grain GTE feature" }, + { + .name = BLOCK_OPT_SCSI, + .type = QEMU_OPT_BOOL, + .help = "SCSI image" + }, { /* end of list */ } } }; |