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

Re: [Xen-devel] [PATCH v2 1/3] libxl: introduce libxl__qmp_query_cpus



On Mon, Jun 13, 2016 at 05:52:14PM +0100, Anthony PERARD wrote:
> On Wed, Jun 08, 2016 at 03:28:44PM +0100, Wei Liu wrote:
> > diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
> > index 3eb279a..23eac92 100644
> > --- a/tools/libxl/libxl_qmp.c
> > +++ b/tools/libxl/libxl_qmp.c
> > @@ -979,6 +979,43 @@ int libxl__qmp_cpu_add(libxl__gc *gc, int domid, int 
> > idx)
> >      return qmp_run_command(gc, domid, "cpu-add", args, NULL, NULL);
> >  }
> >  
> > +static int query_cpus_callback(libxl__qmp_handler *qmp,
> > +                               const libxl__json_object *response,
> > +                               void *opaque)
> > +{
> > +    libxl_bitmap *map = opaque;
> > +    unsigned int i;
> > +    const libxl__json_object *cpu = NULL;
> > +    int rc;
> > +    GC_INIT(qmp->ctx);
> > +
> > +    libxl_bitmap_set_none(map);
> > +    for (i = 0; (cpu = libxl__json_array_get(response, i)); i++) {
> > +        unsigned int idx;
> > +        const libxl__json_object *o;
> > +
> > +        o = libxl__json_map_get("CPU", cpu, JSON_INTEGER);
> > +        if (!o) {
> > +            LOG(ERROR, "Failed to retreive CPU index.");
> 
> rc is still uninitialised at this point.
> 
> Also, s/retreive/retrieve/.
> 

Good catch. I will fix both issues.

Wei.

_______________________________________________
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®.