From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHkYx-0006ha-4p for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:52:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHkYp-0006Vv-Ip for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:52:03 -0500 Received: from [199.232.76.173] (port=56389 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHkYp-0006Vb-61 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:51:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28371) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHkYo-0003Jn-Ho for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:51:58 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB7Kpvom030724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Dec 2009 15:51:57 -0500 From: "Daniel P. Berrange" Date: Mon, 7 Dec 2009 20:51:49 +0000 Message-Id: <1260219109-14380-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH] Fix backcompat for hotplug of SCSI controllers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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; -- 1.6.5.2