]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: guest-memfd: fix unused-function warning
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Dec 2023 18:46:48 +0000 (13:46 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Dec 2023 18:46:48 +0000 (13:46 -0500)
commit80583d0cfd8ff44d60a5fa76a6bf3c08eb67c328
tree259800ea1082a602d06afbd852db91b8fb998fa4
parent849c1816436fe359e85587fba5b69ddd3a957b31
KVM: guest-memfd: fix unused-function warning

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: a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/guest_memfd.c