From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHzYP-0001y3-4A for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:52:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHzYJ-0001uz-P4 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:52:32 -0500 Received: from [199.232.76.173] (port=42496 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHzYJ-0001uq-Ee for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:52:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33708) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHzYI-0002at-Oa for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:52:27 -0500 Message-ID: <4B1E4BFA.4010207@redhat.com> Date: Tue, 08 Dec 2009 13:52:10 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [ANNOUNCE][Call-For-Testing] Release 0.12.0-rc1 of QEMU References: <4B1C3377.1020509@linux.vnet.ibm.com> <20091207183432.GW24530@redhat.com> <4B1E2D36.6030800@redhat.com> <20091208105206.GA16596@redhat.com> In-Reply-To: <20091208105206.GA16596@redhat.com> Content-Type: multipart/mixed; boundary="------------020100040501060606070105" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Anthony Liguori , "qemu-devel@nongnu.org" This is a multi-part message in MIME format. --------------020100040501060606070105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/08/09 11:52, Daniel P. Berrange wrote: > On Tue, Dec 08, 2009 at 11:40:54AM +0100, Gerd Hoffmann wrote: >> "worked" as in "guest actually sees the new device (without reboot)" or >> "worked" as in "qemu didn't abort" ? > > The latter. The guest does not see it, but it at least does not abort. > It is the 'does not abort' behaviour I'm interested in - quite OK with > this returning an error to the monitor client when acpi is disabled. Does the attached patch fix it for you? cheers, Gerd --------------020100040501060606070105 Content-Type: text/plain; name="0001-fix-pci-hotplug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-fix-pci-hotplug.patch" >>From c87a20bc8c0347770f55c8267ec10667cd2ba24c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 8 Dec 2009 13:50:16 +0100 Subject: [PATCH] fix pci hotplug Signed-off-by: Gerd Hoffmann --- hw/pci-hotplug.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 081d6d1..7e5c51d 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -40,7 +40,18 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, const char *opts_str) { QemuOpts *opts; - int ret; + PCIBus *bus; + int ret, devfn; + + bus = pci_get_bus_devfn(&devfn, devaddr); + if (!bus) { + monitor_printf(mon, "Invalid PCI device address %s\n", devaddr); + return NULL; + } + if (!((BusState*)bus)->allow_hotplug) { + monitor_printf(mon, "PCI bus doesn't support hotplug\n"); + return NULL; + } opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", NULL); if (!opts) { @@ -179,6 +190,10 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, monitor_printf(mon, "Invalid PCI device address %s\n", devaddr); return NULL; } + if (!((BusState*)bus)->allow_hotplug) { + monitor_printf(mon, "PCI bus doesn't support hotplug\n"); + return NULL; + } switch (type) { case IF_SCSI: -- 1.6.5.2 --------------020100040501060606070105--