提交 2e024cde 编写于 作者: M Max Reitz 提交者: Stefan Hajnoczi

qemu-img: Fix qemu-img convert -n

If -n is specified, it does not matter whether the output format and
protocol support image creation; building the creation options should
simply be skipped.
Signed-off-by: NMax Reitz <mreitz@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 1423666727-20777-2-git-send-email-mreitz@redhat.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 fb13bbf2
...@@ -1531,6 +1531,7 @@ static int img_convert(int argc, char **argv) ...@@ -1531,6 +1531,7 @@ static int img_convert(int argc, char **argv)
goto out; goto out;
} }
if (!skip_create) {
if (!drv->create_opts) { if (!drv->create_opts) {
error_report("Format driver '%s' does not support image creation", error_report("Format driver '%s' does not support image creation",
drv->format_name); drv->format_name);
...@@ -1560,6 +1561,7 @@ static int img_convert(int argc, char **argv) ...@@ -1560,6 +1561,7 @@ static int img_convert(int argc, char **argv)
if (ret < 0) { if (ret < 0) {
goto out; goto out;
} }
}
/* Get backing file name if -o backing_file was used */ /* Get backing file name if -o backing_file was used */
out_baseimg_param = qemu_opt_get(opts, BLOCK_OPT_BACKING_FILE); out_baseimg_param = qemu_opt_get(opts, BLOCK_OPT_BACKING_FILE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册