mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
qemu-img: compare: use helper function for --object
Use the same function to parse --object as used by all other qemu-img subcommands. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-ID: <20250531171609.197078-11-mjt@tls.msk.ru> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
committed by
Kevin Wolf
parent
a79d282fc9
commit
eedfb5c07e
16
qemu-img.c
16
qemu-img.c
@@ -1529,20 +1529,8 @@ static int img_compare(const img_cmd_t *ccmd, int argc, char **argv)
|
||||
force_share = true;
|
||||
break;
|
||||
case OPTION_OBJECT:
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!user_creatable_add_from_str(optarg, &local_err)) {
|
||||
if (local_err) {
|
||||
error_report_err(local_err);
|
||||
exit(2);
|
||||
} else {
|
||||
/* Help was printed */
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
user_creatable_process_cmdline(optarg);
|
||||
break;
|
||||
case OPTION_IMAGE_OPTS:
|
||||
image_opts = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user