[libvirt] [RFC PATCHv2 5/8] threshold: add qemu capability bit

Eric Blake eblake at redhat.com
Mon Jun 15 16:39:51 UTC 2015


On 06/15/2015 07:33 AM, Peter Krempa wrote:
> On Fri, Jun 12, 2015 at 13:29:29 -0600, Eric Blake wrote:
>> Track whether qemu is new enough to do block thresholds on the
>> active layer.  The plan is that even if qemu is too old, the
>> event handler can still be registered, but will never fire (since
> 
> Well the event handler can be registered, but the API for setting the
> actual threshold value should return failure in case when qemu does not
> support it.
> 
>> it is useful to bulk-install handlers); while the request to set
>> a threshold will honor the capability bit and fail up front if it
>> is not possible.

Yes, that's what the second half of the sentence was trying to say. I
can reorder things to make it more obvious:

If qemu is too old, attempts to register a threshold value will return
failure; but the event handler callback can still be registered
successfully (and will just never fire).

>>
>> FIXME:
>> Note that qemu requires that libvirt use a node name and not a
>> device name to actually use the feature.  What's more, a single
>> qcow2 host resource results in two separate qemu nodes (one node
>> for the guest view served by qcow2 protocol, the other node
>> for the underlying host file access), so I'm working on a patch
>> to qemu to automatically name all nodes (rather than having to
>> hack up libvirt to supply two separate node names for a much
>> more complex command line), at which point I'll need code in
>> libvirt to probe the node name that got assigned by qemu.  So
>> I may still need another capability bit for whether qemu is new
>> enough to have the patch to auto-name all nodes.
> 
> Or perhaps just refuse to use this unless qemu is new enough to support
> it?

Yeah, after the weekend, my current work-in-progress is to patch qemu to
auto-name nodes, and to make libvirt refuse to allow threshold settings
unless auto-named nodes are detected in addition to the write-threshold
command, since the qemu auto-name patch can be fairly easy backported by
distros.  It's thus turning into two capability bits, both of which must
be present to use thresholds (but where the callback can be registered
even if either or both capabilities are missing, just that the callback
will never fire in those cases).

-- 
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/20150615/02540ca9/attachment-0001.sig>


More information about the libvir-list mailing list