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

Re: [Xen-devel] [PATCH 1/4] libxenstat: check xc_interface_open return value



On Wed, Apr 08, 2015 at 04:21:56PM +0100, Andrew Cooper wrote:
> On 08/04/15 16:01, Wei Liu wrote:
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> > Cc: Charles Arnold <carnold@xxxxxxxx>
> 
> The xenstat handle passed around already has an open xc_handle.  That
> should be reused rather than opening a new one every time we want to get
> a list of domain ids.
> 

Yes, you're right. I will use that.

Wei.

> ~Andrew
> 
> > ---
> >  tools/xenstat/libxenstat/src/xenstat_qmp.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c 
> > b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> > index 2cb99e9..f3aeec4 100644
> > --- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
> > +++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> > @@ -366,6 +366,8 @@ static xc_domaininfo_t *get_domain_ids(int *num_doms)
> >     if (dominfo == NULL)
> >             return NULL;
> >     xc_handle = xc_interface_open(0,0,0);
> > +   if (xc_handle == NULL)
> > +           return NULL;
> >     *num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
> >     xc_interface_close(xc_handle);
> >     return dominfo;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.