[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 11/14] block: Add blk_next_root_bs()
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 11/14] block: Add blk_next_root_bs() |
Date: |
Wed, 17 Feb 2016 17:06:00 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 16.02.2016 um 19:08 hat Max Reitz geschrieben:
> This function iterates over all BDSs attached to a BB. We are going to
> need it when rewriting bdrv_next() so it no longer uses bdrv_states.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/block-backend.c | 24 ++++++++++++++++++++++++
> include/sysemu/block-backend.h | 1 +
> 2 files changed, 25 insertions(+)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index a918c35..d1621ec 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -269,6 +269,30 @@ BlockBackend *blk_next(BlockBackend *blk)
> }
>
> /*
> + * Iterates over all BlockDriverStates which are attached to a BlockBackend.
> + * This function is for use by bdrv_next().
> + *
> + * @bs must be NULL or a BDS that is attached to a BB.
> + */
> +BlockDriverState *blk_next_root_bs(BlockDriverState *bs)
> +{
> + BlockBackend *blk;
> +
> + if (bs) {
> + assert(bs->blk);
> + blk = bs->blk;
I'm trying to remove bs->blk, and you're adding new instances. :-/
This isn't going to be an easy one to remove. But of course, it wouldn't
be easy for you to avoid it either, so unless you have a good idea,
let's apply this and we'll figure out how to get rid of it again.
> + } else {
> + blk = NULL;
> + }
> +
> + do {
> + blk = blk_all_next(blk);
> + } while (blk && !blk->bs);
> +
> + return blk ? blk->bs : NULL;
> +}
Kevin
- Re: [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del(), (continued)
- [Qemu-devel] [PATCH v3 05/14] block: Add blk_commit_all(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 09/14] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 07/14] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 10/14] block: Add bdrv_next_monitor_owned(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 11/14] block: Add blk_next_root_bs(), Max Reitz, 2016/02/16
- Re: [Qemu-devel] [PATCH v3 11/14] block: Add blk_next_root_bs(),
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 12/14] block: Rewrite bdrv_next(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 13/14] block: Use bdrv_next() instead of bdrv_states, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 14/14] block: Remove bdrv_states list, Max Reitz, 2016/02/16
- Re: [Qemu-devel] [PATCH v3 00/14] blockdev: Further BlockBackend work, Kevin Wolf, 2016/02/17