Re: [libvirt-glib] Add wrapper for volume deletion API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 05, 2011 at 03:21:54PM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> ---
>  libvirt-gobject/libvirt-gobject-storage-vol.c |   25 +++++++++++++++++++++++++
>  libvirt-gobject/libvirt-gobject-storage-vol.h |    4 ++++
>  libvirt-gobject/libvirt-gobject.sym           |    1 +
>  3 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-storage-vol.c b/libvirt-gobject/libvirt-gobject-storage-vol.c
> index 15ae404..0470b4d 100644
> --- a/libvirt-gobject/libvirt-gobject-storage-vol.c
> +++ b/libvirt-gobject/libvirt-gobject-storage-vol.c
> @@ -252,3 +252,28 @@ GVirStorageVolInfo *gvir_storage_vol_get_info(GVirStorageVol *vol,
>  
>      return ret;
>  }
> +
> +/**
> + * gvir_storage_vol_delete:
> + * @vol: the storage volume to delete
> + * @flags: the flags
> + * @err: Return location for errors, or NULL
> + *
> + * Deletes the storage volume @vol.
> + *
> + * Returns: %TRUE on success, %FALSE otherwise
> + */
> +gboolean gvir_storage_vol_delete(GVirStorageVol *vol,
> +                                 guint flags,
> +                                 GError **err)
> +{
> +    if (virStorageVolDelete(vol->priv->handle, flags) < 0) {
> +        if (err)
> +            *err = gvir_error_new_literal(GVIR_STORAGE_VOL_ERROR,
> +                                          0,
> +                                          "Unable to delete storage volume");

You can change these two lines to just


     gvir_set_error_literal(err, ....);

ACK if that change is made before pushing

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]