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

Re: [XEN PATCH 1/8] libxl: Replace deprecated QMP command by "query-cpus-fast"


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Mon, 10 May 2021 15:11:51 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 10 May 2021 14:12:13 +0000
  • Ironport-hdrordr: A9a23:JXJ6iKON47aMQ8BcT+j155DYdb4zR+YMi2TDiHoddfUFSKalfp 6V98jzjSWE8wr4WBkb6LO90dq7MAnhHP9OkMMs1NKZMDUO11HYS72KgbGC/9SkIVyHygc/79 YsT0EdMqyXMbESt6+Tj2eF+pQbsaC6GcuT9IXjJgJWPGVXgtZbnmJE42igcnFedU1jP94UBZ Cc7s1Iq36LYnIMdPm2AXEDQqzqu8DLvIiOW29IOzcXrC21yR+44r/zFBaVmj0EVSlU/Lsk+W /Z1yTk+6SYte2hwBO07R6c030Woqqh9jJwPr3OtiEnEESvtu9uXvUlZ1S2hkF0nAho0idvrD CDmWZmAy050QKtQoj8m2qQ5+Cn6kdj15aq8y7mvVLz5cP+Xz40EMxHmMZQdQbY8VMpuJVm3L tMxH/xjeseMfrsplWK2zHzbWAiqqN0mwtWrQcZtQ0VbWLfUs4nkWU7xjImLH4tJlOL1GkXKp gbMCiH3ocmTbqzVQGrgoBA+q3TYkgO
  • Ironport-sdr: n7bSBdCyQwfHk/3PDV3oYgiLJyW8IXSq9kHfA3ZhtULPEr7h4erOPB3JU3iMAcmdltBXWJjZMV oDingFHCqkM5cEAXQKBS+AYi2addZi48M/QePn33E4snwTgzG3/Vp4xrz2xnFi5Eu28qiYv4Hh 8SXr8T06kTjZ2AJcbcUb3fb6IOcB4RtihBYHDxGIFpoyLeVN+gZhJBzil9tXS4oShTLU5dGHkO j4QuldtMLMVEfJ0IvHVDlB5PBnQQVfvklYss7f0ji+iPCvat3xbfCuY5Jxn2dEpt1yGMJ8OxOw gV0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 28, 2021 at 12:53:12PM -0400, Jason Andryuk wrote:
> On Fri, Apr 23, 2021 at 12:16 PM Anthony PERARD <anthony.perard@xxxxxxxxxx> 
> wrote:
> > +static int qmp_parse_query_cpus_fast(libxl__gc *gc,
> > +                                     libxl_domid domid,
> > +                                     const libxl__json_object *response,
> > +                                     libxl_bitmap *const map)
> > +{
> > +    int i;
> > +    const libxl__json_object *cpu;
> > +
> > +    libxl_bitmap_set_none(map);
> > +    /* Parse response to QMP command "query-cpus-fast":
> > +     * [ { 'cpu-index': 'int',...} ]
> > +     */
> > +    for (i = 0; (cpu = libxl__json_array_get(response, i)); i++) {
> > +        unsigned int cpu_index;
> > +        const libxl__json_object *o;
> > +
> > +        o = libxl__json_map_get("cpu-index", cpu, JSON_INTEGER);
> 
> Looks like qmp_parse_query_cpus_fast and qmp_parse_query_cpus just
> differ by the key string.  So you could pass it in as an argument -
> maybe with qmp_parse_query_cpus_fast and qmp_parse_query_cpus as
> wrappers around a common implementation?
> 
> But if you prefer this separate function, it's fine.

I think it's better to have two different functions because we are
parsing two different commands, even if they are very similar.

> Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

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