[libvirt] [PATCH v2 34/45] cpu: Report error for unknown features in x86HasFeature

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


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

Notes:
    Version 2:
    - no change

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

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 904b59c..d0e1a1a 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2653,8 +2653,11 @@ x86HasFeature(const virCPUData *data,
         return -1;
 
     if (!(feature = x86FeatureFind(map, name)) &&
-        !(feature = x86FeatureFindInternal(name)))
+        !(feature = x86FeatureFindInternal(name))) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("unknown CPU feature %s"), name);
         goto cleanup;
+    }
 
     ret = x86DataIsSubset(&data->data.x86, &feature->data) ? 1 : 0;
 
-- 
2.10.0




More information about the libvir-list mailing list