aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2016-11-22 07:10:58 +0100
committerStefano Stabellini <sstabellini@kernel.org>2016-11-22 10:29:39 -0800
commit3a6c9172ac5951e6dac2b3f6cbce3cfccdec5894 (patch)
treeab1ec8ce8b7246b96d7dee39f99a4dd3ef3b1559 /include/hw
parentce49b734b4e2a3cc13dc4e11742c0813f1479145 (diff)
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-<type>-<dev>" with <type> being the xen backend type (e.g. "qdisk") and <dev> the xen backend number of the type under which it is to be found in xenstore. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/xen/xen_backend.h4
-rw-r--r--include/hw/xen/xen_pvdev.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 38f730ef6e..4f4799a610 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -8,6 +8,10 @@
#define TYPE_XENSYSDEV "xen-sysdev"
#define TYPE_XENSYSBUS "xen-sysbus"
+#define TYPE_XENBACKEND "xen-backend"
+
+#define XENBACKEND_DEVICE(obj) \
+ OBJECT_CHECK(XenDevice, (obj), TYPE_XENBACKEND)
/* variables */
extern xc_interface *xen_xc;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 083f0a9cc7..d473e9b34d 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -29,6 +29,7 @@ struct XenDevOps {
};
struct XenDevice {
+ DeviceState qdev;
const char *type;
int dom;
int dev;