diff mbox

[RFC,v1,1/2] qdev-monitor.c: Register reset function if the device has one

Message ID f5112168b8a81409653a01668f78570a8e919db9.1452902914.git.alistair.francis@xilinx.com
State New
Headers show

Commit Message

Alistair Francis Jan. 16, 2016, 12:19 a.m. UTC
If the device being added when running qdev_device_add() has
a reset function, register it so that it can be called.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---

 qdev-monitor.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 3ce4710..8e43074 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -560,6 +560,8 @@  DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
 
     if (bus) {
         qdev_set_parent_bus(dev, bus);
+    } else if (dc->reset) {
+        qemu_register_reset((void (*)(void *))dc->reset, dev);
     }
 
     id = qemu_opts_id(opts);