* [Qemu-devel] [PATCH] fix ioctl return value
@ 2009-07-21 13:45 Glauber Costa
0 siblings, 0 replies; 2+ 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] 2+ messages in thread
* [Qemu-devel] [PATCH] fix ioctl return value
@ 2009-07-21 14:06 Glauber Costa
0 siblings, 0 replies; 2+ messages in thread
From: Glauber Costa @ 2009-07-21 14:06 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 | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 8567ac9..2f74dcb 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -319,9 +319,9 @@ 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;
+ ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d);
+ if (ret < 0) {
+ dprintf("ioctl failed %d\n", ret);
break;
}
--
1.6.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-21 13:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 14:06 [Qemu-devel] [PATCH] fix ioctl return value Glauber Costa
-- strict thread matches above, loose matches on Subject: below --
2009-07-21 13:45 Glauber Costa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).