summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-img.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index d4518e724f..309c14bbae 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1378,6 +1378,20 @@ static int img_convert(int argc, char **argv)
goto out;
}
+ if (!drv->create_opts) {
+ error_report("Format driver '%s' does not support image creation",
+ drv->format_name);
+ ret = -1;
+ goto out;
+ }
+
+ if (!proto_drv->create_opts) {
+ error_report("Protocol driver '%s' does not support image creation",
+ proto_drv->format_name);
+ ret = -1;
+ goto out;
+ }
+
create_opts = qemu_opts_append(create_opts, drv->create_opts);
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);