render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
6ae9ed
From b41d5d32d7d34a4e4de359cdb9725f0ab8c97a0e Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <b41d5d32d7d34a4e4de359cdb9725f0ab8c97a0e@dist-git>
6ae9ed
From: Peter Krempa <pkrempa@redhat.com>
6ae9ed
Date: Wed, 24 Aug 2016 16:11:06 -0400
6ae9ed
Subject: [PATCH] qemu: domain: Rename qemuDomainDetectVcpuPids to
6ae9ed
 qemuDomainRefreshVcpuInfo
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1097930
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1224341
6ae9ed
6ae9ed
The function will eventually do more useful stuff than just detection of
6ae9ed
thread ids.
6ae9ed
6ae9ed
(cherry picked from commit 8f56b5baaf8c743a10412e1f1df915b3140b0019)
6ae9ed
---
6ae9ed
 src/qemu/qemu_domain.c  | 10 +++++-----
6ae9ed
 src/qemu/qemu_domain.h  |  5 +++--
6ae9ed
 src/qemu/qemu_driver.c  |  4 ++--
6ae9ed
 src/qemu/qemu_process.c |  6 +++---
6ae9ed
 4 files changed, 13 insertions(+), 12 deletions(-)
6ae9ed
6ae9ed
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
6ae9ed
index 1148b52..93dd3f6 100644
6ae9ed
--- a/src/qemu/qemu_domain.c
6ae9ed
+++ b/src/qemu/qemu_domain.c
6ae9ed
@@ -5629,20 +5629,20 @@ qemuDomainGetVcpuPid(virDomainObjPtr vm,
6ae9ed
 
6ae9ed
 
6ae9ed
 /**
6ae9ed
- * qemuDomainDetectVcpuPids:
6ae9ed
+ * qemuDomainRefreshVcpuInfo:
6ae9ed
  * @driver: qemu driver data
6ae9ed
  * @vm: domain object
6ae9ed
  * @asyncJob: current asynchronous job type
6ae9ed
  *
6ae9ed
- * Updates vCPU thread ids in the private data of @vm.
6ae9ed
+ * Updates vCPU information private data of @vm.
6ae9ed
  *
6ae9ed
  * Returns number of detected vCPU threads on success, -1 on error and reports
6ae9ed
  * an appropriate error, -2 if the domain doesn't exist any more.
6ae9ed
  */
6ae9ed
 int
6ae9ed
-qemuDomainDetectVcpuPids(virQEMUDriverPtr driver,
6ae9ed
-                         virDomainObjPtr vm,
6ae9ed
-                         int asyncJob)
6ae9ed
+qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
6ae9ed
+                          virDomainObjPtr vm,
6ae9ed
+                          int asyncJob)
6ae9ed
 {
6ae9ed
     virDomainVcpuDefPtr vcpu;
6ae9ed
     size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
6ae9ed
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
6ae9ed
index 06c3fc2..be61535 100644
6ae9ed
--- a/src/qemu/qemu_domain.h
6ae9ed
+++ b/src/qemu/qemu_domain.h
6ae9ed
@@ -649,8 +649,9 @@ int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
6ae9ed
 
6ae9ed
 bool qemuDomainHasVcpuPids(virDomainObjPtr vm);
6ae9ed
 pid_t qemuDomainGetVcpuPid(virDomainObjPtr vm, unsigned int vcpuid);
6ae9ed
-int qemuDomainDetectVcpuPids(virQEMUDriverPtr driver, virDomainObjPtr vm,
6ae9ed
-                             int asyncJob);
6ae9ed
+int qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
6ae9ed
+                              virDomainObjPtr vm,
6ae9ed
+                              int asyncJob);
6ae9ed
 
6ae9ed
 bool qemuDomainSupportsNicdev(virDomainDefPtr def,
6ae9ed
                               virDomainNetDefPtr net);
6ae9ed
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
6ae9ed
index 57ca522..040c638 100644
6ae9ed
--- a/src/qemu/qemu_driver.c
6ae9ed
+++ b/src/qemu/qemu_driver.c
6ae9ed
@@ -4645,7 +4645,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,
6ae9ed
 
6ae9ed
     vcpuinfo->online = true;
6ae9ed
 
6ae9ed
-    if ((rc = qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE)) <= 0) {
6ae9ed
+    if ((rc = qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE)) <= 0) {
6ae9ed
         /* vcpu pids were not detected, skip setting of affinity */
6ae9ed
         if (rc == 0)
6ae9ed
             ret = 0;
6ae9ed
@@ -4695,7 +4695,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
6ae9ed
         goto cleanup;
6ae9ed
     }
6ae9ed
 
6ae9ed
-    if ((rc = qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE)) < 0) {
6ae9ed
+    if ((rc = qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE)) < 0) {
6ae9ed
         /* rollback only if domain didn't exit */
6ae9ed
         if (rc == -2)
6ae9ed
             goto cleanup;
6ae9ed
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
6ae9ed
index 4cfa81a..6ff5da5 100644
6ae9ed
--- a/src/qemu/qemu_process.c
6ae9ed
+++ b/src/qemu/qemu_process.c
6ae9ed
@@ -5192,8 +5192,8 @@ qemuProcessLaunch(virConnectPtr conn,
6ae9ed
     if (qemuSetupCpusetMems(vm) < 0)
6ae9ed
         goto cleanup;
6ae9ed
 
6ae9ed
-    VIR_DEBUG("Detecting VCPU PIDs");
6ae9ed
-    if (qemuDomainDetectVcpuPids(driver, vm, asyncJob) < 0)
6ae9ed
+    VIR_DEBUG("Refreshing VCPU info");
6ae9ed
+    if (qemuDomainRefreshVcpuInfo(driver, vm, asyncJob) < 0)
6ae9ed
         goto cleanup;
6ae9ed
 
6ae9ed
     VIR_DEBUG("Detecting IOThread PIDs");
6ae9ed
@@ -5987,7 +5987,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
6ae9ed
     }
6ae9ed
 
6ae9ed
     VIR_DEBUG("Detecting VCPU PIDs");
6ae9ed
-    if (qemuDomainDetectVcpuPids(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
6ae9ed
+    if (qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
6ae9ed
         goto error;
6ae9ed
 
6ae9ed
     VIR_DEBUG("Detecting IOThread PIDs");
6ae9ed
-- 
6ae9ed
2.10.0
6ae9ed