From: Anthony Liguori <anthony@codemonkey.ws>
To: quintela@redhat.com
Cc: Kevin Wolf <kwolf@redhat.com>,
Lucas Meneghel Rodrigues <lmr@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 5/7] block: allow migration to work with image files (v2)
Date: Mon, 14 Nov 2011 13:49:29 -0600 [thread overview]
Message-ID: <4EC170C9.5060202@codemonkey.ws> (raw)
In-Reply-To: <m3hb26wkq8.fsf@trasno.mitica>
On 11/14/2011 01:46 PM, Juan Quintela wrote:
> Anthony Liguori<aliguori@us.ibm.com> wrote:
>> On 11/14/2011 07:11 AM, Juan Quintela wrote:
>>>
>>>> diff --git a/cpus.c b/cpus.c
>>>> index 82530c4..ae5ec99 100644
>>>> --- a/cpus.c
>>>> +++ b/cpus.c
>>>> @@ -398,6 +398,7 @@ static void do_vm_stop(RunState state)
>>>> vm_state_notify(0, state);
>>>> qemu_aio_flush();
>>>> bdrv_flush_all();
>>>> + bdrv_invalidate_cache_all();
>>>> monitor_protocol_event(QEVENT_STOP, NULL);
>>>> }
>>>
>>> This is too much. Reopening all qcow2 images each time that we stop the
>>> vm looks excesive, no?
>>
>> This general code came in via:
>>
>> http://mid.gmane.org/cover.1290613959.git.mst@redhat.com
>>
>> That series made migration stable after issuing a stop operation. I
>> believe the justification was for debugging purposes or something like
>> that.
>>
>> At any rate, invalidating the cache is part of what's required to make
>> things stable. If you look at something like cache=unsafe, the only
>> way the metadata will get flushed if via a bdrv_close since bdrv_flush
>> is a nop.
>>
>> So this is needed as long as we care about supporting this use-case.
>
> Then we need a "proper" qcow2 invalidate call. Doing in qemu toplevel:
>
> (qemu)stop
>
> And now all your qcow2 block devices are closed, or perhaps failing to
> re-open() looks too much to me (TM).
>
> Kevin?
Look closely at the patch. It doesn't actually close()/open() anything.
It just invokes the bdrv_close() routine which calls the free functions on the
l1/l2 caching functions. bdrv_open() doesn't actually open anything (it assumes
the file is already open. It just reads the header and metadata over again.
For something that's basically a hack, it turned out to work very cleanly :-)
Regards,
Anthony Liguori
>
> Later, Juan.
>
>
next prev parent reply other threads:[~2011-11-14 19:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-12 15:56 [Qemu-devel] [PATCH 1/7] migrate: add migration blockers Anthony Liguori
2011-11-12 15:56 ` [Qemu-devel] [PATCH 2/7] ivshmem: use migration blockers to prevent live migration in peer mode Anthony Liguori
2011-11-14 13:05 ` Juan Quintela
2011-11-14 13:52 ` Anthony Liguori
2011-11-14 19:52 ` Juan Quintela
2011-11-14 19:55 ` Anthony Liguori
2011-11-12 15:56 ` [Qemu-devel] [PATCH 3/7] qcow2: add a migration blocker Anthony Liguori
2011-11-12 15:56 ` [Qemu-devel] [PATCH 4/7] qed: add " Anthony Liguori
2011-11-12 15:56 ` [Qemu-devel] [PATCH 5/7] block: allow migration to work with image files (v2) Anthony Liguori
2011-11-14 13:11 ` Juan Quintela
2011-11-14 14:10 ` Anthony Liguori
2011-11-14 19:46 ` Juan Quintela
2011-11-14 19:49 ` Anthony Liguori [this message]
2011-11-14 20:11 ` Kevin Wolf
2011-11-14 20:12 ` Anthony Liguori
2011-11-14 20:28 ` Juan Quintela
2011-11-14 20:36 ` Kevin Wolf
2011-11-14 20:49 ` Anthony Liguori
2011-11-14 20:15 ` Juan Quintela
2011-11-12 15:56 ` [Qemu-devel] [PATCH 6/7] qcow2: implement bdrv_invalidate_cache Anthony Liguori
2011-11-12 15:57 ` [Qemu-devel] [PATCH 7/7] qcow2: relax migration blocker Anthony Liguori
2011-11-14 9:04 ` Kevin Wolf
2011-11-14 9:08 ` [Qemu-devel] [PATCH 1/7] migrate: add migration blockers Kevin Wolf
2011-11-14 18:25 ` Anthony Liguori
2011-11-14 9:12 ` Kevin Wolf
2011-11-14 13:00 ` Juan Quintela
-- strict thread matches above, loose matches on Subject: below --
2011-11-12 15:57 Anthony Liguori
2011-11-12 15:57 ` [Qemu-devel] [PATCH 5/7] block: allow migration to work with image files (v2) Anthony Liguori
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=4EC170C9.5060202@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=kwolf@redhat.com \
--cc=lmr@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@linux.vnet.ibm.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).