[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] [PATCH] phyp: first part of storage management driver
- From: Stefan Berger <stefanb us ibm com>
- To: otubo linux vnet ibm com
- Cc: libvirt <libvir-list redhat com>, libvir-list-bounces redhat com
- Subject: Re: [libvirt] [PATCH] phyp: first part of storage management driver
- Date: Mon, 24 May 2010 20:27:52 -0400
Eduardo Otubo <otubo linux vnet ibm com> wrote
on 05/18/2010 05:01:40 PM:
> Please respond to otubo
>
> On 05/14/2010 05:27 PM, Stefan Berger wrote:
> > > +
> > > +virStoragePoolPtr
> > > +phypSPLookupByName(virConnectPtr conn, const char
*sp_name)
> > > +{
> > > + virStoragePoolPtr sp = NULL;
> > > + int sp_id = 0;
> > > + unsigned char sp_uuid[VIR_UUID_BUFLEN];
> > > +
> > > + sp_id = phypGetStoragePoolID(sp_name, conn);
> > > + if (sp_id == -1)
> > > + return NULL;
> > > +
> > > + if (phypGetStoragePoolUUID(sp_uuid, sp_name, conn)
== -1)
> > > + return NULL;
> > > +
> > > + sp = virGetStoragePool(conn, sp_name, sp_uuid);
> > > +
> > > + if (sp)
> > > + return sp;
> > > + else
> > > + return NULL;
> >
> > Doesn't seem necessary to do if - then here.
> >
> > Just a 'return sp;' should do the trick.
> >
Above the old.
> >
>
>
> Thanks for all the comments.
>
> The following patch fixes the mistakes pointed by you and add a new
> function. Now the pHyp Storage Driver is able to pool-dumpxml also.
>
[...]
> +
> +virStoragePoolPtr
> +phypSPLookupByName(virConnectPtr conn, const char *name)
> +{
> + virStoragePoolPtr sp = NULL;
> + unsigned char uuid[VIR_UUID_BUFLEN];
> +
> + if (phypGetStoragePoolUUID(conn, uuid, name) == -1)
> + return NULL;
> +
> + sp = virGetStoragePool(conn, name, uuid);
> +
> + if (sp)
> + return sp;
> + else
> + return NULL;
> +}
Here the new. Is it really necessary to have an if
statement here ?
Stefan
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]