Skip to content
  • Markus Armbruster's avatar
    da7e92ca
    block: Clean up bdrv_img_create()'s error reporting · da7e92ca
    Markus Armbruster authored
    
    
    bdrv_img_create() takes an Error ** argument and uses it in the
    conventional way, except for one place: when qemu_opts_do_parse()
    fails, it first reports its error to stderr or the HMP monitor with
    error_report_err(), then error_setg()'s a generic error.
    
    When the caller reports that second error similarly, this produces two
    consecutive error messages on stderr or the HMP monitor.
    
    When the caller does something else with it, such as send it via QMP,
    the first error still goes to stderr or the HMP monitor.  Fortunately,
    no such caller exists.
    
    Simply use the first error as is.  Update expected output of
    qemu-iotest 049 accordingly.
    
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Max Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20181017082702.5581-37-armbru@redhat.com>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    da7e92ca
    block: Clean up bdrv_img_create()'s error reporting
    Markus Armbruster authored
    
    
    bdrv_img_create() takes an Error ** argument and uses it in the
    conventional way, except for one place: when qemu_opts_do_parse()
    fails, it first reports its error to stderr or the HMP monitor with
    error_report_err(), then error_setg()'s a generic error.
    
    When the caller reports that second error similarly, this produces two
    consecutive error messages on stderr or the HMP monitor.
    
    When the caller does something else with it, such as send it via QMP,
    the first error still goes to stderr or the HMP monitor.  Fortunately,
    no such caller exists.
    
    Simply use the first error as is.  Update expected output of
    qemu-iotest 049 accordingly.
    
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Max Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20181017082702.5581-37-armbru@redhat.com>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading