qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] block: add-cow support snapshot_blkdev


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/2] block: add-cow support snapshot_blkdev
Date: Wed, 7 Mar 2012 13:10:21 +0000

On Thu, Mar 1, 2012 at 2:49 AM, Dong Xu Wang <address@hidden> wrote:
> From: Dong Xu Wang <address@hidden>
>
> We can not use raw to support snapshot_file, but add-cow can do this.
>
> CC: Marcelo Tosatti <address@hidden>
> CC: Kevin Wolf <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> Signed-off-by: Dong Xu Wang <address@hidden>
> ---
>  blockdev.c              |   53 ++++++++++++++++++++++++++++++++++++++++++----
>  docs/live-block-ops.txt |    8 ++++++-
>  2 files changed, 55 insertions(+), 6 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index d78aa51..c820fcb 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -687,12 +687,55 @@ void qmp_blockdev_snapshot_sync(const char *device, 
> const char *snapshot_file,
>         return;
>     }
>
> -    ret = bdrv_img_create(snapshot_file, format, bs->filename,
> -                          bs->drv->format_name, NULL, -1, flags);
> -    if (ret) {
> -        error_set(errp, QERR_UNDEFINED_ERROR);
> -        return;
> +    if (strcmp(format, "add-cow")) {
> +        ret = bdrv_img_create(snapshot_file, format, bs->filename,
> +                              bs->drv->format_name, NULL, -1, flags);
> +        if (ret) {
> +            error_set(errp, QERR_UNDEFINED_ERROR);
> +            return;
> +        }

I'm confused here because I thought we need three files:
1. The .add-cow file containing the bitmap
2. The cow image file containing allocated sectors
3. The backing file containing the original image

We're only passing in snapshot_file and bs->filename.  How will #2,
the cow file, be created?

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]