From: Kevin Wolf <kwolf@redhat.com>
To: Zhang Haoyu <ahzhanghaoyu@gmail.com>
Cc: Zhang Haoyu <zhanghy@sangfor.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to perform bdrv_drain_all before savevm and delvm?
Date: Mon, 20 Oct 2014 18:07:24 +0200 [thread overview]
Message-ID: <20141020160724.GS3585@noname.redhat.com> (raw)
In-Reply-To: <544525AA.6030609@gmail.com>
Am 20.10.2014 um 17:09 hat Zhang Haoyu geschrieben:
> >> Hi,
> >>
> >> I noticed that bdrv_drain_all is performed in load_vmstate before
> bdrv_snapshot_goto,
> >> and bdrv_drain_all is performed in qmp_transaction before
> internal_snapshot_prepare,
> >> so is it also neccesary to perform bdrv_drain_all in savevm and delvm?
> >
> >Definitely yes for savevm. do_savevm() calls it indirectly via
> >vm_stop(), so that part looks okay.
> >
> Yes, you are right.
>
> >delvm doesn't affect the currently running VM, and therefore doesn't
> >interfere with guest requests that are in flight. So I think that a
> >bdrv_drain_all() isn't needed there.
> >
> I'm worried about that there are still pending IOs while deleting snapshot,
> then is it possible that there is concurrency problem between the
> process of deleting snapshot
> and the coroutine of io read/write(bdrv_co_do_rw) invoked by the
> pending IOs?
> This coroutine is also in main thread.
> Am I missing something?
What kind of concurrency problem are you thinking of?
I do see that there might be a chance of concurrency, but that doesn't
automatically mean the requests are conflicting.
Would you feel better with taking s->lock in qcow2_snapshot_delete()?
This might actually be a valid concern.
Kevin
next prev parent reply other threads:[~2014-10-20 16:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 13:48 [Qemu-devel] [question] savevm/delvm: Is it neccesary to perform bdrv_drain_all before savevm and delvm? Zhang Haoyu
2014-10-20 13:59 ` Kevin Wolf
2014-10-20 15:09 ` [Qemu-devel] [question] savevm/delvm: Is it necessary " Zhang Haoyu
2014-10-20 16:07 ` Kevin Wolf [this message]
2014-10-21 1:13 ` Zhang Haoyu
2014-10-21 7:19 ` Kevin Wolf
2014-10-21 7:51 ` [Qemu-devel] [question] savevm/delvm: Is it necessary to performbdrv_drain_all " Zhang Haoyu
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=20141020160724.GS3585@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=ahzhanghaoyu@gmail.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhanghy@sangfor.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).