[PATCH] report invalid x86 cpu map error

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

 



Let libvirtd handle invalid x86 cpu map error, and report the real reason.

This issue can be reproduced :
1, rm -rf /share/libvirt/cpu_map
2, start libvirtd
3, virsh create INSTANCE.xml

Libvirtd reports error :
error: invalid argument: Failed to parse group 'tss'

In face, libvirtd gets invalid cpu map.
With this patch, libvirtd reports error :
error: unsupported configuration: invalid x86 cpu map

Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx>
---
 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 d3a88da21d..91419d91d4 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2902,8 +2902,11 @@ virCPUx86ValidateFeatures(virCPUDefPtr cpu)
     virCPUx86MapPtr map;
     size_t i;
 
-    if (!(map = virCPUx86GetMap()))
+    if (!(map = virCPUx86GetMap())) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                        _("invalid x86 cpu map"));
         return -1;
+    }
 
     for (i = 0; i < cpu->nfeatures; i++) {
         if (!x86FeatureFind(map, cpu->features[i].name)) {
-- 
2.11.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