On 11/03/2014 02:47 AM, Fam Zheng wrote: > 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. > > Add check and report error for bs == target which became possible but is > an illegal case with introduction of blockdev-backup. > > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > block/backup.c | 28 +++++++++++++++++++++++++++ > blockdev.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ > qapi/block-core.json | 53 > ++++++++++++++++++++++++++++++++++++++++++++++++++++ > qmp-commands.hx | 44 +++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 172 insertions(+) >
> +++ b/qapi/block-core.json > @@ -674,6 +674,40 @@ > '*on-target-error': 'BlockdevOnError' } } > > ## > +# @BlockdevBackup > +# > +# @device: the name of the device which should be copied. > +# > +# @target: the name of the backup target device. > +# > +# @sync: what parts of the disk image should be copied to the destination > +# (all the disk, only the sectors allocated in the topmost image, or > +# only new I/O). > +# > +# @speed: #optional the maximum speed, in bytes per second. Maybe mention 'the default is 0, for unlimited'? > +# > +# @on-source-error: #optional 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 (see BlockInfo). > +# > +# @on-target-error: #optional the action to take on an error on the target, > +# default 'report' (no limitations, since this applies to > +# a different block device than @device). > +# > +# Note that @on-source-error and @on-target-error only affect background I/O. > +# If an error occurs during a guest write request, the device's rerror/werror > +# actions will be used. > +# > +# Since: 2.2 Is 2.2 still the target since this missed soft freeze, or has it slipped to 2.3? Particularly since... > +## > +{ 'type': 'BlockdevBackup', > + 'data': { 'device': 'str', 'target': 'str', > + 'sync': 'MirrorSyncMode', > + '*speed': 'int', > + '*on-source-error': 'BlockdevOnError', > + '*on-target-error': 'BlockdevOnError' } } > + > +## > # @blockdev-snapshot-sync > # > # Generates a synchronous snapshot of a block device. > @@ -793,6 +827,25 @@ > { 'command': 'drive-backup', 'data': 'DriveBackup' } > > ## > +# @blockdev-backup > +# > +# Start a point-in-time copy of a block device to a new destination. The > +# status of ongoing blockdev-backup operations can be checked with > +# query-block-jobs where the BlockJobInfo.type field has the value 'backup'. This reuses the same job type as 'drive-backup'; but that seems okay to me. > +# The operation can be stopped before it has completed using the > +# block-job-cancel command. > +# > +# For the arguments, see the documentation of BlockdevBackup. > +# > +# Returns: Nothing on success. > +# If @device or @target is not a valid block device, DeviceNotFound. > +# > +# Since 2.3 ...you mixed in 2.3 here. > +SQMP > +blockdev-backup > +------------ > + > +The device version of drive-backup: this command takes a existing named > device s/a existing/an existing/ -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature