summaryrefslogtreecommitdiff
path: root/device-hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'device-hotplug.c')
-rw-r--r--device-hotplug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/device-hotplug.c b/device-hotplug.c
index 103d34ac45..ebfa6b1016 100644
--- a/device-hotplug.c
+++ b/device-hotplug.c
@@ -33,12 +33,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_init(opts, mc->qemu_machine->block_default_type);
if (!dinfo) {
qemu_opts_del(opts);
return NULL;