[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 14/19] block: vmdk image file reopen
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 14/19] block: vmdk image file reopen |
Date: |
Thu, 20 Sep 2012 16:12:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 18.09.2012 20:53, schrieb Jeff Cody:
> This patch supports reopen for VMDK image files. VMDK extents are added
> to the existing reopen queue, so that the transactional model of reopen
> is maintained with multiple image files.
>
> Signed-off-by: Jeff Cody <address@hidden>
> ---
> block/vmdk.c | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/block/vmdk.c b/block/vmdk.c
> index bba4c61..f2e861b 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -300,6 +300,40 @@ static int vmdk_is_cid_valid(BlockDriverState *bs)
> return 1;
> }
>
> +/* Queue extents, if any, for reopen() */
> +static int vmdk_reopen_prepare(BDRVReopenState *state,
> + BlockReopenQueue *queue, Error **errp)
> +{
> + BDRVVmdkState *s;
> + int ret = -1;
> + int i;
> + VmdkExtent *e;
> +
> + assert(state != NULL);
> + assert(state->bs != NULL);
> +
> + if (queue == NULL) {
> + error_set(errp, ERROR_CLASS_GENERIC_ERROR,
> + "No reopen queue for VMDK extents");
> + goto exit;
> + }
> +
> + s = state->bs->opaque;
> +
> + assert(s != NULL);
> +
> + for (i = 0; i < s->num_extents; i++) {
> + e = &s->extents[i];
> + if (e->file != state->bs->file) {
> + bdrv_reopen_queue(queue, e->file, state->flags);
This is wrong, you can't abort the transaction if you do it like this.
VMDK needs to separately pass through each of prepare/commit/abort to
all extents, it can't use the all-in-one function.
Kevin
- [Qemu-devel] [PATCH v3 07/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c, (continued)
- [Qemu-devel] [PATCH v3 07/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 09/19] block: raw-posix image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 10/19] block: raw image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 12/19] block: qcow2 image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 13/19] block: qcow image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 14/19] block: vmdk image file reopen, Jeff Cody, 2012/09/18
- Re: [Qemu-devel] [PATCH v3 14/19] block: vmdk image file reopen,
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 01/19] block: correctly set the keep_read_only flag, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 08/19] block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 17/19] block: vpc image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 15/19] block: raw-win32 driver reopen support, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 11/19] block: qed image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 18/19] block: convert bdrv_commit() to use bdrv_reopen(), Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 02/19] block: make bdrv_set_enable_write_cache() modify open_flags, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 16/19] block: vdi image file reopen, Jeff Cody, 2012/09/18
- [Qemu-devel] [PATCH v3 19/19] block: remove keep_read_only flag from BlockDriverState struct, Jeff Cody, 2012/09/18