[libvirt] [PATCH]: Allow arbitrary paths to virStorageVolLookupByPath
Chris Lalancette
clalance at redhat.com
Fri Oct 31 11:58:17 UTC 2008
Daniel P. Berrange wrote:
>> Personally, I think those are bad semantics for virStorageBackendStablePath;
>> assuming it succeeds, you should always be able to know that you have a copy,
>> regardless of whether the copy is the same as the original. Should I change
>> virStorageBackendStablePath to those semantics, in which case your below code
>> would then be correct?
>
> Yes, I think that's worth doing - will also avoid the cast in the input
> arg there
OK, updated patch attached; virStorageBackendStablePath now always returns a
copy of the given string, so it's always safe to unconditionally VIR_FREE it. I
fixed up storage_backend_iscsi and storage_backend_disk to reflect this change.
I also re-worked the code as you suggested, and added a bit more error checking.
Signed-off-by: Chris Lalancette <clalance at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-stable-path-v2.patch
Type: text/x-patch
Size: 5965 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081031/88886c42/attachment-0001.bin>
More information about the libvir-list
mailing list