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 <rudyflyzh...@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
signature.asc
Description: OpenPGP digital signature