Skip to content
  • Kevin Wolf's avatar
    qemu-img: Use user_creatable_process_cmdline() for --object · 99b1e646
    Kevin Wolf authored
    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 334c43e2
    
     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: default avatarKevin Wolf <kwolf@redhat.com>
    Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Acked-by: default avatarPeter Krempa <pkrempa@redhat.com>
    Reviewed-by: Eric Blake's avatarEric Blake <eblake@redhat.com>
    99b1e646