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

Christophe Fergeau cfergeau at redhat.com
Fri Dec 2 23:38:12 UTC 2011


On Sat, Dec 03, 2011 at 12:11:04AM +0200, Zeeshan Ali (Khattak) wrote:
> On Fri, Dec 2, 2011 at 6:34 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > On Fri, Dec 02, 2011 at 05:34:15PM +0200, Zeeshan Ali (Khattak) wrote:
> >> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> >>
> >> +    if (virStorageVolDelete(vol->priv->handle, flags) < 0) {
> >> +        g_set_error (err,
> >> +                     GVIR_STORAGE_VOL_ERROR,
> >> +                     0,
> >> +                     "Unable to delete storage volume");
> >
> > I think gvir_error_new_literal should be used here
> 
>   g_set_error() checks if error is NULL and doesn't set the error if so.

I know, but gvir_error_new_literal automatically appends the error message
from libvirt so this should be used here. But yeah for now you have to
check for NULL errors by yourself. Or you can wait until the
gvir_set_error_literal patches go in.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111203/e45fd7ad/attachment-0001.sig>


More information about the libvir-list mailing list