[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [FOR 0.12 PATCH 1/4] pci: don't abort() when trying to hotp
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [FOR 0.12 PATCH 1/4] pci: don't abort() when trying to hotplug with acpi off. |
Date: |
Thu, 10 Dec 2009 11:11:05 +0100 |
The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI
also disables hotplug for the PCI bus. This patch makes qemu check
whenever the PCI bus in question can handle hotplug before trying to add
devices. This is needed because qdev will abort() on any attempt to
hotplug devices into a non-hotpluggable bus.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
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
- [Qemu-devel] [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., (continued)
- [Qemu-devel] [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gerd Hoffmann, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gerd Hoffmann, 2009/12/10
- [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/10
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Michael S. Tsirkin, 2009/12/11
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Gleb Natapov, 2009/12/11
- Re: [Qemu-devel] Re: [FOR 0.12 PATCH 2/4] pci: don't hw_error() when no slot is available., Alexander Graf, 2009/12/10
[Qemu-devel] [FOR 0.12 PATCH 1/4] pci: don't abort() when trying to hotplug with acpi off.,
Gerd Hoffmann <=
[Qemu-devel] [FOR 0.12 PATCH 3/4] scsi: fix drive hotplug., Gerd Hoffmann, 2009/12/10
[Qemu-devel] [FOR 0.12 PATCH 4/4] QemuOpts: allow larger option values., Gerd Hoffmann, 2009/12/10
[Qemu-devel] Re: [FOR 0.12 PATCH 0/4] misc bugfixes, Michael S. Tsirkin, 2009/12/10