mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virt-host-validate: fix build with clang
Building with clang 3.8 triggers the following error:
CC virt_host_validate-virt-host-validate-qemu.o
virt-host-validate-qemu.c:36:11: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
char *kvmhint = _("Check that CPU and firmware supports virtualization "
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
virt-host-validate-qemu.c:46:17: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
kvmhint = _("Check that the 'kvm-intel' or 'kvm-amd' modules are "
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Fix by using 'const' for kvmhint declaration.
This commit is contained in:
@@ -33,8 +33,8 @@ int virHostValidateQEMU(void)
|
||||
int ret = 0;
|
||||
bool hasHwVirt = false;
|
||||
bool hasVirtFlag = false;
|
||||
char *kvmhint = _("Check that CPU and firmware supports virtualization "
|
||||
"and kvm module is loaded");
|
||||
const char *kvmhint = _("Check that CPU and firmware supports virtualization "
|
||||
"and kvm module is loaded");
|
||||
|
||||
if (!(flags = virHostValidateGetCPUFlags()))
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user