[libvirt] [PATCH 05/10] qemu: domain: Rename qemuDomainDetectVcpuPids to qemuDomainRefreshVcpuInfo

Peter Krempa pkrempa at redhat.com
Wed Aug 3 08:10:57 UTC 2016


The function will eventually do more useful stuff than just detection of
thread ids.
---
 src/qemu/qemu_domain.c  | 10 +++++-----
 src/qemu/qemu_domain.h  |  5 +++--
 src/qemu/qemu_driver.c  |  4 ++--
 src/qemu/qemu_process.c |  6 +++---
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index efc1fb5..5cde841 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5624,20 +5624,20 @@ qemuDomainGetVcpuPid(virDomainObjPtr vm,


 /**
- * qemuDomainDetectVcpuPids:
+ * qemuDomainRefreshVcpuInfo:
  * @driver: qemu driver data
  * @vm: domain object
  * @asyncJob: current asynchronous job type
  *
- * Updates vCPU thread ids in the private data of @vm.
+ * Updates vCPU information private data of @vm.
  *
  * Returns number of detected vCPU threads on success, -1 on error and reports
  * an appropriate error, -2 if the domain doesn't exist any more.
  */
 int
-qemuDomainDetectVcpuPids(virQEMUDriverPtr driver,
-                         virDomainObjPtr vm,
-                         int asyncJob)
+qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
+                          virDomainObjPtr vm,
+                          int asyncJob)
 {
     virDomainVcpuDefPtr vcpu;
     size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 9e10ae4..3193427 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -647,8 +647,9 @@ int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,

 bool qemuDomainHasVcpuPids(virDomainObjPtr vm);
 pid_t qemuDomainGetVcpuPid(virDomainObjPtr vm, unsigned int vcpuid);
-int qemuDomainDetectVcpuPids(virQEMUDriverPtr driver, virDomainObjPtr vm,
-                             int asyncJob);
+int qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
+                              virDomainObjPtr vm,
+                              int asyncJob);

 bool qemuDomainSupportsNicdev(virDomainDefPtr def,
                               virDomainNetDefPtr net);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 061c16f..453572b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4639,7 +4639,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,

     vcpuinfo->online = true;

-    if ((rc = qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE)) <= 0) {
+    if ((rc = qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE)) <= 0) {
         /* vcpu pids were not detected, skip setting of affinity */
         if (rc == 0)
             ret = 0;
@@ -4689,7 +4689,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
         goto cleanup;
     }

-    if ((rc = qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE)) < 0) {
+    if ((rc = qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE)) < 0) {
         /* rollback only if domain didn't exit */
         if (rc == -2)
             goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a4935d2..9136ba5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5189,8 +5189,8 @@ qemuProcessLaunch(virConnectPtr conn,
     if (qemuSetupCpusetMems(vm) < 0)
         goto cleanup;

-    VIR_DEBUG("Detecting VCPU PIDs");
-    if (qemuDomainDetectVcpuPids(driver, vm, asyncJob) < 0)
+    VIR_DEBUG("Refreshing VCPU info");
+    if (qemuDomainRefreshVcpuInfo(driver, vm, asyncJob) < 0)
         goto cleanup;

     VIR_DEBUG("Detecting IOThread PIDs");
@@ -5982,7 +5982,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
     }

     VIR_DEBUG("Detecting VCPU PIDs");
-    if (qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+    if (qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
         goto error;

     VIR_DEBUG("Detecting IOThread PIDs");
-- 
2.9.2




More information about the libvir-list mailing list