diff options
author | Paul Durrant <paul.durrant@citrix.com> | 2017-03-07 10:55:34 +0000 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2017-04-21 12:39:43 -0700 |
commit | d655f34e6d6a68f64e885fa85295e0c7a31ce846 (patch) | |
tree | 90db64187c368826c60bd66890632b7b9728b50d /xen-common.c | |
parent | da8090ccb7735aed5a46ce27dfbe8486cfce61f5 (diff) |
xen: use libxendevicemodel when available
This patch modifies the wrapper functions in xen_common.h to use the
new xendevicemodel interface if it is available along with compatibility
code to use the old libxenctrl interface if it is not.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Anthony Perard <anthony.perard@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'xen-common.c')
-rw-r--r-- | xen-common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xen-common.c b/xen-common.c index 703e7a5861..ae76150e8a 100644 --- a/xen-common.c +++ b/xen-common.c @@ -27,6 +27,7 @@ xc_interface *xen_xc; xenforeignmemory_handle *xen_fmem; +xendevicemodel_handle *xen_dmod; static int store_dev_info(int domid, Chardev *cs, const char *string) { @@ -128,6 +129,13 @@ static int xen_init(MachineState *ms) xc_interface_close(xen_xc); return -1; } + xen_dmod = xendevicemodel_open(0, 0); + if (xen_dmod == NULL) { + xen_pv_printf(NULL, 0, "can't open xen devicemodel interface\n"); + xenforeignmemory_close(xen_fmem); + xc_interface_close(xen_xc); + return -1; + } qemu_add_vm_change_state_handler(xen_change_state_handler, NULL); global_state_set_optional(); |