[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 6/7] qdev: remove DeviceClass::exit
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 6/7] qdev: remove DeviceClass::exit |
Date: |
Mon, 22 Jan 2018 09:03:50 -0300 |
it has no users.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/qdev-core.h | 2 --
hw/core/qdev.c | 14 --------------
2 files changed, 16 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index fd386b5d49..0bcba3b785 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -30,7 +30,6 @@ typedef enum DeviceCategory {
DEVICE_CATEGORY_MAX
} DeviceCategory;
-typedef int (*qdev_event)(DeviceState *dev);
typedef void (*qdev_resetfn)(DeviceState *dev);
typedef void (*DeviceRealize)(DeviceState *dev, Error **errp);
typedef void (*DeviceUnrealize)(DeviceState *dev, Error **errp);
@@ -124,7 +123,6 @@ typedef struct DeviceClass {
const struct VMStateDescription *vmsd;
/* Private to qdev / bus. */
- qdev_event exit; /* TODO remove, once users are converted to unrealize */
const char *bus_type;
} DeviceClass;
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 1a985a511e..0ee86d2db8 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -219,19 +219,6 @@ void device_listener_unregister(DeviceListener *listener)
QTAILQ_REMOVE(&device_listeners, listener, link);
}
-static void device_unrealize(DeviceState *dev, Error **errp)
-{
- DeviceClass *dc = DEVICE_GET_CLASS(dev);
-
- if (dc->exit) {
- int rc = dc->exit(dev);
- if (rc < 0) {
- error_setg(errp, "Device exit failed.");
- return;
- }
- }
-}
-
void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
int required_for_version)
{
@@ -1126,7 +1113,6 @@ static void device_class_init(ObjectClass *class, void
*data)
DeviceClass *dc = DEVICE_CLASS(class);
class->unparent = device_unparent;
- dc->unrealize = device_unrealize;
/* by default all devices were considered as hotpluggable,
* so with intent to check it in generic qdev_unplug() /
--
2.15.1
- [Qemu-devel] [PATCH v2 0/7] qdev: remove DeviceClass::init/exit(), Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 1/7] hw/i2c/smbus: use DeviceClass::realize instead of SMBusDeviceClass::init, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 2/7] hw/i2c: use DeviceClass::realize instead of I2CSlaveClass::init, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 5/7] qdev: simplify the SysBusDeviceClass::init path, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 3/7] usb-ccid: convert CCIDCardClass::init -> realize, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 4/7] virtio-ccw: convert VirtIOCCWDeviceClass::exit -> unrealize, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 7/7] qdev: rename typedef qdev_resetfn() -> DeviceReset(), Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v2 6/7] qdev: remove DeviceClass::exit,
Philippe Mathieu-Daudé <=
- Re: [Qemu-devel] [PATCH v2 0/7] qdev: remove DeviceClass::init/exit(), Markus Armbruster, 2018/01/31