[PATCH 5/7] qemu: Refactor virQEMUCapsInitCPU

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

 



The function is now called virQEMUCapsProbeHostCPU. Both the refactoring
and the change of the name is done for consistency with a new function
which will be introduced in the following commit.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 319600c30..08c66b088 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1061,20 +1061,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
 }
 
 
-static int
-virQEMUCapsInitCPU(virCapsPtr caps,
-                   virArch arch)
+static virCPUDefPtr
+virQEMUCapsProbeHostCPU(virCapsPtr caps)
 {
     virNodeInfo nodeinfo;
 
     if (nodeGetInfo(&nodeinfo))
-        return -1;
+        return NULL;
 
-    if (!(caps->host.cpu = virCPUGetHost(arch, VIR_CPU_TYPE_HOST,
-                                         &nodeinfo, NULL, 0)))
-        return -1;
-
-    return 0;
+    return virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST,
+                         &nodeinfo, NULL, 0);
 }
 
 
@@ -1120,7 +1116,7 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
     }
 
-    if (virQEMUCapsInitCPU(caps, hostarch) < 0)
+    if (!(caps->host.cpu = virQEMUCapsProbeHostCPU(caps)))
         VIR_WARN("Failed to get host CPU");
 
     /* Add the power management features of the host */
-- 
2.12.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]
  Powered by Linux