[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] libxl_pci: Only check if qemu-dm is running in qemu-trad case
commit b6b69029d78c749ad9ca8d10e820027b7eb30485 Author: Anthony PERARD <anthony.perard@xxxxxxxxxx> AuthorDate: Tue Jul 30 15:56:30 2019 +0100 Commit: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> CommitDate: Fri Sep 20 10:42:43 2019 +0100 libxl_pci: Only check if qemu-dm is running in qemu-trad case QEMU upstream (or qemu-xen) may not have set "running" state in xenstore. "running" with QEMU doesn't mean that the binary is running, it means that the emulation have started. When adding a pci-passthrough device to QEMU, we do so via QMP, we have a direct answer to whether QEMU is running or not, no need to check ahead. Moving the check to do it only with qemu-trad makes upcoming changes simpler. Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libxl/libxl_pci.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index b9ca69f5f0..071880b855 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1004,13 +1004,13 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, if (type == LIBXL_DOMAIN_TYPE_HVM) { hvm = 1; - if (libxl__wait_for_device_model_deprecated(gc, domid, "running", - NULL, NULL, NULL) < 0) { - rc = ERROR_FAIL; - goto out; - } switch (libxl__device_model_version_running(gc, domid)) { case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + if (libxl__wait_for_device_model_deprecated(gc, domid, + "running", NULL, NULL, NULL) < 0) { + rc = ERROR_FAIL; + goto out; + } rc = qemu_pci_add_xenstore(gc, domid, pcidev); break; case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: @@ -1395,12 +1395,11 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, rc = ERROR_FAIL; if (type == LIBXL_DOMAIN_TYPE_HVM) { hvm = 1; - if (libxl__wait_for_device_model_deprecated(gc, domid, "running", - NULL, NULL, NULL) < 0) - goto out_fail; - switch (libxl__device_model_version_running(gc, domid)) { case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + if (libxl__wait_for_device_model_deprecated(gc, domid, + "running", NULL, NULL, NULL) < 0) + goto out_fail; rc = qemu_pci_remove_xenstore(gc, domid, pcidev, force); break; case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |