qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] hmp: add hmp command for incremental backup


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/2] hmp: add hmp command for incremental backup
Date: Thu, 21 Jan 2016 09:39:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 01/21/2016 04:22 AM, Rudy Zhang wrote:
> Add hmp command for incremental backup in drive-backup.
> It need a bitmap to backup data from drive-image to incremental image,
> so before it need add bitmap for this device to track io.
> Usage:
>       drive_backup [-n] [-f] device target [bitmap] [format]
> 
> Signed-off-by: Rudy Zhang <address@hidden>
> ---
>  hmp-commands.hx |  5 +++--
>  hmp.c           | 16 ++++++++++++++--
>  2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index bb52e4d..7378aaa 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1180,12 +1180,13 @@ ETEXI
>  
>      {
>          .name       = "drive_backup",
> -        .args_type  = "reuse:-n,full:-f,device:B,target:s,format:s?",
> -        .params     = "[-n] [-f] device target [format]",
> +        .args_type  = 
> "reuse:-n,full:-f,device:B,target:s,bitmap:s?,format:s?",
> +        .params     = "[-n] [-f] device target [bitmap] [format]",

This is HMP, so it may not matter, but this is not backwards compatible.
 Scripts targetting the old style of passing a format will now have that
format string interpreted as a bitmap name with no format.  Better would
be to stick [bitmap] at the end, not the middle.


> @@ -1098,6 +1100,17 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
>          return;
>      }
>  
> +    if (full && bitmap) {
> +        error_setg(&err, "Parameter 'bitmap' if conflict with '-f'");

s/if conflict/conflicts/

> +        hmp_handle_error(mon, &err);
> +        return;
> +    } else if (full)
> +        sync = MIRROR_SYNC_MODE_FULL;

Needs {}.  Run your patch through scripts/checkpatch.pl, to flag this
and other style violations.

-- 
Eric Blake   eblake redhat com    +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]