X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/d3bd57d9f6a60187e381c6dbcb004701fb090be8..ca3c979d6be82e88bd19ade3f6e4c9c2bc4887ea:/device-hotplug.c diff --git a/device-hotplug.c b/device-hotplug.c index cd427e2c76..f01d53774b 100644 --- a/device-hotplug.c +++ b/device-hotplug.c @@ -23,11 +23,11 @@ */ #include "qemu/osdep.h" -#include "hw/hw.h" #include "hw/boards.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "qapi/qmp/qdict.h" +#include "qapi/error.h" #include "qemu/config-file.h" #include "qemu/option.h" #include "sysemu/sysemu.h" @@ -36,6 +36,7 @@ static DriveInfo *add_init_drive(const char *optstr) { + Error *err = NULL; DriveInfo *dinfo; QemuOpts *opts; MachineClass *mc; @@ -45,8 +46,9 @@ static DriveInfo *add_init_drive(const char *optstr) return NULL; mc = MACHINE_GET_CLASS(current_machine); - dinfo = drive_new(opts, mc->block_default_type); - if (!dinfo) { + dinfo = drive_new(opts, mc->block_default_type, &err); + if (err) { + error_report_err(err); qemu_opts_del(opts); return NULL; }