[PATCH 06/12] Convert virDomainVcpuPinDefCopy into virDomainPinDefCopy

[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   | 8 ++++----
 src/conf/domain_conf.h   | 4 ++--
 src/libvirt_private.syms | 2 +-
 src/qemu/qemu_driver.c   | 9 ++++-----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e5a8011..63e7c77 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2004,15 +2004,15 @@ virDomainClockDefClear(virDomainClockDefPtr def)
 }
 
 virDomainPinDefPtr *
-virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, int nvcpupin)
+virDomainPinDefCopy(virDomainPinDefPtr *src, int npin)
 {
     size_t i;
     virDomainPinDefPtr *ret = NULL;
 
-    if (VIR_ALLOC_N(ret, nvcpupin) < 0)
+    if (VIR_ALLOC_N(ret, npin) < 0)
         goto error;
 
-    for (i = 0; i < nvcpupin; i++) {
+    for (i = 0; i < npin; i++) {
         if (VIR_ALLOC(ret[i]) < 0)
             goto error;
         ret[i]->id = src[i]->id;
@@ -2024,7 +2024,7 @@ virDomainVcpuPinDefCopy(virDomainPinDefPtr *src, int nvcpupin)
 
  error:
     if (ret) {
-        for (i = 0; i < nvcpupin; i++) {
+        for (i = 0; i < npin; i++) {
             if (ret[i]) {
                 virBitmapFree(ret[i]->cpumask);
                 VIR_FREE(ret[i]);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a126668..5fc4074 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1906,8 +1906,8 @@ struct _virDomainPinDef {
 void virDomainPinDefFree(virDomainPinDefPtr def);
 void virDomainPinDefArrayFree(virDomainPinDefPtr *def, int npin);
 
-virDomainPinDefPtr *virDomainVcpuPinDefCopy(virDomainPinDefPtr *src,
-                                            int nvcpupin);
+virDomainPinDefPtr *virDomainPinDefCopy(virDomainPinDefPtr *src,
+                                        int npin);
 
 int virDomainVcpuPinIsDuplicate(virDomainPinDefPtr *def,
                                 int nvcpupin,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8796b31..33a50a9 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -382,6 +382,7 @@ virDomainParseMemory;
 virDomainPausedReasonTypeFromString;
 virDomainPausedReasonTypeToString;
 virDomainPinDefArrayFree;
+virDomainPinDefCopy;
 virDomainPinDefFree;
 virDomainPMSuspendedReasonTypeFromString;
 virDomainPMSuspendedReasonTypeToString;
@@ -435,7 +436,6 @@ virDomainTPMDefFree;
 virDomainTPMModelTypeFromString;
 virDomainTPMModelTypeToString;
 virDomainVcpuPinAdd;
-virDomainVcpuPinDefCopy;
 virDomainVcpuPinDel;
 virDomainVcpuPinFindByVcpu;
 virDomainVcpuPinIsDuplicate;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b3eacf8..0d6f367 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4966,8 +4966,8 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
         }
 
         if (vm->def->cputune.vcpupin) {
-            newVcpuPin = virDomainVcpuPinDefCopy(vm->def->cputune.vcpupin,
-                                                 vm->def->cputune.nvcpupin);
+            newVcpuPin = virDomainPinDefCopy(vm->def->cputune.vcpupin,
+                                             vm->def->cputune.nvcpupin);
             if (!newVcpuPin)
                 goto endjob;
 
@@ -5839,10 +5839,9 @@ qemuDomainPinIOThread(virDomainPtr dom,
         }
 
         if (vm->def->cputune.iothreadspin) {
-            /* The VcpuPinDefCopy works for IOThreads too */
             newIOThreadsPin =
-                virDomainVcpuPinDefCopy(vm->def->cputune.iothreadspin,
-                                        vm->def->cputune.niothreadspin);
+                virDomainPinDefCopy(vm->def->cputune.iothreadspin,
+                                    vm->def->cputune.niothreadspin);
             if (!newIOThreadsPin)
                 goto endjob;
 
-- 
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]