On Fri, 2025-02-21 at 16:07 +0000, Patrick Roy wrote:

...

> @@ -985,10 +1013,13 @@ void vm_mem_add(struct kvm_vm *vm, enum 
> vm_mem_backing_src_type src_type,
>       if (alignment > 1)
>               region->mmap_size += alignment;
>  
> -     region->fd = -1;
> -     if (backing_src_is_shared(src_type))
> +     if (backing_src_is_guest_memfd(src_type))
> +             region->fd = guest_memfd;
> +     else if (backing_src_is_guest_memfd(src_type))

Argh, this is nonsense. Should be 

+       else if (backing_src_is_shared(src_type))

instead.

>               region->fd = kvm_memfd_alloc(region->mmap_size,
>                                            src_type == 
> VM_MEM_SRC_SHARED_HUGETLB);
> +     else
> +             region->fd = -1;
>  
>       region->mmap_start = mmap(NULL, region->mmap_size,
>                                 PROT_READ | PROT_WRITE,

...

Reply via email to