]> git.proxmox.com Git - mirror_qemu.git/blobdiff - device-hotplug.c
hmp: Clean up declarations for long-gone info handlers
[mirror_qemu.git] / device-hotplug.c
index 103d34ac45ea49039be2d562b23f9995a3b4c905..9e38cc4808f75c965b8284776bf138095f9a1889 100644 (file)
@@ -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"
@@ -33,12 +34,14 @@ DriveInfo *add_init_drive(const char *optstr)
 {
     DriveInfo *dinfo;
     QemuOpts *opts;
+    MachineClass *mc;
 
     opts = drive_def(optstr);
     if (!opts)
         return NULL;
 
-    dinfo = drive_init(opts, current_machine->block_default_type);
+    mc = MACHINE_GET_CLASS(current_machine);
+    dinfo = drive_new(opts, mc->block_default_type);
     if (!dinfo) {
         qemu_opts_del(opts);
         return NULL;
@@ -74,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));
     }
 }