[PATCH 08/12] Convert virDomainVcpuPinFindByVcpu into virDomainPinFindByVcpu

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

 



Make common between Vcpu and IOThreads

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/domain_conf.c   | 24 ++++++++++++------------
 src/conf/domain_conf.h   |  6 +++---
 src/libvirt_private.syms |  2 +-
 src/qemu/qemu_driver.c   | 12 ++++++------
 src/qemu/qemu_process.c  | 12 ++++++------
 5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index efc01bd..75d75bc 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16693,17 +16693,17 @@ virDomainPinIsDuplicate(virDomainPinDefPtr *def,
 }
 
 virDomainPinDefPtr
-virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def,
-                           int nvcpupin,
-                           int vcpu)
+virDomainPinFindByVcpu(virDomainPinDefPtr *def,
+                       int npin,
+                       int id)
 {
     size_t i;
 
-    if (!def || !nvcpupin)
+    if (!def || !npin)
         return NULL;
 
-    for (i = 0; i < nvcpupin; i++) {
-        if (def[i]->id == vcpu)
+    for (i = 0; i < npin; i++) {
+        if (def[i]->id == id)
             return def[i];
     }
 
@@ -16722,9 +16722,9 @@ virDomainVcpuPinAdd(virDomainPinDefPtr **vcpupin_list,
     if (!vcpupin_list)
         return -1;
 
-    vcpupin = virDomainVcpuPinFindByVcpu(*vcpupin_list,
-                                         *nvcpupin,
-                                         vcpu);
+    vcpupin = virDomainPinFindByVcpu(*vcpupin_list,
+                                     *nvcpupin,
+                                     vcpu);
     if (vcpupin) {
         vcpupin->id = vcpu;
         virBitmapFree(vcpupin->cpumask);
@@ -16828,9 +16828,9 @@ virDomainIOThreadsPinAdd(virDomainPinDefPtr **iothreadspin_list,
     if (!iothreadspin_list)
         return -1;
 
-    iothreadpin = virDomainVcpuPinFindByVcpu(*iothreadspin_list,
-                                             *niothreadspin,
-                                             iothread_id);
+    iothreadpin = virDomainPinFindByVcpu(*iothreadspin_list,
+                                         *niothreadspin,
+                                         iothread_id);
     if (iothreadpin) {
         iothreadpin->id = iothread_id;
         virBitmapFree(iothreadpin->cpumask);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 0fb8d01..fe61b9f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1913,9 +1913,9 @@ int virDomainPinIsDuplicate(virDomainPinDefPtr *def,
                             int npin,
                             int id);
 
-virDomainPinDefPtr virDomainVcpuPinFindByVcpu(virDomainPinDefPtr *def,
-                                              int nvcpupin,
-                                              int vcpu);
+virDomainPinDefPtr virDomainPinFindByVcpu(virDomainPinDefPtr *def,
+                                          int npin,
+                                          int id);
 
 typedef struct _virBlkioDevice virBlkioDevice;
 typedef virBlkioDevice *virBlkioDevicePtr;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 365430f..540936f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -384,6 +384,7 @@ virDomainPausedReasonTypeToString;
 virDomainPinDefArrayFree;
 virDomainPinDefCopy;
 virDomainPinDefFree;
+virDomainPinFindByVcpu;
 virDomainPinIsDuplicate;
 virDomainPMSuspendedReasonTypeFromString;
 virDomainPMSuspendedReasonTypeToString;
@@ -438,7 +439,6 @@ virDomainTPMModelTypeFromString;
 virDomainTPMModelTypeToString;
 virDomainVcpuPinAdd;
 virDomainVcpuPinDel;
-virDomainVcpuPinFindByVcpu;
 virDomainVideoDefaultRAM;
 virDomainVideoDefaultType;
 virDomainVideoDefFree;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0d6f367..5d867c3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5143,9 +5143,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
         unsigned char *tmpmap = NULL;
         int tmpmaplen;
 
-        pininfo = virDomainVcpuPinFindByVcpu(targetDef->cputune.vcpupin,
-                                             targetDef->cputune.nvcpupin,
-                                             vcpu);
+        pininfo = virDomainPinFindByVcpu(targetDef->cputune.vcpupin,
+                                         targetDef->cputune.nvcpupin,
+                                         vcpu);
         if (!pininfo) {
             if (!(bitmap = virBitmapNew(hostcpus)))
                 goto cleanup;
@@ -5679,9 +5679,9 @@ qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef,
         info_ret[i]->iothread_id = i + 1;
 
         /* Initialize the cpumap */
-        pininfo = virDomainVcpuPinFindByVcpu(targetDef->cputune.iothreadspin,
-                                             targetDef->cputune.niothreadspin,
-                                             i + 1);
+        pininfo = virDomainPinFindByVcpu(targetDef->cputune.iothreadspin,
+                                         targetDef->cputune.niothreadspin,
+                                         i + 1);
         if (!pininfo) {
             if (targetDef->cpumask) {
                 cpumask = targetDef->cpumask;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3eb0a6a..6c22a16 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2519,9 +2519,9 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
 
     for (n = 0; n < def->vcpus; n++) {
         /* set affinity only for existing vcpus */
-        if (!(pininfo = virDomainVcpuPinFindByVcpu(def->cputune.vcpupin,
-                                                   def->cputune.nvcpupin,
-                                                   n)))
+        if (!(pininfo = virDomainPinFindByVcpu(def->cputune.vcpupin,
+                                               def->cputune.nvcpupin,
+                                               n)))
             continue;
 
         if (virProcessSetAffinity(priv->vcpupids[n],
@@ -2575,9 +2575,9 @@ qemuProcessSetIOThreadsAffinity(virDomainObjPtr vm)
 
     for (i = 0; i < def->iothreads; i++) {
         /* set affinity only for existing vcpus */
-        if (!(pininfo = virDomainVcpuPinFindByVcpu(def->cputune.iothreadspin,
-                                                   def->cputune.niothreadspin,
-                                                   i + 1)))
+        if (!(pininfo = virDomainPinFindByVcpu(def->cputune.iothreadspin,
+                                               def->cputune.niothreadspin,
+                                               i + 1)))
             continue;
 
         if (virProcessSetAffinity(priv->iothreadpids[i], pininfo->cpumask) < 0)
-- 
2.1.0

--
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]