[libvirt] [libvirt-glib 1/2] Add API to build & start storage pools

Daniel P. Berrange berrange at redhat.com
Thu Oct 27 08:04:03 UTC 2011


On Wed, Oct 26, 2011 at 07:50:53PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> ---
>  libvirt-gobject/libvirt-gobject-storage-pool.c |   44 ++++++++++++++++++++++++
>  libvirt-gobject/libvirt-gobject-storage-pool.h |    8 ++++
>  libvirt-gobject/libvirt-gobject.sym            |    2 +
>  3 files changed, 54 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
> index bd3be94..74ecabc 100644
> --- a/libvirt-gobject/libvirt-gobject-storage-pool.c
> +++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
> @@ -518,3 +518,47 @@ GVirStorageVol *gvir_storage_pool_create_volume
>  
>      return g_object_ref(volume);
>  }
> +
> +/**
> + * gvir_storage_pool_build:
> + * @pool: the storage pool to build
> + * @flags:  the flags
> + * @err: return location for any #GError
> + *
> + * Return value: #True on success, #False otherwise.
> + */
> +gboolean gvir_storage_pool_build (GVirStoragePool *pool,
> +                                  guint64 flags G_GNUC_UNUSED,
> +                                  GError **err)
> +{
> +    if (virStoragePoolBuild(pool->priv->handle, 0)) {

You want to actually pass 'flags' in here, not 0, and remove the
G_GNUC_UNUSED attribute.

> +        *err = gvir_error_new_literal(GVIR_STORAGE_POOL_ERROR,
> +                                      flags,
> +                                      "Failed to build storage pool");
> +        return FALSE;
> +    }
> +
> +    return TRUE;
> +}
> +
> +/**
> + * gvir_storage_pool_start:
> + * @pool: the storage pool to start
> + * @flags:  the flags
> + * @err: return location for any #GError
> + *
> + * Return value: #True on success, #False otherwise.
> + */
> +gboolean gvir_storage_pool_start (GVirStoragePool *pool,
> +                                  guint64 flags G_GNUC_UNUSED,
> +                                  GError **err)
> +{
> +    if (virStoragePoolCreate(pool->priv->handle, 0)) {

Likewise.

ACK with those two bugs fixed

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 :|




More information about the libvir-list mailing list