[libvirt] [PATCH v2 40/45] cpu: Rework virCPUDataCheckFeature

Jiri Denemark jdenemar at redhat.com
Mon Sep 19 13:30:49 UTC 2016


To match our coding style and to provide better debug and error
messages.

Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---

Notes:
    Version 2:
    - new patch (separated from 38/41)

 src/cpu/cpu.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 99c1a4c..cc7d03c 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -650,7 +650,7 @@ virCPUUpdate(virArch arch,
 /**
  * virCPUDataCheckFeature:
  *
- * @data: internal CPU representation
+ * @data: CPU data
  * @feature: feature to be checked for
  *
  * Checks whether @feature is supported by the CPU described by @data.
@@ -664,14 +664,15 @@ virCPUDataCheckFeature(const virCPUData *data,
 {
     struct cpuArchDriver *driver;
 
-    VIR_DEBUG("data=%p, feature=%s", data, feature);
+    VIR_DEBUG("arch=%s, data=%p, feature=%s",
+              virArchToString(data->arch), data, feature);
 
-    if ((driver = cpuGetSubDriver(data->arch)) == NULL)
+    if (!(driver = cpuGetSubDriver(data->arch)))
         return -1;
 
     if (!driver->dataCheckFeature) {
         virReportError(VIR_ERR_NO_SUPPORT,
-                       _("cannot check guest CPU data for %s architecture"),
+                       _("cannot check guest CPU feature for %s architecture"),
                        virArchToString(data->arch));
         return -1;
     }
-- 
2.10.0




More information about the libvir-list mailing list