All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Rudy Zhang <rudyflyzhang@gmail.com>, qemu-devel@nongnu.org
Cc: famz@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] hmp: add hmp command for incremental backup
Date: Thu, 21 Jan 2016 09:39:45 -0700	[thread overview]
Message-ID: <56A109D1.4000701@redhat.com> (raw)
In-Reply-To: <1453375338-13508-2-git-send-email-rudyflyzhang@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

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 <rudyflyzhang@gmail.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-01-21 16:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 11:22 [Qemu-devel] [PATCH 0/2] block/hmp: add sereval hmp commands for incremental backup Rudy Zhang
2016-01-21 11:22 ` [Qemu-devel] [PATCH 1/2] hmp: add hmp command " Rudy Zhang
2016-01-21 16:39   ` Eric Blake [this message]
2016-01-21 20:47     ` [Qemu-devel] [Qemu-block] " John Snow
2016-01-22  2:04     ` [Qemu-devel] " 张敏
2016-01-22 16:39       ` Eric Blake
2016-01-21 11:22 ` [Qemu-devel] [PATCH 2/2] hmp: add hmp commands dirty bitmap add/clear/remove' Rudy Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A109D1.4000701@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rudyflyzhang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.