[libvirt] [PATCH 3/3] qemu: stats: Display the block threshold size in bulk stats

Eric Blake eblake at redhat.com
Fri Mar 24 17:41:01 UTC 2017


On 03/24/2017 09:51 AM, Peter Krempa wrote:
> On Fri, Mar 24, 2017 at 09:45:14 -0500, Eric Blake wrote:
>> On 03/16/2017 10:29 AM, Peter Krempa wrote:
>>> Management tools may want to check whether the threshold is still set if
>>> they missed an event. Add the data to the bulk stats API where they can
>>> also query the current backing size at the same time.
>>
>> Another way of reading it: the presence of the threshold in the bulk
>> stats means the event has NOT fired yet. If the threshold is absent,
>> either it was never registered, or an event was missed and a (new)
>> threshold needs to be registered.
>>
>>> ---
>>>  src/libvirt-domain.c   |  4 ++++
>>>  src/qemu/qemu_driver.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---
>>>  tools/virsh.pod        |  3 +++
>>>  3 files changed, 55 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
>>> index fd367bcb0..815cbb1e1 100644
>>> --- a/src/libvirt-domain.c
>>> +++ b/src/libvirt-domain.c
>>> @@ -11206,6 +11206,10 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
>>>   *                              backing image as unsigned long long.
>>>   *     "block.<num>.physical" - physical size in bytes of the container of the
>>>   *                              backing image as unsigned long long.
>>> + *     "block.<num>.threshold.storage - current threshold for delivering the
>>
>> Rather long name; would block.<num>.threshold be sufficient?
> 
> I don't mind shortening it. I chose to add the suffix if for some reason
> any user would want to add a threshold for the guest offset (offset in
> the qcow2 write). I don't know if it makes sense though.

Hmm. The API is just SetThreshold, but it has a flags argument so that
we could feasibly set more than one threshold by the use of flags.  Then
again, if we ever do add such a flag, all we have to make sure of is
that names are unique at that point (we can't break any existing names,
but it should be too hard to come up with new names that don't clash,
whether or not the original name is short).  I'm leaning 60-40 towards
the shorter name, but I'll leave it up to you or anyone else that wants
to chime in.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list