All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: ian.jackson@eu.citrix.com, Ian Campbell <Ian.Campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v6 00/18] libxl: JSON infrastructure, fixes and prerequisite patches for new API
Date: Tue, 10 Jun 2014 17:38:13 -0400	[thread overview]
Message-ID: <53977AC5.2010709@oracle.com> (raw)
In-Reply-To: <20140610212140.GB8470@zion.uk.xensource.com>

On 06/10/2014 05:21 PM, Wei Liu wrote:
> On Tue, Jun 10, 2014 at 04:51:35PM -0400, Boris Ostrovsky wrote:
>> On 06/10/2014 04:10 PM, Boris Ostrovsky wrote:
>>> On 06/10/2014 10:14 AM, Ian Campbell wrote:
>>>> On Mon, 2014-06-09 at 13:43 +0100, Wei Liu wrote:
>>>>> Wei Liu (18):
>>>>>   A libxl: make cpupool_qualifier_to_cpupoolid a library function
>>>> Applied.
>>>>>   A xl: remove parsing of "vncviewer" option in xl domain config file
>>>> Applied.
>>>>
>>>>>   M libxl: fix JSON generator for uint64_t
>>>> Acked + applied.
>>>>
>>>>>   A libxl IDL: rename json_fn to json_gen_fn
>>>>>   A libxl_json: introduce libxl__object_from_json
>>>>>   A libxl_json: introduce parser functions for builtin types
>>> The last one breaks on older gcc:
>>>
>>> In file included from flexarray.c:16:
>>> libxl_internal.h:136: error: redefinition of typedef ‘libxl__gc’
>>> libxl_json.h:25: note: previous declaration of ‘libxl__gc’ was here
>>> In file included from flexarray.c:16:
>>> libxl_internal.h:1641: error: redefinition of typedef ‘libxl__json_object’
>>> libxl_json.h:26: note: previous declaration of ‘libxl__json_object’ was
>>> here
>>> make[4]: *** [flexarray.o] Error 1
>>>
>>>
>>> Looks like at some point gcc started allowing multiple typedefs. So, for
>>> example:
>> And this is apparently that point (for version 4.6, I believe):
>>
>> https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ce3765bf44e49ef0568a1ad4a0b7f807591d6412
>>
>>
>> -boris
> Thanks for reporting. Now that I notice these functions really belong to
> libxl_internal.h.
>
> Does this patch fix it for you?

Yes, it allows me to build libxl. I can't test it right now but will do 
it tomorrow.

Thanks.
-boris

