[libvirt] [PATCHv6 08/11] qemu: bulk stats: add block allocation information

Peter Krempa pkrempa at redhat.com
Wed Sep 17 16:20:31 UTC 2014


On 09/17/14 00:37, Eric Blake wrote:
> On 09/15/2014 09:42 AM, Peter Krempa wrote:
>> From: Francesco Romani <fromani at redhat.com>
>>
>> Management software wants to be able to allocate disk space on demand.
>> To support this they need keep track of the space occupation of the
>> block device.  This information is reported by qemu as part of block
>> stats.
>>
>> This patch extend the block information in the bulk stats with the
>> allocation information.
>>
>> To keep the same behaviour a helper is extracted from
>> qemuMonitorJSONGetBlockExtent in order to get per-device allocation
>> information.
>>
>> Signed-off-by: Francesco Romani <fromani at redhat.com>
>> ---
>>  src/libvirt.c                |  2 +
>>  src/qemu/qemu_driver.c       | 18 +++++++++
>>  src/qemu/qemu_monitor.h      |  1 +
>>  src/qemu/qemu_monitor_json.c | 91 ++++++++++++++++++++++++++++++++++----------
>>  4 files changed, 92 insertions(+), 20 deletions(-)
>>
>> diff --git a/src/libvirt.c b/src/libvirt.c
>> index ab10a3a..a8892a2 100644
>> --- a/src/libvirt.c
>> +++ b/src/libvirt.c
>> @@ -21654,6 +21654,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
>>   *                          unsigned long long.
>>   * "block.<num>.errors" - Xen only: the 'oo_req' value as
>>   *                        unsigned long long.
>> + * "block.<num>.allocation" - offset of the highest written sector
>> + *                            as unsigned long long.
> 
> If we are repeating virDomainGetBlockInfo() here, I'd rather see us
> report all 3 pieces of information (allocation, capacity, physical)
> instead of just one.
> 
>> +typedef enum {
>> +    QEMU_MONITOR_BLOCK_EXTENT_ERROR_OK,
>> +    QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOPARENT,
>> +    QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOSTATS,
>> +    QEMU_MONITOR_BLOCK_EXTENT_ERROR_NOOFFSET
>> +} qemuMonitorBlockExtentError;
> 
> We require C99, so please have a trailing comma in the enum (it makes
> adding new elements easier, because they don't have to modify an
> existing line).
> 

Thanks for the reviews, I've pushed this series with the changes you've
suggested except this patch as either I or Francesco will add the
requested fields.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140917/9bf896ef/attachment-0001.sig>


More information about the libvir-list mailing list