On 08/30/2012 07:06 PM, Eric Blake wrote: > On 08/30/2012 11:47 AM, Jeff Cody wrote: >> The command for live block commit is added, which has the following >> arguments: >> >> device: the block device to perform the commit on (mandatory) >> base: the base image to commit into; optional (if not specified, >> it is the underlying original image) >> top: the top image of the commit - all data from inside top down >> to base will be committed into base. optional (if not specified, >> it is the active image) - see note below >> speed: maximum speed, in bytes/sec >> >> note: eventually this will support merging down the active layer, >> but that code is not yet complete. If the active layer is passed >> in currently as top, or top is left to the default, then the error >> QERR_TOP_NOT_FOUND will be returned. >> >> The is done as a block job, so upon completion a BLOCK_JOB_COMPLETED will >> be emitted. > > Likewise, the job can be canceled, and it is possible to track progress > of the job or change the speed on the fly, using existing block job > commands.
Correct. > > Will the BLOCK_JOB_COMPLETED event have a new category listing that it > was a commit job instead of a stream job that completed? That is, I > think this patch is incomplete, and that you also need to modify > QMP/qmp-events.txt to modify the 'type' field of > BLOCK_JOB_{CANCELLED,COMPLETED} to distinguish this new sub-type of event. > You are right, I should add the sub-type info into QMP/qmp-events.txt; the type is 'commit'. Here is what the BLOCK_JOB_COMPLETED event looks like for commit: {"timestamp": {"seconds": 1346423249, "microseconds": 551295}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "virtio0", "len": 6442450944, "offset": 6442450944, "speed": 140732751976032, "type": "commit"}} >> >> ## >> +# @block-commit >> +# >> +# Live commit of data from child image nodes into parent nodes - i.e., >> +# writes data between 'top' and 'base' into 'base'. >> +# >> +# @device: the name of the device >> +# >> +# @base: #optional The parent image of the device to write data into. >> +# If not specified, this is the original parent image. >> +# >> +# @top: #optional The child image, above which data will not be committed >> +# down. If not specified, this is the active layer. >> +# >> +# @speed: #optional the maximum speed, in bytes per second >> +# >> +# Returns: Nothing on success >> +# If commit or stream is already active on this device, DeviceInUse >> +# If @device does not exist, DeviceNotFound >> +# If image commit is not supported by this device, NotSupported >> +# If @base does not exist, BaseNotFound >> +# If @top does not exist, TopNotFound >> +# If @speed is invalid, InvalidParameter >> +# >> +# Since: 1.2 > > 1.3 >