qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel][PATCH] fix return check for KVM_GET_DIRT


From: Mario Smarduch
Subject: Re: [Qemu-trivial] [Qemu-devel][PATCH] fix return check for KVM_GET_DIRTY_LOG ioctl
Date: Thu, 20 Mar 2014 09:38:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8

I agree. One thing I forgot to mention andother side effect
of this bug was virtio VRing used, avail index error 
the Guest was 1,2,..  less then host.

I looked up that bug it happend on some architectures. 
This may or may not be related. Obviously if the dirty
bitmap is not processed properly you may see issues like that.

- Mario 

On 03/20/2014 08:45 AM, Michael Tokarev wrote:
> 19.03.2014 21:24, Mario Smarduch wrote:
>>
>> Fix return condition check from kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) to
>> handle internal failures or no support for memory slot dirty bitmap.
>> Otherwise the ioctl succeeds and continues with migration.
>> Addresses BUG# 1294227
> 
> Thanks, applied to -trivial.
> 
> []
>> -        if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
>> +        if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) {
> 
> Actually I'd make all error checks like this.  Many checks compares
> return value with -1 for some reason, while actually, any <0 value
> should be treated as error in many many places...  At the same time,
> comparison with 0 is cheaper than comparison with -1 ;)
> 
> /mjt
> 




reply via email to

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