[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: drop bs_snapshots global variable
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block: drop bs_snapshots global variable |
Date: |
Thu, 14 Mar 2013 10:49:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 |
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 <address@hidden>
> ---
> block.c | 28 ----------------------------
> include/block/block.h | 1 -
> savevm.c | 19 +++++++++++++++----
> 3 files changed, 15 insertions(+), 33 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature