Skip to content

Commit

Permalink
qemu-img: Use user_creatable_process_cmdline() for --object
Browse files Browse the repository at this point in the history
This switches qemu-img from a QemuOpts-based parser for --object to
user_creatable_process_cmdline() which uses a keyval parser and enforces
the QAPI schema.

Apart from being a cleanup, this makes non-scalar properties accessible.

As a side effect, fix wrong exit codes in the object parsing error path
of 'qemu-img compare'. This was broken in commit 334c43e because
&error_fatal exits with an exit code of 1, while it should have been 2.

Document that exit code 0 is also returned when just requested help was
printed instead of comparing images. This is preexisting behaviour that
isn't changed by this patch, though another instance of it is added with
'--object help'.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
kevmw committed Mar 15, 2021
1 parent d3cc008 commit 5bed517
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 207 deletions.
2 changes: 1 addition & 1 deletion docs/tools/qemu-img.rst
Expand Up @@ -404,7 +404,7 @@ Command description:
The following table sumarizes all exit codes of the compare subcommand:

0
Images are identical
Images are identical (or requested help was printed)
1
Images differ
2
Expand Down

0 comments on commit 5bed517

Please sign in to comment.