[PATCH v3 02/13] qemu: Differentiate error codes when VM exits in qemuDomainDetectVcpuPids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some callers will need to behave differently when the detection failed
and when the VM crashed during the redetection. Return -2 if it crashed.
---

Notes:
    v3: New in series.
    
    v2: fix bugs regarding error codes from redetection

 src/qemu/qemu_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7290e3a..c4fa860 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4292,7 +4292,7 @@ qemuDomainGetVcpuPid(virDomainObjPtr vm,
  * Updates vCPU thread ids in the private data of @vm.
  *
  * Returns number of detected vCPU threads on success, -1 on error and reports
- * an appropriate error.
+ * an appropriate error, -2 if the domain doesn't exist any more.
  */
 int
 qemuDomainDetectVcpuPids(virQEMUDriverPtr driver,
@@ -4339,7 +4339,7 @@ qemuDomainDetectVcpuPids(virQEMUDriverPtr driver,
     ncpupids = qemuMonitorGetCPUInfo(priv->mon, &cpupids);
     if (qemuDomainObjExitMonitor(driver, vm) < 0) {
         VIR_FREE(cpupids);
-        return -1;
+        return -2;
     }
     /* failure to get the VCPU <-> PID mapping or to execute the query
      * command will not be treated fatal as some versions of qemu don't
-- 
2.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]