aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_pci.c
diff options
context:
space:
mode:
authorMarek Marczykowski <marmarek@mimuw.edu.pl>2011-06-21 17:50:47 +0100
committerMarek Marczykowski <marmarek@mimuw.edu.pl>2011-06-21 17:50:47 +0100
commitb6c23c86fe5a1a027d9e173d9cba7e89c8eb2d67 (patch)
tree8d0bf0e89312cad87fb950481e90033e282f9f4f /tools/libxl/libxl_pci.c
parent1f2591ba3532ccc1118bf93e59fd64541c6897c3 (diff)
downloadxen-b6c23c86fe5a1a027d9e173d9cba7e89c8eb2d67.tar.gz
xen-b6c23c86fe5a1a027d9e173d9cba7e89c8eb2d67.tar.bz2
xen-b6c23c86fe5a1a027d9e173d9cba7e89c8eb2d67.zip
libxl: add all pci devices to xenstore at once (during VM create)
When adding pci devices one by one, pciback notice only the first one. For every next, "state" is left as is (usualy "4" in that time), so backend will not rescan xenstore. So when VM is starting all devices should be added at once and then backend can initialize it. This applies only to pci, because only pci backend have one xenstore dir for multiple devices. Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl> Signed-off-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, 6 insertions, 2 deletions
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 307ca2376b..8d2c4d19a3 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -221,7 +221,8 @@ static void libxl_create_pci_backend_device(libxl__gc *gc, flexarray_t *back, in
flexarray_append_pair(back, libxl__sprintf(gc, "state-%d", num), libxl__sprintf(gc, "%d", 1));
}
-static int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int num)
+int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
+ libxl_device_pci *pcidev, int num)
{
libxl_ctx *ctx = libxl__gc_owner(gc);
flexarray_t *front = NULL;
@@ -707,7 +708,10 @@ out:
}
}
- rc = libxl__device_pci_add_xenstore(gc, domid, pcidev, starting);
+ if (!starting)
+ rc = libxl__device_pci_add_xenstore(gc, domid, pcidev, starting);
+ else
+ rc = 0;
return rc;
}