>
> Wei.
>
> ---8<---
>  From 5a57f827f644f716b3748beec0214bbefddda4b6 Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Tue, 10 Jun 2014 22:16:14 +0100
> Subject: [PATCH] libxl: move some internal functions to libxl_internal.h
>
> In 752f181f ("libxl_json: introduce parser functions for builtin types")
> a bunch of parser functions are added to libxl_json.h, which breaks
> GCC < 4.6.
>
> These functions are internal and libxl_json.h is public header, so move
> them to libxl_internal.h.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
>   tools/libxl/libxl_internal.h |   32 ++++++++++++++++++++++++++++++++
>   tools/libxl/libxl_json.h     |   35 -----------------------------------
>   2 files changed, 32 insertions(+), 35 deletions(-)
>
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 80ea883..a0d4f24 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -3147,6 +3147,38 @@ void libxl__numa_candidate_put_nodemap(libxl__gc *gc,
>    */
>   #define CTYPE(isfoo,c) (isfoo((unsigned char)(c)))
>   
> +int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             libxl_defbool *p);
> +int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                           bool *p);
> +int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                         libxl_mac *p);
> +int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                            libxl_bitmap *p);
> +int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                          libxl_uuid *p);
> +int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
> +                                       const libxl__json_object *o,
> +                                       libxl_cpuid_policy_list *p);
> +int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                                 libxl_string_list *p);
> +int libxl_key_value_list_parse_json(libxl__gc *gc,
> +                                    const libxl__json_object *o,
> +                                    libxl_key_value_list *p);
> +int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                           libxl_hwcap *p);
> +int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                          void *p);
> +int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                            void *p);
> +int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             void *p);
> +int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             void *p);
> +int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             void *p);
> +int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
> +                             char **p);
>   
>   #endif
>   
> diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
> index b196c1c..e4c0f6c 100644
> --- a/tools/libxl/libxl_json.h
> +++ b/tools/libxl/libxl_json.h
> @@ -22,52 +22,17 @@
>   #  include <yajl/yajl_version.h>
>   #endif
>   
> -typedef struct libxl__gc libxl__gc;
> -typedef struct libxl__json_object libxl__json_object;
> -
>   yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
>   yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
> -int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                             libxl_defbool *p);
> -int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                           bool *p);
>   yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
> -int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                          libxl_uuid *p);
>   yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
> -int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                         libxl_mac *p);
>   yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand, libxl_bitmap *p);
> -int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                            libxl_bitmap *p);
>   yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
>                                                    libxl_cpuid_policy_list *p);
> -int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
> -                                       const libxl__json_object *o,
> -                                       libxl_cpuid_policy_list *p);
>   yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
> -int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                                 libxl_string_list *p);
>   yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
>                                                 libxl_key_value_list *p);
> -int libxl_key_value_list_parse_json(libxl__gc *gc,
> -                                    const libxl__json_object *o,
> -                                    libxl_key_value_list *p);
>   yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
> -int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                           libxl_hwcap *p);
> -int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                          void *p);
> -int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                            void *p);
> -int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                             void *p);
> -int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                             void *p);
> -int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                             void *p);
> -int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
> -                             char **p);
>   
>   #include <_libxl_types_json.h>
>   


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

  reply	other threads:[~2014-06-10 21:38 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 12:43 [PATCH v6 00/18] libxl: JSON infrastructure, fixes and prerequisite patches for new API Wei Liu
2014-06-09 12:43 ` [PATCH v6 01/18] libxl: make cpupool_qualifier_to_cpupoolid a library function Wei Liu
2014-06-09 12:43 ` [PATCH v6 02/18] xl / libxl: push parsing of SSID and CPU pool ID down to libxl Wei Liu
2014-06-10 12:57   ` Ian Campbell
2014-06-10 14:16     ` Wei Liu
2014-06-09 12:43 ` [PATCH v6 03/18] xl / libxl: push VCPU affinity pinning " Wei Liu
2014-06-09 12:53   ` Wei Liu
2014-06-10  6:59   ` Dario Faggioli
2014-06-10  8:09     ` Wei Liu
2014-06-10 13:01       ` Ian Campbell
2014-06-10 13:09         ` Dario Faggioli
2014-06-10 13:46           ` Wei Liu
2014-06-10 14:01   ` Ian Campbell
2014-06-10 14:06     ` Wei Liu
2014-06-10 15:59       ` Dario Faggioli
2014-06-09 12:43 ` [PATCH v6 04/18] libxl: libxl_uuid_copy now takes a ctx argument Wei Liu
2014-06-10 13:05   ` Ian Campbell
2014-06-10 13:55     ` Wei Liu
2014-06-09 12:43 ` [PATCH v6 05/18] xl: remove parsing of "vncviewer" option in xl domain config file Wei Liu
2014-06-09 12:43 ` [PATCH v6 06/18] libxl: fix JSON generator for uint64_t Wei Liu
2014-06-09 12:43 ` [PATCH v6 07/18] libxl IDL: rename json_fn to json_gen_fn Wei Liu
2014-06-09 12:43 ` [PATCH v6 08/18] libxl_json: introduce libxl__object_from_json Wei Liu
2014-06-09 12:43 ` [PATCH v6 09/18] libxl_json: introduce parser functions for builtin types Wei Liu
2014-06-09 12:43 ` [PATCH v6 10/18] libxl/gentypes.py: special-case KeyedUnion map handle generation Wei Liu
2014-06-09 12:43 ` [PATCH v6 11/18] libxl/gentypes.py: don't generate default values Wei Liu
2014-06-10 13:25   ` Ian Campbell
2014-06-10 13:43     ` Wei Liu
2014-06-10 14:31       ` Wei Liu
2014-06-10 14:56       ` Ian Campbell
2014-06-10 15:49         ` Wei Liu
2014-06-10 15:54           ` Ian Campbell
2014-06-10 15:59             ` Wei Liu
2014-06-09 12:43 ` [PATCH v6 12/18] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct Wei Liu
2014-06-10 13:32   ` Ian Campbell
2014-06-09 12:43 ` [PATCH v6 13/18] libxl/gentest.py: test JSON parser Wei Liu
2014-06-09 12:43 ` [PATCH v6 14/18] libxl: introduce libxl_key_value_list_length Wei Liu
2014-06-09 12:43 ` [PATCH v6 15/18] libxl: introduce libxl_cpuid_policy_list_length Wei Liu
2014-06-09 12:43 ` [PATCH v6 16/18] libxl: copy function for builtin types Wei Liu
2014-06-09 12:43 ` [PATCH v6 17/18] libxl IDL: generate deep copy functions Wei Liu
2014-06-09 12:43 ` [PATCH v6 18/18] libxl/gentest.py: test " Wei Liu
2014-06-10 14:14 ` [PATCH v6 00/18] libxl: JSON infrastructure, fixes and prerequisite patches for new API Ian Campbell
2014-06-10 20:10   ` Boris Ostrovsky
2014-06-10 20:51     ` Boris Ostrovsky
2014-06-10 21:21       ` Wei Liu
2014-06-10 21:38         ` Boris Ostrovsky [this message]
2014-06-10 21:42           ` Wei Liu
2014-06-11  8:47         ` Ian Campbell
2014-06-11  8:53           ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53977AC5.2010709@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.