From: Serge Hallyn <serge.hallyn@ubuntu.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Mario Smarduch <m.smarduch@samsung.com>
Subject: Re: [Qemu-devel] [PATCH for-2.0] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl
Date: Fri, 11 Apr 2014 21:10:26 -0500 [thread overview]
Message-ID: <20140412021026.GA4869@sergelap> (raw)
In-Reply-To: <53489BF0.6090009@redhat.com>
Quoting Paolo Bonzini (pbonzini@redhat.com):
> Il 11/04/2014 04:31, Michael Tokarev ha scritto:
> >ENOENT means the kernel has an empty dirty bitmap for this
> >slot. Don't abort in that case. This appears to solve
> >the bug reported at
> >
> >https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1303926
> >
> >which first showed up with commit b533f658a98325d: fix return
> >check for KVM_GET_DIRTY_LOG ioctl
> >
> >Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
> >Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> >---
> > kvm-all.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> >diff --git a/kvm-all.c b/kvm-all.c
> >index cd4111d..47fa948 100644
> >--- a/kvm-all.c
> >+++ b/kvm-all.c
> >@@ -441,13 +441,19 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)
> >
> > d.slot = mem->slot;
> >
> >- if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) {
> >+ ret = kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d);
> >+ if (ret >= 0) {
> >+ /* regular case, process returned bitmap */
> >+ kvm_get_dirty_pages_log_range(section, d.dirty_bitmap);
> >+ } else if (ret == -ENOENT) {
> >+ /* kernel does not have dirty bitmap in this slot */
> >+ ret = 0;
> >+ } else {
> > DPRINTF("ioctl failed %d\n", errno);
> > ret = -1;
> > break;
> > }
> >
> >- kvm_get_dirty_pages_log_range(section, d.dirty_bitmap);
> > start_addr = mem->start_addr + mem->memory_size;
> > }
> > g_free(d.dirty_bitmap);
> >
>
> I'd rather revert b533f658a98325d instead.
That seems wrong though. If we want to ignore all errors that's one
thing, but before that commit we just ignored all errors other than
EPERM.
prev parent reply other threads:[~2014-04-12 2:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 8:31 [Qemu-devel] [PATCH for-2.0] kvm_physical_sync_dirty_bitmap: ignore ENOENT from kvm_vm_ioctl Michael Tokarev
2014-04-11 15:59 ` Serge Hallyn
2014-04-12 1:50 ` Paolo Bonzini
2014-04-12 2:10 ` Serge Hallyn [this message]
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=20140412021026.GA4869@sergelap \
--to=serge.hallyn@ubuntu.com \
--cc=m.smarduch@samsung.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).