提交 a3981eb9 编写于 作者: S Stefan Hajnoczi

qemu-img: fix img_commit() error return value

The img_commit() return value is a process exit code.  Use 1 for failure
instead of -1.  The other failure paths in this function already use 1.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
上级 212aefaa
...@@ -752,7 +752,7 @@ static int img_commit(int argc, char **argv) ...@@ -752,7 +752,7 @@ static int img_commit(int argc, char **argv)
ret = bdrv_parse_cache_flags(cache, &flags); ret = bdrv_parse_cache_flags(cache, &flags);
if (ret < 0) { if (ret < 0) {
error_report("Invalid cache option: %s", cache); error_report("Invalid cache option: %s", cache);
return -1; return 1;
} }
bs = bdrv_new_open("image", filename, fmt, flags, true, quiet); bs = bdrv_new_open("image", filename, fmt, flags, true, quiet);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册