summary refs log tree commit diff stats
path: root/hw/device-hotplug.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-11-22 15:16:36 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2012-12-07 12:34:12 +0100
commit4dbd84e26f53d3283baa463f390f9623e8913e8f (patch)
tree40de5fd5f4e8bef6ec036f90761f325f97f77486 /hw/device-hotplug.c
parent036f0f8356936dba36b952c16f477b3f04f54e37 (diff)
downloadfocaccia-qemu-4dbd84e26f53d3283baa463f390f9623e8913e8f.tar.gz
focaccia-qemu-4dbd84e26f53d3283baa463f390f9623e8913e8f.zip
Clean up pci_drive_hot_add()'s use of BlockInterfaceType
pci_drive_hot_add() parameter type has the wrong type: int instead of
BlockInterfaceType.  It's actually redundant, so we can just drop it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/device-hotplug.c')
-rw-r--r--hw/device-hotplug.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index eec0fe3148..6d9c080381 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -49,18 +49,16 @@ DriveInfo *add_init_drive(const char *optstr)
 }
 
 #if !defined(TARGET_I386)
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
-                      DriveInfo *dinfo, int type)
+int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo)
 {
     /* On non-x86 we don't do PCI hotplug */
-    monitor_printf(mon, "Can't hot-add drive to type %d\n", type);
+    monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
     return -1;
 }
 #endif
 
 void drive_hot_add(Monitor *mon, const QDict *qdict)
 {
-    int type;
     DriveInfo *dinfo = NULL;
     const char *opts = qdict_get_str(qdict, "opts");
 
@@ -72,14 +70,13 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
         monitor_printf(mon, "Parameter addr not supported\n");
         goto err;
     }
-    type = dinfo->type;
 
-    switch (type) {
+    switch (dinfo->type) {
     case IF_NONE:
         monitor_printf(mon, "OK\n");
         break;
     default:
-        if (pci_drive_hot_add(mon, qdict, dinfo, type)) {
+        if (pci_drive_hot_add(mon, qdict, dinfo)) {
             goto err;
         }
     }