On 07/10/2014 08:30 AM, Peter Krempa wrote:
Volume wiping uses external tool to wipe the storage. This will not
work
with purely remote storage as native gluster or RBD. Add a check to
report better error when wiping a remote volume.
Before:
$ virsh vol-wipe --pool glusterpool qcow3
error: Failed to wipe vol qcow3
error: Failed to open storage volume with path
'gluster://gluster-node-1/gv0/qcow3': No such file or directory
After:
$ virsh vol-wipe --pool glusterpool qcow3
error: Failed to wipe vol qcow3
error: Operation not supported: Volume wiping is not supported on non-local storage
Technically, remote wiping MAY be possible (in fact, it may even be MORE
efficient than calling out to external storage - doesn't gluster provide
some APIs to request background file wiping?). But that's where we'd
need per-pool callbacks for handling the request (local storage uses the
existing code, remote storage supplies new callbacks to hook into the
proper wipe protocol for that storage).
I'd feel a bit better if we refactored this function into delegating the
wipe to a _backend.c file callback, and failing when the callback is not
yet defined, rather than open-coding it to be local-only.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org