mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virt-host-validate-common: Use automatic memory freeing for virBitmap
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4c4b4b3691
commit
68919edb3b
@ -330,7 +330,7 @@ int virHostValidateCGroupControllers(const char *hvname G_GNUC_UNUSED,
|
||||
int virHostValidateIOMMU(const char *hvname,
|
||||
virHostValidateLevel level)
|
||||
{
|
||||
virBitmap *flags;
|
||||
g_autoptr(virBitmap) flags = NULL;
|
||||
struct stat sb;
|
||||
const char *bootarg = NULL;
|
||||
bool isAMD = false, isIntel = false;
|
||||
@ -347,8 +347,6 @@ int virHostValidateIOMMU(const char *hvname,
|
||||
else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM))
|
||||
isAMD = true;
|
||||
|
||||
virBitmapFree(flags);
|
||||
|
||||
if (isIntel) {
|
||||
if (access("/sys/firmware/acpi/tables/DMAR", F_OK) == 0) {
|
||||
virHostMsgPass();
|
||||
@ -445,7 +443,7 @@ bool virHostKernelModuleIsLoaded(const char *module)
|
||||
int virHostValidateSecureGuests(const char *hvname,
|
||||
virHostValidateLevel level)
|
||||
{
|
||||
virBitmap *flags;
|
||||
g_autoptr(virBitmap) flags = NULL;
|
||||
bool hasFac158 = false;
|
||||
bool hasAMDSev = false;
|
||||
virArch arch = virArchFromHost();
|
||||
@ -460,8 +458,6 @@ int virHostValidateSecureGuests(const char *hvname,
|
||||
else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SEV))
|
||||
hasAMDSev = true;
|
||||
|
||||
virBitmapFree(flags);
|
||||
|
||||
virHostMsgCheck(hvname, "%s", _("for secure guest support"));
|
||||
if (ARCH_IS_S390(arch)) {
|
||||
if (hasFac158) {
|
||||
|
Loading…
Reference in New Issue
Block a user