qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-img rebase: allow empty file name as new b


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] qemu-img rebase: allow empty file name as new backing file to mean rebase with no backing file [attempt 2]
Date: Mon, 15 Oct 2012 14:44:59 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0

On 10/15/2012 02:23 PM, Alex Bligh wrote:

Rather long on the subject line; 'git shortlog -30' will give you a
taste for typical commit summary length.  Also, you will usually see
[PATCHv2] as the prefix, rather than [PATCH]...[attempt 2] as a suffix,
since 'git am' only strips a [] prefix.  It might be better as:

qemu-img rebase: use empty string to rebase without backing file

> This patch allows an empty filename to be passed as the new base image name
> for qemu-img rebase to mean base the image on no backing file (i.e.
> independent of any backing file). According to Eric Blake, qemu-imag rebase

s/qemu-imag/qemu-img/

> already supports this when '-u' is used; this adds support when -u is not
> used.
> 
> Signed-off-by: Alex Bligh <address@hidden>
> ---

> @@ -1675,7 +1677,11 @@ static int img_rebase(int argc, char **argv)
>       * backing file are overwritten in the COW file now, so the visible 
> content
>       * doesn't change when we switch the backing file.
>       */
> -    ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt);
> +    if (bs_new_backing)
> +        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt);
> +    else
> +        ret = bdrv_change_backing_file(bs, NULL, NULL);

Should we error out if the user specifies basefmt but gives the empty
string, instead of silently ignoring the bogus basefmt?  But that's
bikeshedding, I can live with what you wrote.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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