qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 18/47] qdev: do not allow to instantiate non hotplugg


From: Andreas Färber
Subject: [Qemu-devel] [PULL 18/47] qdev: do not allow to instantiate non hotpluggable device with device_add
Date: Wed, 15 Oct 2014 05:08:52 +0200

From: Igor Mammedov <address@hidden>

It will allow explicitly mark device as not hotpluggable and
avoid its creation with following error at realize time
and destroying it afterwards anyway. Instead of it will
error out even before instance of device is created.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 qdev-monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index f6db461..c721451 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -487,7 +487,8 @@ DeviceState *qdev_device_add(QemuOpts *opts)
     }
 
     dc = DEVICE_CLASS(oc);
-    if (dc->cannot_instantiate_with_device_add_yet) {
+    if (dc->cannot_instantiate_with_device_add_yet ||
+        (qdev_hotplug && !dc->hotpluggable)) {
         qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver",
                       "pluggable device type");
         return NULL;
-- 
1.8.4.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]