mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
xen: add an own bus for xen backend devices
Add a bus for Xen backend devices in order to be able to establish a dedicated device path for pluggable devices. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
parent
b85f9dfdb1
commit
873d57abba
2 changed files with 20 additions and 3 deletions
|
@ -29,14 +29,14 @@
|
|||
#include "hw/sysbus.h"
|
||||
#include "sysemu/char.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/xen/xen_backend.h"
|
||||
#include "hw/xen/xen_pvdev.h"
|
||||
|
||||
#include <xen/grant_table.h>
|
||||
|
||||
#define TYPE_XENSYSDEV "xensysdev"
|
||||
|
||||
DeviceState *xen_sysdev;
|
||||
BusState *xen_sysbus;
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
|
@ -528,6 +528,8 @@ int xen_be_init(void)
|
|||
|
||||
xen_sysdev = qdev_create(NULL, TYPE_XENSYSDEV);
|
||||
qdev_init_nofail(xen_sysdev);
|
||||
xen_sysbus = qbus_create(TYPE_XENSYSBUS, DEVICE(xen_sysdev), "xen-sysbus");
|
||||
qbus_set_bus_hotplug_handler(xen_sysbus, &error_abort);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -586,6 +588,15 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
|
|||
}
|
||||
|
||||
|
||||
static const TypeInfo xensysbus_info = {
|
||||
.name = TYPE_XENSYSBUS,
|
||||
.parent = TYPE_BUS,
|
||||
.interfaces = (InterfaceInfo[]) {
|
||||
{ TYPE_HOTPLUG_HANDLER },
|
||||
{ }
|
||||
}
|
||||
};
|
||||
|
||||
static int xen_sysdev_init(SysBusDevice *dev)
|
||||
{
|
||||
return 0;
|
||||
|
@ -602,6 +613,7 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data)
|
|||
|
||||
k->init = xen_sysdev_init;
|
||||
dc->props = xen_sysdev_properties;
|
||||
dc->bus_type = TYPE_XENSYSBUS;
|
||||
}
|
||||
|
||||
static const TypeInfo xensysdev_info = {
|
||||
|
@ -613,7 +625,8 @@ static const TypeInfo xensysdev_info = {
|
|||
|
||||
static void xenbe_register_types(void)
|
||||
{
|
||||
type_register_static(&xensysbus_info);
|
||||
type_register_static(&xensysdev_info);
|
||||
}
|
||||
|
||||
type_init(xenbe_register_types);
|
||||
type_init(xenbe_register_types)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue