• Paolo Bonzini's avatar
    KVM: guest-memfd: fix unused-function warning · 80583d0c
    Paolo Bonzini authored
    With migration disabled, one function becomes unused:
    
    virt/kvm/guest_memfd.c:262:12: error: 'kvm_gmem_migrate_folio' defined but not used [-Werror=unused-function]
      262 | static int kvm_gmem_migrate_folio(struct address_space *mapping,
          |            ^~~~~~~~~~~~~~~~~~~~~~
    
    Remove the #ifdef around the reference so that fallback_migrate_folio()
    is never used.  The gmem implementation of the hook is trivial; since
    the gmem mapping is unmovable, the pages should not be migrated anyway.
    
    Fixes: a7800aa8 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
    Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
    Suggested-by: default avatarSean Christopherson <seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    80583d0c
guest_memfd.c 12.3 KB