From patchwork Mon Dec 7 20:51:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 40546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A328EB7093 for ; Tue, 8 Dec 2009 08:42:50 +1100 (EST) Received: from localhost ([127.0.0.1]:56751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHlLz-0000RN-EI for incoming@patchwork.ozlabs.org; Mon, 07 Dec 2009 16:42:47 -0500 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 Received: from localhost.localdomain (vpn2-9-11.ams2.redhat.com [10.36.9.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB7KptBP014430; Mon, 7 Dec 2009 15:51:56 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Mon, 7 Dec 2009 20:51:49 +0000 Message-Id: <1260219109-14380-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] Fix backcompat for hotplug of SCSI controllers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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;