From: Christoffer Dall <christoffer.dall@linaro.org>
To: qemu-devel@nongnu.org
Cc: Christoffer Dall <christoffer.dall@linaro.org>,
Mario Smarduch <m.smarduch@samsung.com>
Subject: [Qemu-devel] [PATCH] kvm: Fix error code check from kvm_vm_ioctl()
Date: Mon, 29 Sep 2014 15:56:49 +0200 [thread overview]
Message-ID: <1411999009-25241-1-git-send-email-christoffer.dall@linaro.org> (raw)
Currently kvm_physical_sync_dirty_bitmap() calls kvm_vm_ioctl() and
checks if it returns -1. However, kvm_vm_ioctl() actually returns
-errno, and not -1, so this check will fail and architectures not
implementing this functionality in the kernel blindly attempt
broken things like unimplemented dirty page logging for migration.
This addresses bug https://bugs.launchpad.net/qemu/+bug/1294227.
Cc: Mario Smarduch <m.smarduch@samsung.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
kvm-all.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kvm-all.c b/kvm-all.c
index 4afcd05..ab57170 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -429,7 +429,7 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)
d.slot = mem->slot;
- if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
+ if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) {
DPRINTF("ioctl failed %d\n", errno);
ret = -1;
break;
--
2.0.0
reply other threads:[~2014-09-29 13:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411999009-25241-1-git-send-email-christoffer.dall@linaro.org \
--to=christoffer.dall@linaro.org \
--cc=m.smarduch@samsung.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).