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

Re: [Xen-devel] [PATCH V4 09/24] libxl_json: introduce parser functions for builtin types



On Tue, May 06, 2014 at 04:42:20PM +0100, Wei Liu wrote:
[...]
> +
> +int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             void *p)
> +{
> +    if (!libxl__json_object_is_integer(o) &&
> +        !libxl__json_object_is_number(o))
> +        return ERROR_FAIL;
> +
> +    if (libxl__json_object_is_integer(o)) {
> +        long long i = libxl__json_object_get_integer(o);
> +
> +        if (i < 0)
> +            return ERROR_FAIL;
> +

Just found out that current API will generate -1 for some fields (say,
video_memkb), so we have to loosen this check.

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