[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 PATCH 6/6] QAPI: add command for live block com
From: |
Jeff Cody |
Subject: |
Re: [Qemu-devel] [RFC v2 PATCH 6/6] QAPI: add command for live block commit, 'block-commit' |
Date: |
Fri, 31 Aug 2012 10:42:56 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
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
>
- [Qemu-devel] [RFC v2 PATCH 0/6] Live block commit, Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 1/6] block: add support functions for live commit, to find and delete images., Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 2/6] block: add live block commit functionality, Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb, Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 5/6] block: helper function, to find the base image of a chain, Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 6/6] QAPI: add command for live block commit, 'block-commit', Jeff Cody, 2012/08/30
- [Qemu-devel] [RFC v2 PATCH 4/6] qerror: new error for live block commit, QERR_TOP_NOT_FOUND, Jeff Cody, 2012/08/30
- Re: [Qemu-devel] [RFC v2 PATCH 0/6] Live block commit, Jeff Cody, 2012/08/30