[libvirt] [PATCH 0/8] Normalization API

Eric Blake eblake at redhat.com
Wed Sep 18 15:38:23 UTC 2013


On 09/18/2013 09:32 AM, Cole Robinson wrote:
> 
> Seems overkill IMO. Do we really need to add an API to facilitate the crappy
> interface that is virsh detach-device? Will any other application ever want to
> use this API?

Yes, I can envision other use cases.  In fact, virt-manager is one of them:

Oftentimes, we add features to XML, but you don't have an easy way to
probe if the feature is supported.  Rather than complicate the (already
large) capabilities xml to call out yet more features, it is rather
simple to write up XML that tries to use the feature, then run it
through the normalizing API, then look at the result.  If the feature is
still present in the output, then libvirt understands the feature (and
you can safely use it); if the feature got stripped as unrecognized,
then you can issue a much nicer error message to the user stating that
the libvirtd on the other end of the connection can't honor the user's
request.

> 
> Why not allow something like
> 
> virsh detach-device --device-number disk:2
> 
> Which will remove the second disk device? It's friendly-ish, easy to extend,
> and simple to implement.

That may be an orthogonal improvement to detach-device, but in no way
diminishes the utility of this proposed API.

-- 
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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130918/176e8481/attachment-0001.sig>


More information about the libvir-list mailing list