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

[Xen-devel] [PATCH] libxl: fix generating array of enums in getypes.py



From: Oleksandr Grytsov <oleksandr_grytsov@xxxxxxxx>

There is an issue with gentypes.py when using array of enums:

for (i=0; (t=libxl__json_array_get(x,i)); i++) {
    {
        const char *enum_str;
        if (!libxl__json_object_is_string(x)) {
            rc = -1;
            goto out;
        }
        enum_str = libxl__json_object_get_string(x);
        rc = libxl_vsnd_pcm_format_from_string(enum_str, &p->sample_formats[i]);
        if (rc)
            goto out;
    }
}

In above code x is an array and as result condition
if (!libxl__json_object_is_string(x)) fails.

The fix is to put "t" instead of "x" when the enum
is parsed from array.

Oleksandr Grytsov (1):
  libxl: fix generating array of enums in getypes.py

 tools/libxl/gentypes.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.7.4


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

 


Rackspace

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