Hi all, In our test, xen-unstable build fails. When running ''make tools'', I got the following error. Do you have the same issue ? xl_cmdimpl.c: In function ''acquire_lock'': xl_cmdimpl.c:202: error: ''O_CLOEXEC'' undeclared (first use in this function) xl_cmdimpl.c:202: error: (Each undeclared identifier is reported only once xl_cmdimpl.c:202: error: for each function it appears in.) my repository is from: http://xenbits.xensource.com/xen-unstable.hg changeset: 23542:23c068b10923 tag: tip user: Andrew Cooper <andrew.cooper3@citrix.com> date: Wed Jun 15 16:16:41 2011 +0100 summary: KEXEC: correctly revert x2apic state when kexecing Best Regards, Yongjie Ren (Jay) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2011-Jun-17 07:01 UTC
Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg
On 06/17/2011 07:29 AM, Ren, Yongjie wrote:> Hi all, > In our test, xen-unstable build fails. When running ''make tools'', I got the following error. Do you have the same issue ? > xl_cmdimpl.c: In function ''acquire_lock'': > xl_cmdimpl.c:202: error: ''O_CLOEXEC'' undeclared (first use in this function) > xl_cmdimpl.c:202: error: (Each undeclared identifier is reported only once > xl_cmdimpl.c:202: error: for each function it appears in.)I''ve just got bitten by that in another repository [1] looks like you use an old distribution (flags that appears in the kernel in 2.6.23). The solution is simple since there''s no need for the atomicity: it consists in removing O_CLOEXEC and switching to fcntl(fd, F_SETFD, FD_CLOEXEC) [1] https://github.com/xen-org/xen-api-libs/commit/523e1c5364e11e0d5bbd5308988c263392df0559 -- Vincent _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Zhang, Yang Z
2011-Jun-17 07:58 UTC
RE: [Xen-devel] make tools ERROR in latest xen-unstable.hg
So, will you submit a patch to fix it? best regards yang> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Vincent > Hanquez > Sent: Friday, June 17, 2011 3:02 PM > To: Ren, Yongjie > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg > > On 06/17/2011 07:29 AM, Ren, Yongjie wrote: > > Hi all, > > In our test, xen-unstable build fails. When running ''make tools'', I got the > following error. Do you have the same issue ? > > xl_cmdimpl.c: In function ''acquire_lock'': > > xl_cmdimpl.c:202: error: ''O_CLOEXEC'' undeclared (first use in this > > function) > > xl_cmdimpl.c:202: error: (Each undeclared identifier is reported only > > once > > xl_cmdimpl.c:202: error: for each function it appears in.) > > I''ve just got bitten by that in another repository [1] looks like you use an old > distribution (flags that appears in the kernel in 2.6.23). > > The solution is simple since there''s no need for the atomicity: it consists in > removing O_CLOEXEC and switching to fcntl(fd, F_SETFD, > FD_CLOEXEC) > > [1] > https://github.com/xen-org/xen-api-libs/commit/523e1c5364e11e0d5bbd5308 > 988c263392df0559 > > -- > Vincent > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2011-Jun-17 08:12 UTC
Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg
On 06/17/2011 08:58 AM, Zhang, Yang Z wrote:> So, will you submit a patch to fix it?I''m not in a position to submit a patch right now, otherwise i would have done so already. So i expect someone else will do it; And the best scenario would be the reporter of the bug, that can actually test the fix to actually do it (specially with guided instructions on how to fix it). -- Vincent _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jun-20 14:29 UTC
Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg [and 1 more messages]
Ren, Yongjie writes ("[Xen-devel] make tools ERROR in latest xen-unstable.hg"):> Hi all, > In our test, xen-unstable build fails. When running ''make tools'', I got the following error. Do you have the same issue ? > xl_cmdimpl.c: In function ''acquire_lock'': > xl_cmdimpl.c:202: error: ''O_CLOEXEC'' undeclared (first use in this function) > xl_cmdimpl.c:202: error: (Each undeclared identifier is reported only once > xl_cmdimpl.c:202: error: for each function it appears in.)Thanks for the report. Vincent Hanquez writes ("Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg"):> I''m not in a position to submit a patch right now, otherwise i would > have done so already. So i expect someone else will do it; And the > best scenario would be the reporter of the bug, that can actually > test the fix to actually do it (specially with guided instructions > on how to fix it).Thanks for the diagnosis etc. Quite so. Yongjie Ren, would you care to propose such a patch ? It shouldn''t be too hard. Remove O_CLOEXEC and add a call to fcntl F_SETFD FD_CLOEXEC; there''s an example in libxl_bootloader.c. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ren, Yongjie
2011-Jun-21 07:28 UTC
[Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c
Hi all, Some old linux kernel such as 2.6.18 which rhel5u5 natively used haven''t defined O_CLOEXEC, so remove O_CLOEXEC in xl_cmdimpl.c Signed-off-by: Yongjie Ren <yongjie.ren@intel.com> diff -r eca057e4475c tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Fri Jun 17 08:08:13 2011 +0100 +++ b/tools/libxl/xl_cmdimpl.c Tue Jun 21 14:37:03 2011 +0800 @@ -199,11 +199,16 @@ fl.l_whence = SEEK_SET; fl.l_start = 0; fl.l_len = 0; - fd_lock = open(lockfile, O_WRONLY|O_CREAT|O_CLOEXEC, S_IWUSR); + fd_lock = open(lockfile, O_WRONLY|O_CREAT, S_IWUSR); if (fd_lock < 0) { fprintf(stderr, "cannot open the lockfile %s errno=%d\n", lockfile, errno); return ERROR_FAIL; } + if (fcntl(fd_lock, F_SETFD, FD_CLOEXEC) < 0) { + close(fd_lock); + fprintf(stderr, "cannot set cloexec to lockfile %s errno=%d\n", lockfile, errno); + return ERROR_FAIL; + } get_lock: rc = fcntl(fd_lock, F_SETLKW, &fl); if (rc < 0 && errno == EINTR) Best Regards, Yongjie Ren (Jay) -----Original Message----- From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com] Sent: Monday, June 20, 2011 10:29 PM To: Vincent Hanquez; Ren, Yongjie Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg [and 1 more messages] Ren, Yongjie writes ("[Xen-devel] make tools ERROR in latest xen-unstable.hg"):> Hi all, > In our test, xen-unstable build fails. When running ''make tools'', I got the following error. Do you have the same issue ? > xl_cmdimpl.c: In function ''acquire_lock'': > xl_cmdimpl.c:202: error: ''O_CLOEXEC'' undeclared (first use in this function) > xl_cmdimpl.c:202: error: (Each undeclared identifier is reported only once > xl_cmdimpl.c:202: error: for each function it appears in.)Thanks for the report. Vincent Hanquez writes ("Re: [Xen-devel] make tools ERROR in latest xen-unstable.hg"):> I''m not in a position to submit a patch right now, otherwise i would > have done so already. So i expect someone else will do it; And the > best scenario would be the reporter of the bug, that can actually > test the fix to actually do it (specially with guided instructions > on how to fix it).Thanks for the diagnosis etc. Quite so. Yongjie Ren, would you care to propose such a patch ? It shouldn''t be too hard. Remove O_CLOEXEC and add a call to fcntl F_SETFD FD_CLOEXEC; there''s an example in libxl_bootloader.c. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jun-21 14:31 UTC
Re: [Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c
Ren, Yongjie writes ("[Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c"):> Hi all, > Some old linux kernel such as 2.6.18 which rhel5u5 natively used haven''t defined O_CLOEXEC, so remove O_CLOEXEC in xl_cmdimpl.c > > Signed-off-by: Yongjie Ren <yongjie.ren@intel.com>Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2011-Jun-21 15:14 UTC
Re: [Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c
The applied version looks like to be a OS specific workaround. NetBSD has O_CLOEXEC. Christoph On 06/21/11 16:31, Ian Jackson wrote:> Ren, Yongjie writes ("[Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c"): >> Hi all, >> Some old linux kernel such as 2.6.18 which rhel5u5 natively>> used haven''t defined O_CLOEXEC, so remove O_CLOEXEC in xl_cmdimpl.c>> >> Signed-off-by: Yongjie Ren<yongjie.ren@intel.com> > > Acked-by: Ian Jackson<ian.jackson@eu.citrix.com> > Committed-by: Ian Jackson<ian.jackson@eu.citrix.com> > > Thanks, > Ian. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >-- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jun-21 15:20 UTC
Re: [Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c
Christoph Egger writes ("Re: [Xen-devel] [PATCH] tools/libxl: remove O_CLOEXEC in xl_cmdimpl.c"):> > The applied version looks like to be a OS specific workaround.I''m not sure what you mean. O_CLOEXEC is not universally available, so avoiding it where possible is a good thing.> NetBSD has O_CLOEXEC.How is that relevant ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel