aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-08-23 06:12:54 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-08-23 06:12:54 +0000
commit7432ff5d6b70b58d6d3d9417cf87d2fe9ba2ce6c (patch)
tree33eb51397211d6f69195aa1e9efd1af47486e682
parent9c9c310a5494848a11802dd6bd34ecf35046d771 (diff)
Rearrange to suppress gcc 3.3.5 warning about unused variable
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--hw/pci-hotplug.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 4da916cca1..1f92e09f87 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -125,9 +125,8 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
monitor_printf(mon, "Parameter addr not supported\n");
return NULL;
}
- } else if (type == IF_VIRTIO) {
- monitor_printf(mon, "virtio requires a backing file/device.\n");
- return NULL;
+ } else {
+ dinfo = NULL;
}
switch (type) {
@@ -135,6 +134,10 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
dev = pci_create("lsi53c895a", devaddr);
break;
case IF_VIRTIO:
+ if (!dinfo) {
+ monitor_printf(mon, "virtio requires a backing file/device.\n");
+ return NULL;
+ }
dev = pci_create("virtio-blk-pci", devaddr);
qdev_prop_set_drive(&dev->qdev, "drive", dinfo);
break;