On Mon, May 24, 2010 at 08:31:27PM -0300, Eduardo Otubo wrote:
> Hello,
> 
> These two functions, virDrvStorageVolLookupByKey and 
> virDrvStorageVolLookupByPath should use virStoragePoolPtr as parameter 
> instead of virConnectPtr for some few reasons:
> 
> 1) Should follow the standard virStorage*Ptr parameters like the rest of 
> storage related functions.

Nope, this is not correct. Both 'path' and 'key' are intended a unique
identifiers that are independant of a single pool. 

ie if you have a path

  /some/long/path/disk.img

virDrvStorageVolLookupByPath() allows you to find the associated
virStorageVolPtr object without having to know what pool it is
within. Similarly 'key' is intended as a globally unique ID, for
convenience most impls currently just reuse path value for the
key too, but this isn't required & can even be bad. For an NFS
server for example, the key should really be a combination of the
host name + export path + relative path within the export, instead
of the local client path. This ensures the key is unique + stable
even if multiple clients mount the same volume in different places.

Furthermore changing the parameters in these functions would break
the API compatability wrt previous libvirt, which is not allowed.

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to