From patchwork Mon Dec 7 20:51:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix backcompat for hotplug of SCSI controllers Date: Mon, 07 Dec 2009 10:51:49 -0000 From: "Daniel P. Berrange" X-Patchwork-Id: 40546 Message-Id: <1260219109-14380-1-git-send-email-berrange@redhat.com> To: qemu-devel@nongnu.org Cc: SCSI controllers have no trouble existing without any attached disks. This could be achieved with the (legacy) monitor syntax pci_add pci_addr=auto storage if=scsi This is now denied with scsi requires a backing file/device. failed to add if=scsi There is no need for this denial and it breaks compatability with existing QEMU usage, so remove the check for presence of a drive. Signed-off-by: Daniel P. Berrange --- hw/pci-hotplug.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 081d6d1..616435a 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -182,14 +182,10 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, switch (type) { case IF_SCSI: - if (!dinfo) { - monitor_printf(mon, "scsi requires a backing file/device.\n"); - return NULL; - } dev = pci_create(bus, devfn, "lsi53c895a"); if (qdev_init(&dev->qdev) < 0) dev = NULL; - if (dev) { + if (dev && dinfo) { if (scsi_hot_add(&dev->qdev, dinfo, 0) != 0) { qdev_unplug(&dev->qdev); dev = NULL;