All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix ioctl return value
@ 2009-07-21 13:45 Glauber Costa
  2009-07-21 13:40 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Glauber Costa @ 2009-07-21 13:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

we expect a number less than 0, not exactly -1.
And furthermore, we return errno itself, so no need to use it.

This might break guests when this ioctl fails for some reason.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 kvm-all.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 8567ac9..9a79466 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -319,9 +319,8 @@ int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
 
         d.slot = mem->slot;
 
-        if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
-            dprintf("ioctl failed %d\n", errno);
-            ret = -1;
+        if ((ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d)) < 0) {
+            dprintf("ioctl failed %d\n", ret);
             break;
         }
 
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-21 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 13:45 [Qemu-devel] [PATCH] fix ioctl return value Glauber Costa
2009-07-21 13:40 ` [Qemu-devel] " Anthony Liguori
2009-07-21 13:51   ` Glauber Costa
2009-07-21 13:44     ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.