aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-14 17:14:50 +0200
committerAvi Kivity <avi@redhat.com>2009-12-14 17:14:50 +0200
commitf63802005a1158a604ca2dbef6e7e40a9c96e3bd (patch)
tree4962ef17fc668c70d8b8b8e670fb25bdbf6187c5 /hw/pci.c
parentMerge commit 'b3dfdb5a3bae5fb3170397440dfebd579a3fcb04' into stable-0.12-merge (diff)
parentmonitor: do_info_cpus(): Use QBool (diff)
downloadqemu-kvm-f63802005a1158a604ca2dbef6e7e40a9c96e3bd.tar.gz
qemu-kvm-f63802005a1158a604ca2dbef6e7e40a9c96e3bd.tar.bz2
qemu-kvm-f63802005a1158a604ca2dbef6e7e40a9c96e3bd.zip
Merge commit 'f883e4f7b8f37b53fc54660d20fd36fbe3383f46' into stable-0.12-merge
* commit 'f883e4f7b8f37b53fc54660d20fd36fbe3383f46': (63 commits) monitor: do_info_cpus(): Use QBool monitor: Fix do_info_commands() output monitor: Fix do_info_balloon() output QDict: Introduce qdict_get_qlist() QDict: Introduce qdict_get_qbool() Makefile: move QObject objs to their own entry Introduce qemu-objects.h header file vnc: fix capslock tracking logic. QemuOpts: allow larger option values. scsi: fix drive hotplug. pci: don't hw_error() when no slot is available. pci: don't abort() when trying to hotplug with acpi off. Set default console to virtio on S390x default devices: virtio consoles. add -qmp convinience switch add new -mon switch rework -monitor handling, switch to QemuOpts un-static qemu_chr_parse_compat() default devices: drives default devices: network ... Conflicts: monitor.c Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 593102449..110a5fc07 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -633,11 +633,13 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
if (!bus->devices[devfn])
goto found;
}
- hw_error("PCI: no devfn available for %s, all in use\n", name);
+ qemu_error("PCI: no devfn available for %s, all in use\n", name);
+ return NULL;
found: ;
} else if (bus->devices[devfn]) {
- hw_error("PCI: devfn %d not available for %s, in use by %s\n", devfn,
+ qemu_error("PCI: devfn %d not available for %s, in use by %s\n", devfn,
name, bus->devices[devfn]->name);
+ return NULL;
}
pci_dev->bus = bus;
pci_dev->devfn = devfn;
@@ -678,6 +680,9 @@ PCIDevice *pci_register_device(PCIBus *bus, const char *name,
pci_dev = do_pci_register_device(pci_dev, bus, name, devfn,
config_read, config_write,
PCI_HEADER_TYPE_NORMAL);
+ if (pci_dev == NULL) {
+ hw_error("PCI: can't register device\n");
+ }
return pci_dev;
}
static target_phys_addr_t pci_to_cpu_addr(target_phys_addr_t addr)
@@ -1486,6 +1491,8 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn,
info->config_read, info->config_write,
info->header_type);
+ if (pci_dev == NULL)
+ return -1;
rc = info->init(pci_dev);
if (rc != 0)
return rc;