[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 35/36] qdev: drop legacy hotplug fields/methods
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v2 35/36] qdev: drop legacy hotplug fields/methods |
Date: |
Fri, 26 Sep 2014 09:28:40 +0000 |
It removes not needed anymore BusState.allow_hotplug field and
DeviceClass.unplug callback.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
hw/core/qdev.c | 16 +++-------------
include/hw/qdev-core.h | 5 +----
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index fa86843..bc45a59 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -114,7 +114,6 @@ static void qbus_set_hotplug_handler_internal(BusState
*bus, Object *handler,
object_property_set_link(OBJECT(bus), OBJECT(handler),
QDEV_HOTPLUG_HANDLER_PROPERTY, errp);
- bus->allow_hotplug = 1;
}
void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler, Error
**errp)
@@ -254,10 +253,7 @@ void qdev_unplug(DeviceState *dev, Error **errp)
hotplug_handler_unplug(dev->parent_bus->hotplug_handler, dev,
errp);
}
} else {
- assert(dc->unplug != NULL);
- if (dc->unplug(dev) < 0) { /* legacy handler */
- error_set(errp, QERR_UNDEFINED_ERROR);
- }
+ assert(0);
}
}
@@ -294,17 +290,11 @@ void qbus_reset_all_fn(void *opaque)
}
/* can be used as ->unplug() callback for the simple cases */
-int qdev_simple_unplug_cb(DeviceState *dev)
-{
- /* just zap it */
- object_unparent(OBJECT(dev));
- return 0;
-}
-
void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
- qdev_simple_unplug_cb(dev);
+ /* just zap it */
+ object_unparent(OBJECT(dev));
}
/* Like qdev_init(), but terminate program via error_report() instead of
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 48e9579..01d7db4 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -126,7 +126,6 @@ typedef struct DeviceClass {
/* Private to qdev / bus. */
qdev_initfn init; /* TODO remove, once users are converted to realize */
- qdev_event unplug;
qdev_event exit; /* TODO remove, once users are converted to unrealize */
const char *bus_type;
} DeviceClass;
@@ -210,7 +209,6 @@ struct BusState {
Object obj;
DeviceState *parent;
const char *name;
- int allow_hotplug;
HotplugHandler *hotplug_handler;
int max_index;
bool realized;
@@ -264,7 +262,6 @@ void qdev_init_nofail(DeviceState *dev);
void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
int required_for_version);
void qdev_unplug(DeviceState *dev, Error **errp);
-int qdev_simple_unplug_cb(DeviceState *dev);
void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp);
void qdev_machine_creation_done(void);
@@ -370,6 +367,6 @@ void qbus_set_bus_hotplug_handler(BusState *bus, Error
**errp);
static inline bool qbus_is_hotpluggable(BusState *bus)
{
- return bus->allow_hotplug || bus->hotplug_handler;
+ return bus->hotplug_handler;
}
#endif
--
1.8.3.1
- Re: [Qemu-devel] [PATCH v4 24/36] s390x: convert s390-virtio to hotplug handler API, (continued)
- [Qemu-devel] [PATCH v2 25/36] s390x: convert virtio-ccw to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 26/36] scsi: set SCSI BUS itself as default HotplugHandler, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 31/36] usb-bot: drop not needed "allow_hotplug = 0", Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 33/36] usb: convert usb-ccid to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 32/36] usb-storage: drop not needed "allow_hotplug = 0", Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 34/36] usb: convert usb devices to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 11/36] test: usb: usb-uas hotplug test, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 36/36] qdev: HotplugHandler: add support for unplugging BUS-less devices, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 35/36] qdev: drop legacy hotplug fields/methods,
Igor Mammedov <=
- [Qemu-devel] [PATCH v2 19/36] target-i386: ICC bus: drop BusState.allow_hotplug, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 28/36] scsi: convert virtio-scsi HBA to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 30/36] usb-bot: mark device as non hotpluggable, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 27/36] scsi: convert pvscsi HBA to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 29/36] scsi: cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields, Igor Mammedov, 2014/09/26
- Re: [Qemu-devel] [PATCH v2 00/36] complete conversion to hotplug-handler API, Cornelia Huck, 2014/09/26
- Re: [Qemu-devel] [PATCH v2 00/36] complete conversion to hotplug-handler API, Paolo Bonzini, 2014/09/26
- Re: [Qemu-devel] [PATCH v2 00/36] complete conversion to hotplug-handler API, Gerd Hoffmann, 2014/09/29
- Re: [Qemu-devel] [PATCH v2 00/36] complete conversion to hotplug-handler API, Michael S. Tsirkin, 2014/09/29