[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RESEND 31/50] block: Add blk_insert_bs()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RESEND 31/50] block: Add blk_insert_bs() |
Date: |
Wed, 28 Jan 2015 09:52:43 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 01/27/2015 12:46 PM, Max Reitz wrote:
> This function associates the given BlockDriverState with the given
> BlockBackend.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/block-backend.c | 16 ++++++++++++++++
> include/sysemu/block-backend.h | 1 +
> 2 files changed, 17 insertions(+)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index 760558f..656ebfc 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -312,6 +312,22 @@ void blk_hide_on_behalf_of_do_drive_del(BlockBackend
> *blk)
> }
>
> /*
> + * Associates a new BlockDriverState with @blk.
> + */
> +void blk_insert_bs(BlockBackend *blk, BlockDriverState *bs)
> +{
> + if (bs->blk == blk) {
> + return;
> + }
> +
> + assert(!blk->bs);
I guess this interesting code allows for idempotent use of blk_insert_bs
more than once? What situations require that usage pattern?
At any rate, the new function looks fine.
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
- Re: [Qemu-devel] [PATCH RESEND 27/50] blockdev: Check BB validity in blockdev-backup, (continued)
- [Qemu-devel] [PATCH RESEND 29/50] blockdev: Check BB validity in find_block_job(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 23/50] blockdev: Catch NULL BDS in block_set_io_throttle, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 30/50] blockdev: Check BB validity in change-backing-file, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 28/50] blockdev: Check BB validity in drive-mirror, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 31/50] block: Add blk_insert_bs(), Max Reitz, 2015/01/27
- Re: [Qemu-devel] [PATCH RESEND 31/50] block: Add blk_insert_bs(),
Eric Blake <=
- [Qemu-devel] [PATCH RESEND 32/50] blockdev: Check BB validity in eject and change, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 34/50] blockdev: Do not create BDS for empty drive, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 36/50] blockdev: Allow more options for BB-less BDS tree, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 38/50] blockdev: Add blockdev-open-tray, Max Reitz, 2015/01/27