[Top][All Lists]

[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: Michael Tokarev
Subject: Re: [Qemu-trivial] [Qemu-devel][PATCH] fix return check for KVM_GET_DIRTY_LOG ioctl
Date: Thu, 20 Mar 2014 19:45:00 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10

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 ;)


reply via email to

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