Guest memory is canonically represented by the fd, so use it to refer to guest memory in the kvmtool guest memory banks. Signed-off-by: Fuad Tabba <tabba@xxxxxxxxxx> --- include/kvm/kvm.h | 2 ++ kvm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h index 33cae9d..6192f6c 100644 --- a/include/kvm/kvm.h +++ b/include/kvm/kvm.h @@ -80,6 +80,8 @@ struct kvm_mem_bank { u64 size; enum kvm_mem_type type; u32 slot; + int memfd; + u64 memfd_offset; }; struct kvm { diff --git a/kvm.c b/kvm.c index bde6708..a0bddf4 100644 --- a/kvm.c +++ b/kvm.c @@ -374,6 +374,8 @@ int kvm__register_mem(struct kvm *kvm, u64 guest_phys, u64 size, bank->size = size; bank->type = type; bank->slot = slot; + bank->memfd = memfd; + bank->memfd_offset = offset; if (type & KVM_MEM_TYPE_READONLY) flags |= KVM_MEM_READONLY; -- 2.39.0.rc0.267.gcb52ba06e7-goog