[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 24/39] blockdev: Do not create BDS for empty
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive |
Date: |
Wed, 14 Oct 2015 15:27:05 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 12.10.2015 um 22:00 hat Max Reitz geschrieben:
> Do not use "rudimentary" BDSs for empty drives any longer (for
> freshly created drives).
>
> After a follow-up patch, empty drives will generally use a NULL BDS, not
> only the freshly created drives.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> blockdev.c | 72
> ++++++++++++++++++++++++++++++++++++++------------------------
> 1 file changed, 44 insertions(+), 28 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 35efe84..845a1c1 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -514,16 +514,44 @@ static BlockBackend *blockdev_init(const char *file,
> QDict *bs_opts,
> goto early_err;
> }
>
> + if (snapshot) {
> + /* always use cache=unsafe with snapshot */
> + bdrv_flags &= ~BDRV_O_CACHE_MASK;
> + bdrv_flags |= (BDRV_O_SNAPSHOT|BDRV_O_CACHE_WB|BDRV_O_NO_FLUSH);
> + }
> +
> + if (copy_on_read) {
> + bdrv_flags |= BDRV_O_COPY_ON_READ;
> + }
> +
> + if (runstate_check(RUN_STATE_INMIGRATE)) {
> + bdrv_flags |= BDRV_O_INCOMING;
> + }
Bad conflict resolution when you added patch 2, which moved the
BDRV_O_INCOMING code to block.c?
That patch is actually essential here as well: The flag would ends up in
the root state, and bdrv_invalidate_cache_all() doesn't clear the flag
any more. So we might end up opening an image with BDRV_O_INCOMING even
though migration has long finished.
Kevin
- [Qemu-devel] [PATCH v6 11/39] hw/usb-storage: Check whether BB is inserted, (continued)
- [Qemu-devel] [PATCH v6 11/39] hw/usb-storage: Check whether BB is inserted, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 12/39] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 13/39] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 15/39] block: Move BlockAcctStats into BlockBackend, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 16/39] block: Move I/O status and error actions into BB, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 17/39] block/throttle-groups: Make incref/decref public, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 19/39] block: Make some BB functions fall back to BBRS, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 18/39] block: Add BlockBackendRootState, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 20/39] block: Fail requests to empty BlockBackend, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive, Max Reitz, 2015/10/12
- Re: [Qemu-devel] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive,
Kevin Wolf <=
- [Qemu-devel] [PATCH v6 23/39] block: Prepare for NULL BDS, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 25/39] blockdev: Pull out blockdev option extraction, Max Reitz, 2015/10/12
- [Qemu-devel] [PATCH v6 26/39] blockdev: Allow more options for BB-less BDS tree, Max Reitz, 2015/10/12