On 10/8/18 12:31 PM, Markus Armbruster wrote:
Calling error_report() from within a a function that takes an Error **

s/a a/a/

argument is suspicious.  drive_new() does that, and its caller
drive_init_func() then exit()s.  Its caller main(), via
qemu_opts_foreach(), is fine with it, but clean it up anyway:

* Convert drive_new() to Error

* Update add_init_drive() to report the error received from
   drive_new().

* Make main() pass &error_fatal through qemu_opts_foreach(),
   drive_init_func() to drive_new()

* Make default_drive() pass &error_abort through qemu_opts_foreach(),
   drive_init_func() to drive_new()

Cc: Kevin Wolf <kw...@redhat.com>
Cc: Max Reitz <mre...@redhat.com>
Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
  blockdev.c                | 27 ++++++++++++++-------------
  device-hotplug.c          |  5 ++++-
  include/sysemu/blockdev.h |  3 ++-
  vl.c                      | 11 ++++-------
  4 files changed, 24 insertions(+), 22 deletions(-)


Reviewed-by: Eric Blake <ebl...@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to