qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/1] kvm_physical_sync_dirty_bitmap: ignore ENOE


From: Michael Tokarev
Subject: Re: [Qemu-devel] [PATCH 1/1] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl
Date: Thu, 10 Apr 2014 20:30:21 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10

09.04.2014 07:21, Serge Hallyn wrote:
> ENOENT (iiuc) means the kernel has an empty dirty bitmap for this
> slot.  Don't abort in that case.  This appears to solve the bug
> reported at
> 
> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1303926
> 
> which first showed up with commit b533f658a98325d: fix return check for
> KVM_GET_DIRTY_LOG ioctl
> 
> Signed-off-by: Serge Hallyn <address@hidden>
> ---
>  kvm-all.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 82a9119..7b7ea8d 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -441,10 +441,13 @@ static int 
> kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)
>  
>          d.slot = mem->slot;
>  
> -        if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
> +        ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d);
> +        if (ret < 0 && ret != -ENOENT) {
>              DPRINTF("ioctl failed %d\n", errno);
>              ret = -1;
>              break;
> +        } else if (ret < 0) {
> +            ret = 0;
>          }
>  
>          kvm_get_dirty_pages_log_range(section, d.dirty_bitmap);

Should we omit calling kvm_get_dirty_pages_log_range() if there's
no bitmap from kernel?  In particular, do we trust kernel to not
touch d.dirty_bitmap when it returns ENOENT?

Thanks,

/mjt






reply via email to

[Prev in Thread] Current Thread [Next in Thread]