aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_pci.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-10-18 13:36:42 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-10-18 13:36:42 +0100
commitaec4680fb168930d8e3ceb31e7ecb34f36571aa7 (patch)
tree507f931370652ae836c4c3571d1e79da3a27a021 /tools/libxl/libxl_pci.c
parent9d76e3ae60d8ddbe33e9dcccc6e0cd5a04309341 (diff)
downloadxen-aec4680fb168930d8e3ceb31e7ecb34f36571aa7.tar.gz
xen-aec4680fb168930d8e3ceb31e7ecb34f36571aa7.tar.bz2
xen-aec4680fb168930d8e3ceb31e7ecb34f36571aa7.zip
libxl: use libxl__device in libxl_devices_destroy etc.
Use libxl__device in libxl_devices_destroy and libxl__device_pci_remove_xenstore. Doing this allows us to use the common functions for removing devices. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_pci.c')
-rw-r--r--tools/libxl/libxl_pci.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 84676f4d4f..843d975e6e 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -410,9 +410,15 @@ retry_transaction2:
goto retry_transaction2;
if (num == 1) {
- char *fe_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend", be_path));
- xs_rm(ctx->xsh, XBT_NULL, be_path);
- xs_rm(ctx->xsh, XBT_NULL, fe_path);
+ libxl__device dev;
+ if (libxl__parse_backend_path(gc, be_path, &dev) != 0)
+ return ERROR_FAIL;
+
+ dev.domid = domid;
+ dev.kind = LIBXL__DEVICE_KIND_PCI;
+ dev.devid = 0;
+
+ libxl__device_destroy(gc, &dev);
return 0;
}