X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/d7f0a59ff02affb8270ad9b6ee7e60974ac92df0..d901f3c457ade0b4934427c0e8608dea31610720:/device-hotplug.c diff --git a/device-hotplug.c b/device-hotplug.c index ebfa6b1016..9e38cc4808 100644 --- a/device-hotplug.c +++ b/device-hotplug.c @@ -24,6 +24,7 @@ #include "hw/hw.h" #include "hw/boards.h" +#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "qemu/config-file.h" #include "sysemu/sysemu.h" @@ -40,7 +41,7 @@ DriveInfo *add_init_drive(const char *optstr) return NULL; mc = MACHINE_GET_CLASS(current_machine); - dinfo = drive_init(opts, mc->qemu_machine->block_default_type); + dinfo = drive_new(opts, mc->block_default_type); if (!dinfo) { qemu_opts_del(opts); return NULL; @@ -76,6 +77,6 @@ void drive_hot_add(Monitor *mon, const QDict *qdict) err: if (dinfo) { - drive_put_ref(dinfo); + blk_unref(blk_by_legacy_dinfo(dinfo)); } }