qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH 2/2] block: fix libvirt snapshot with existing bitmaps
Date: Wed, 15 Jun 2016 17:29:39 +0200	[thread overview]
Message-ID: <2eccd08f-6c6f-1eac-cd7a-a129441100a3@redhat.com> (raw)
In-Reply-To: <57615330.1050208@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]

On 15.06.2016 15:08, Vladimir Sementsov-Ogievskiy wrote:
> On 15.06.2016 00:33, Eric Blake wrote:
>> On 06/14/2016 11:08 AM, Vladimir Sementsov-Ogievskiy wrote:
>>> Fix the following bug:
>>>
>>>   # virsh start test
>>>   Domain test started
>>>
>>>   #  virsh qemu-monitor-command test \
>>>       '{"execute":"block-dirty-bitmap-add",\
>>>        "arguments":{"node":"drive0","name":"ab"}}'
>>>   {"return":{},"id":"libvirt-36"}'}'
>>>
>>>   # virsh snapshot-create test
>>>   error: Unable to read from monitor: Connection reset by peer
>>>
>>> Actually, assert "assert(pos < hb->size)" in hbitmap_iter_init fires,
>>> because qcow2_save_vmstate just writes to bs (not to bs->file->bs) after
>>> the end of the drive.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> ---
>>>   block/dirty-bitmap.c | 14 ++++++++++++++
>>>   1 file changed, 14 insertions(+)
>>>
>>> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
>>> index 4902ca5..d28b49c 100644
>>> --- a/block/dirty-bitmap.c
>>> +++ b/block/dirty-bitmap.c
>>> @@ -364,6 +364,20 @@ void bdrv_set_dirty(BlockDriverState *bs,
>>> int64_t cur_sector,
>>>                       int nr_sectors)
>>>   {
>>>       BdrvDirtyBitmap *bitmap;
>>> +    int64_t bitmap_size;
>>> +
>>> +    if (QLIST_EMPTY(&bs->dirty_bitmaps)) {
>>> +        return;
>>> +    }
>>> +
>>> +    bitmap_size = QLIST_FIRST(&bs->dirty_bitmaps)->size;
>>> +
>>> +    if (cur_sector >= bitmap_size) {
>>> +        /* this may come from qcow2_save_vmstate */
>>> +        return;
>>> +    }
>> Do we still need this patch after Kevin's work to fix vmstate to no
>> longer go through the block layer?
> 
> I think not. If we are not going through block layer we are not touching
> dirty bitmaps.

OK, I'll drop this patch, then. I'll keep the first patch, though,
because it seems useful anyway.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-06-15 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 17:08 [Qemu-devel] [PATCH v2 0/2] block: fix libvirt snapshot with existing bitmaps Vladimir Sementsov-Ogievskiy
2016-06-14 17:08 ` [Qemu-devel] [PATCH 1/2] hbitmap: add 'pos < size' asserts Vladimir Sementsov-Ogievskiy
2016-06-14 17:08 ` [Qemu-devel] [PATCH 2/2] block: fix libvirt snapshot with existing bitmaps Vladimir Sementsov-Ogievskiy
2016-06-14 21:33   ` Eric Blake
2016-06-15 13:08     ` Vladimir Sementsov-Ogievskiy
2016-06-15 15:29       ` Max Reitz [this message]
2016-06-14 18:09 ` [Qemu-devel] [PATCH v2 0/2] " Max Reitz

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=2eccd08f-6c6f-1eac-cd7a-a129441100a3@redhat.com \
    --to=mreitz@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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).