On 16/1/22 上午12:39, Eric Blake wrote: > 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.
But I have a question: If I don't want to input a 'format', only use 'bitmap', it will let 'bitmap' as 'format', This problem how to do it. > >> @@ -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/ oh,made a mistake. >> + 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. I have checked these patches,but I ignored these warnings.