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:
parent
a79d282fc9
commit
eedfb5c07e
1 changed files with 2 additions and 14 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue