@@ -1620,6 +1620,11 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo 
*base)
                                       info->is_bridge);
      if (pci_dev == NULL)
          return -1;
+    if (qdev->hotplugged&&  info->no_hotplug) {
+        qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name);
+        do_pci_unregister_device(pci_dev);
+        return -1;
+    }

Any particular reason for not check this before
do_pci_register_device()?

Don't remember, probably not. I think can could be moved up (and loose the unregister call) and behavior will not change.

cheers,
  Gerd


Reply via email to