From 3a6c9172ac5951e6dac2b3f6cbce3cfccdec5894 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Tue, 22 Nov 2016 07:10:58 +0100 Subject: xen: create qdev for each backend device Create a qdev plugged to the xen-sysbus for each new backend device. This device can be used as a parent for all needed devices of that backend. The id of the new device will be "xen--" with being the xen backend type (e.g. "qdisk") and the xen backend number of the type under which it is to be found in xenstore. Signed-off-by: Juergen Gross Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- hw/xen/xen_pvdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/xen/xen_pvdev.c') diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 5212bc6d9e..aed783e844 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "hw/qdev-core.h" #include "hw/xen/xen_backend.h" #include "hw/xen/xen_pvdev.h" @@ -307,7 +308,8 @@ void xen_pv_del_xendev(struct XenDevice *xendev) } QTAILQ_REMOVE(&xendevs, xendev, next); - g_free(xendev); + + qdev_unplug(&xendev->qdev, NULL); } void xen_pv_insert_xendev(struct XenDevice *xendev) -- cgit v1.2.3