[libvirt] [PATCH 09/10] qemu: snapshot: Switch snapshot file deletion to the new storage API

Eric Blake eblake at redhat.com
Thu Jan 9 23:45:39 UTC 2014


On 01/09/2014 09:15 AM, Peter Krempa wrote:
> Use the new storage conversion APIs to delete garbage left behind after
> a failed snapshot attempt using the storage driver.
> ---
>  src/qemu/qemu_driver.c | 60 ++++++++++++++++++++++++++++++++++++++------------
>  1 file changed, 46 insertions(+), 14 deletions(-)
> 

>  cleanup:
> -    if (need_unlink && unlink(source))
> -        VIR_WARN("unable to unlink just-created %s", source);
> +    if (need_unlink) {
> +        if (virStorageVolDelete(temppool->vol, 0) < 0) {

YES!  This is where sticking the polymorphism in the storage pool
backends, so that the front-ends call simple wrappers without knowing
whether it wraps unlink() or a complex series of gluster API calls,
proves that we are finally getting the separation of design correct.
There's probably a lot more places where we can/should make use of
ephemeral pools, but this is a step in the right direction.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140109/10ee3110/attachment-0001.sig>


More information about the libvir-list mailing list