diff options
author | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2011-02-25 17:15:20 +0000 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2011-02-25 17:15:20 +0000 |
commit | 70628d024da42eea2de68939743c2c00d3a95a7d (patch) | |
tree | 2bcfacc14175f4bd8f9e09f99c773ab63be255c5 /tools/libxl/libxl_internal.h | |
parent | 67743d23a8c4585e41b73e9d93fd237d2fbe1236 (diff) | |
download | xen-70628d024da42eea2de68939743c2c00d3a95a7d.tar.gz xen-70628d024da42eea2de68939743c2c00d3a95a7d.tar.bz2 xen-70628d024da42eea2de68939743c2c00d3a95a7d.zip |
libxl: Multi-device passthrough coldplug: do not wait for unstarted guest
When doing a PCI passthrough, the code checks to see whether there is
an existing backend directory in xenstore with a nonzero "num_devs".
If there isn't, it creates the backend directory with just the
required device.
If there is, it would assume that it was doing hotplug. If doing
hotplug, it needs to set the "state" node in xenstore to "7"
(reconfiguring) and thus avoid racing with the backend needs to wait
for the backend to be "4" (connected).
However during guest creation, the presence of "num_devs" doesn't
necessarily mean hotplug. If we are still creating the initial
xenstore setup (ie, adding devices as a subroutine of domain
creation), we can just write the new devices to xenstore. So do that.
This involves adding a new parameter "starting", indicating that we
are still in domain creation, to libxl_device_pci_add_xenstore (a
misnamed internal function) and its callers. Its callers include
libxl_device_pci_add which we therefore split into an internal version
with the new parameter, and an external version used only for hotplug
by libxl-using applications.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_internal.h')
-rw-r--r-- | tools/libxl/libxl_internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index bc6dfa7d49..277b04cc1f 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -200,6 +200,10 @@ _hidden int libxl__wait_for_device_model(libxl_ctx *ctx, void *check_callback_userdata); _hidden int libxl__wait_for_backend(libxl_ctx *ctx, char *be_path, char *state); +/* from libxl_pci */ + +_hidden int libxl__device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev, int starting); + /* xl_exec */ /* higher-level double-fork and separate detach eg as for device models */ |