]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu: Rework virCPUDataCheckFeature
authorJiri Denemark <jdenemar@redhat.com>
Fri, 16 Sep 2016 12:12:15 +0000 (14:12 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 22 Sep 2016 13:40:09 +0000 (15:40 +0200)
To match our coding style and to provide better debug and error
messages.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/cpu/cpu.c

index 99c1a4c8649103fde18422c51ec84043ee8b94cd..cc7d03ccc7bbbba05ecd5d1daa2bf7fa2abafb60 100644 (file)
@@ -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;
     }