|
@@ -40,7 +40,18 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
|
|
const char *opts_str)
|
|
const char *opts_str)
|
|
{
|
|
{
|
|
QemuOpts *opts;
|
|
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);
|
|
opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", NULL);
|
|
if (!opts) {
|
|
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);
|
|
monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
+ if (!((BusState*)bus)->allow_hotplug) {
|
|
|
|
+ monitor_printf(mon, "PCI bus doesn't support hotplug\n");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
|
|
switch (type) {
|
|
switch (type) {
|
|
case IF_SCSI:
|
|
case IF_SCSI:
|