Am 22.11.2013 um 06:24 hat Fam Zheng geschrieben: > Similar to drive-backup, but this command uses a device id as target > instead of creating/opening an image file. > > Also add blocker on target bs, since the target is also a named device > now. > > Signed-off-by: Fam Zheng <f...@redhat.com>
> diff --git a/qmp-commands.hx b/qmp-commands.hx > index fba15cd..4116a8d 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -963,6 +963,52 @@ Example: > "sync": "full", > "target": "backup.img" } } > <- { "return": {} } > + > +EQMP > + > + { > + .name = "blockdev-backup", > + .args_type = "sync:s,device:B,target:B,speed:i?," > + "on-source-error:s?,on-target-error:s?", > + .mhandler.cmd_new = qmp_marshal_input_blockdev_backup, > + }, > + > +SQMP > +blockdev-backup > +------------ > + > +The device version of drive-backup: this command takes a existing named > device > +as backup target. > + > +Arguments: > + > +- "device": the name of the device which should be copied. > + (json-string) > +- "target": the target of the new image. If the file exists, or if it is a > + device, the existing file/device will be used as the new > + destination. If it does not exist, a new file will be created. > + (json-string) > +- "sync": what parts of the disk image should be copied to the destination; > + possibilities include "full" for all the disk, "top" for only the sectors > + allocated in the topmost image, or "none" to only replicate new I/O > + (MirrorSyncMode). What happened to the indentation? > +- "mode": whether and how QEMU should create a new image > + (NewImageMode, optional, default 'absolute-paths') "mode" doesn't exist for blockdev-backup. > +- "speed": the maximum speed, in bytes per second (json-int, optional) > +- "on-source-error": the action to take on an error on the source, default > + 'report'. 'stop' and 'enospc' can only be used > + if the block device supports io-status. > + (BlockdevOnError, optional) > +- "on-target-error": the action to take on an error on the target, default > + 'report' (no limitations, since this applies to > + a different block device than device). > + (BlockdevOnError, optional) > + > +Example: > +-> { "execute": "blockdev-backup", "arguments": { "device": "src-id", > + "target": "tgt-id" } } > +<- { "return": {} } > + > EQMP Kevin