From: Ian Campbell <ian.campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, Olaf Hering <olaf@aepfle.de>
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxc: Provide evtchn_port_or_error_t for compat xenctrl interface
Date: Thu, 4 Feb 2016 09:27:28 +0000 [thread overview]
Message-ID: <1454578048.25207.129.camel@citrix.com> (raw)
In-Reply-To: <56B23651.8070503@citrix.com>
On Wed, 2016-02-03 at 17:18 +0000, Andrew Cooper wrote:
> On 03/02/16 17:12, Olaf Hering wrote:
> > On Mon, Feb 01, Andrew Cooper wrote:
> >
> > > c/s 2d2f789 "tools: rename libxc's evtchn_port_or_error_t with an xc_
> > > prefix" doesn't cater for older applications which have requested
> > > XC_WANT_COMPAT_EVTCHN_API
> > Not sure, but I think this breaks staging at last in SLES11:
> >
> > [ 93s] gcc -DPIC -O1 -fno-omit-frame-pointer -m64 -fno-strict-
> > aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-
> > statement -O0 -g3 -D__XEN_TOOLS__ -MMD -MF .xc_evtchn_compat.opic.d
> > -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls
> > -D_GNU_SOURCE -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-
> > protector -funwind-tables -fasynchronous-unwind-tables
> > -I../../xen/common/libelf -Werror -Wmissing-prototypes -I. -I./include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -pthread
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/toollog/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -I/usr/src/packages/BUILD/xen-
> > 4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/evtchn/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -include
> > /usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/config.h -I/usr/src/packages/BUILD/xen-
> > 4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/call/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -I/usr/src/packages/BUILD/xen-
> > 4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/foreignmemory/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -I/usr/src/packages/BUILD/xen-
> > 4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/gnttab/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -I/usr/src/packages/BUILD/xen-
> > 4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/gnttab/include
> > -I/usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/include -fPIC -c -o xc_evtchn_compat.opic
> > xc_evtchn_compat.c
> > [ 93s] In file included from ./include/xenctrl.h:2577,
> > [ 93s] from xc_evtchn_compat.c:9:
> > [ 93s] ./include/xenctrl_compat.h:54: error: redefinition of typedef
> > 'evtchn_port_or_error_t'
> > [ 93s] /usr/src/packages/BUILD/xen-4.7.20160203T131200.be05b53/non-
> > dbg/tools/libxc/../../tools/libs/evtchn/include/xenevtchn.h:31: error:
> > previous declaration of 'evtchn_port_or_error_t' was here
> > [ 93s] make[4]: *** [xc_evtchn_compat.opic] Error 1
> >
> > Olaf
>
> Urgh. This is getting even more complicated.
>
> This patch is needed to avoid breaking the build for older programs
> using just
>
> #define XC_WANT_COMPAT_EVTCHN_API
> #include <xenctrl.h>
>
> so simply reverting it isn't a viable option either.
>
> Is there any way in C to determine whether a typedef already exists?
Not AFAIK.
A common trick is
#ifndef type_t
#define type_t type_t
typedef int type_t;
#endif
But I think what I'll do instead is have xc_evtchn_compat.c
#define XC_BUILDING_COMPAT_EVTCHN_API and have xc_compat_evtchn.h DTRT
based on that. There's a similar construct
in XC_BUILDING_COMPAT_MAP_FOREIGN_API (although for different reasons).
Patch forthcoming.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-02-04 9:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 11:08 [PATCH] tools/libxc: Provide evtchn_port_or_error_t for compat xenctrl interface Andrew Cooper
2016-02-01 11:19 ` Ian Campbell
2016-02-03 11:48 ` Ian Campbell
2016-02-03 17:12 ` Olaf Hering
2016-02-03 17:18 ` Andrew Cooper
2016-02-04 9:27 ` Ian Campbell [this message]
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=1454578048.25207.129.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=olaf@aepfle.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).