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(a)redhat.com>