diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-10-17 10:26:57 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-10-19 14:51:34 +0200 |
commit | c4f26c9f37ce511e5fe629c21c180dc6eb7c5a25 (patch) | |
tree | 71f9b8ec1ca23f70733ce1aae570e51179cda9c7 /include | |
parent | f881ca19f1942965490a70d23566c6287c49ceac (diff) |
blockdev: Convert drive_new() to Error
Calling error_report() from within a function that takes an Error **
argument is suspicious. drive_new() calls error_report() even though
it can run within drive_init_func(), which takes an Error ** argument.
drive_init_func()'s 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 <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181017082702.5581-34-armbru@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/blockdev.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 24954b94e0..d34c4920dc 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -54,7 +54,8 @@ DriveInfo *drive_get_next(BlockInterfaceType type); QemuOpts *drive_def(const char *optstr); QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file, const char *optstr); -DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type); +DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type, + Error **errp); /* device-hotplug */ |