From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block: drop bs_snapshots global variable
Date: Thu, 14 Mar 2013 10:49:46 -0600 [thread overview]
Message-ID: <5141FFAA.7090701@redhat.com> (raw)
In-Reply-To: <1363277099-26616-1-git-send-email-stefanha@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]
On 03/14/2013 10:04 AM, Stefan Hajnoczi wrote:
> The bs_snapshots global variable points to the BlockDriverState which
> will be used to save vmstate. This is really a savevm.c concept but was
> moved into block.c:bdrv_snapshots() when it became clear that hotplug
> could result in a dangling pointer.
>
> While auditing the block layer's global state I came upon bs_snapshots
> and realized that a variable is not necessary here. Simply find the
> first BlockDriverState capable of internal snapshots each time this is
> needed.
>
> The behavior of bdrv_snapshots() is preserved across hotplug because new
> drives are always appended to the bdrv_states list. This means that
> calling the new find_vmstate_bs() function is idempotent - it returns
> the same BlockDriverState unless it was hot-unplugged.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> block.c | 28 ----------------------------
> include/block/block.h | 1 -
> savevm.c | 19 +++++++++++++++----
> 3 files changed, 15 insertions(+), 33 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-03-14 16:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-14 16:04 [Qemu-devel] [PATCH] block: drop bs_snapshots global variable Stefan Hajnoczi
2013-03-14 16:49 ` Eric Blake [this message]
2013-03-15 7:58 ` Wenchao Xia
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=5141FFAA.7090701@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).