[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 02/50] list: Expose pool type via virStoragePoolGetInfo

On 07/20/2012 07:23 AM, Daniel P. Berrange wrote:
>> I guess I'm missing something important here... If libvirtd is old enough not
>> to support listAllStoragePools, how it can be new enough to support the new
>> API which would return pool type?
> Yeah, this just doesn't make any sense. All filtering should be done in
> the libvirtd server side for new enough libvirt. Nothing should be done
> client side, for old or new libvirtd.

Not quite true.  For domains and snapshots, we added some client-side
filtering into virsh _in the cases where the filtering was easy using
older API_.  For example, when listing snapshot parents, virsh will do
getXML scraping to determine that information from older libvirt that
lacked virDomainSnapshotGetParent.

The rule of thumb in virsh is that if you can easily determine using
older API (such as dumpxml, O(1) per guest that you are querying)
whether to filter, then when new virsh finds out that it is talking to
an old server that can't do server-side filtering, then virsh can still
do the filtering client-side.  But if the information was not available
in older API, then virsh should fail loudly if the filtering attempt
cannot be honored due to older server.  For example, with snapshots, I
added the ability to filter on whether a snapshot has children, but
getting that information from older API is a prohibitively expensive -
it is O(n^2) API calls per snapshot making filtering an O(n^3) operation
if I were to attempt it on every snapshot, so that is failed instead of
attempting a fallback.

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

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]