Commit a3981eb9 authored by Stefan Hajnoczi's avatar 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: default avatarStefan Hajnoczi <>
Reviewed-by: default avatarMax Reitz <>
parent 212aefaa
......@@ -752,7 +752,7 @@ static int img_commit(int argc, char **argv)
ret = bdrv_parse_cache_flags(cache, &flags);
if (ret < 0) {
error_report("Invalid cache option: %s", cache);
return -1;
return 1;
bs = bdrv_new_open("image", filename, fmt, flags, true, quiet);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment