Revision 53e0d8af hw/pci-hotplug.c

b/hw/pci-hotplug.c
40 40
                                       const char *opts_str)
41 41
{
42 42
    QemuOpts *opts;
43
    int ret;
43
    PCIBus *bus;
44
    int ret, devfn;
45

  
46
    bus = pci_get_bus_devfn(&devfn, devaddr);
47
    if (!bus) {
48
        monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
49
        return NULL;
50
    }
51
    if (!((BusState*)bus)->allow_hotplug) {
52
        monitor_printf(mon, "PCI bus doesn't support hotplug\n");
53
        return NULL;
54
    }
44 55

  
45 56
    opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", NULL);
46 57
    if (!opts) {
......
179 190
        monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
180 191
        return NULL;
181 192
    }
193
    if (!((BusState*)bus)->allow_hotplug) {
194
        monitor_printf(mon, "PCI bus doesn't support hotplug\n");
195
        return NULL;
196
    }
182 197

  
183 198
    switch (type) {
184 199
    case IF_SCSI:

Also available in: Unified diff