tools: virt-host-validate: improve error handling

When virHostValidateCPUFlag returns NULL, that's more an unexpected
error than the sign of missing CPU flags. Let's react to this
appropriately.

Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
Bjoern Walk 2016-05-03 08:10:53 +02:00 committed by Michal Privoznik
parent 6391012852
commit efc23df251
1 changed files with 3 additions and 3 deletions

View File

@ -33,10 +33,10 @@ int virHostValidateQEMU(void)
virHostMsgCheck("QEMU", "%s", _("for hardware virtualization"));
flags = virHostValidateGetCPUFlags();
if (!(flags = virHostValidateGetCPUFlags()))
return -1;
if (flags &&
(virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM) ||
if ((virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM) ||
virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX))) {
virHostMsgPass();
if (virHostValidateDeviceExists("QEMU", "/dev/kvm",