aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_pci.c
diff options
context:
space:
mode:
authorShriram Rajagopalan <rshriram@cs.ubc.ca>2012-02-09 18:07:48 +0000
committerShriram Rajagopalan <rshriram@cs.ubc.ca>2012-02-09 18:07:48 +0000
commit0cb90b3184ebb05738ee1204e293c5fb265c507f (patch)
tree102515d48f15bb6757cd2b079631973918d28d51 /tools/libxl/libxl_pci.c
parent490d431f99d32c2c700513b59f816729cfa1c1af (diff)
downloadxen-0cb90b3184ebb05738ee1204e293c5fb265c507f.tar.gz
xen-0cb90b3184ebb05738ee1204e293c5fb265c507f.tar.bz2
xen-0cb90b3184ebb05738ee1204e293c5fb265c507f.zip
libxl: helper function to send commands to traditional qemu
Introduce a helper function to send commands to traditional qemu. qemu_pci_add_xenstore, qemu_pci_remove_xenstore, libxl__domain_save_device_model and libxl_domain_unpause have been refactored to use this function. Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_pci.c')
-rw-r--r--tools/libxl/libxl_pci.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 99591c27ee..33425f5fe9 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -602,9 +602,8 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
libxl__xs_write(gc, XBT_NULL, path, PCI_BDF, pcidev->domain,
pcidev->bus, pcidev->dev, pcidev->func);
}
- path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/command",
- domid);
- xs_write(ctx->xsh, XBT_NULL, path, "pci-ins", strlen("pci-ins"));
+
+ libxl__qemu_traditional_cmd(gc, domid, "pci-ins");
rc = libxl__wait_for_device_model(gc, domid, NULL, NULL,
pci_ins_check, state);
path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/parameter",
@@ -857,12 +856,11 @@ static int qemu_pci_remove_xenstore(libxl__gc *gc, uint32_t domid,
path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/parameter", domid);
libxl__xs_write(gc, XBT_NULL, path, PCI_BDF, pcidev->domain,
pcidev->bus, pcidev->dev, pcidev->func);
- path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/command", domid);
/* Remove all functions at once atomically by only signalling
* device-model for function 0 */
if ( !force && (pcidev->vdevfn & 0x7) == 0 ) {
- xs_write(ctx->xsh, XBT_NULL, path, "pci-rem", strlen("pci-rem"));
+ libxl__qemu_traditional_cmd(gc, domid, "pci-rem");
if (libxl__wait_for_device_model(gc, domid, "pci-removed",
NULL, NULL, NULL) < 0) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in time");