All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 2/2] libxl: fix build (missing CLONE_NEWIPC) on astonishingly old systems
Date: Fri, 11 Jan 2019 19:23:28 +0000	[thread overview]
Message-ID: <20190111192328.25242-1-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <20190111182706.GA2199@perard.uk.xensource.com>

CLONE_NEWIPC was introduced in Linux 2.6.19, on the 29th of November
2006, which was 12 years, 1 month, and 14 days ago.

Nevertheless apparently some people are trying to build Xen on systems
whose kernel headers are that old.  Placate these people by providing
a fallback #define for CLONE_NEWIPC.

The actual binary value will of course remain constant, because of the
kernel API promise, so this is and will be correct on all platforms
where the CLONE_NEWIPC is supported.  (Even if for some reason we miss
the right #includes.)

Of course at runtime this value will not work on older kernels.  It
will be rejected as unknown.  However on those kernels we do not want
to support dm_restrict, and an attempt to use it will fail.  It is OK
for the failure to be a messy EINVAL syscall failure.  (The IPC
namespace unshare is necessary to avoid a suborned deprivileged qemu
from causing trouble with shm, sem, etc.)

CC: Wei Liu <wei.liu2@citrix.com>
CC: Juergen Gross <jgross@suse.com>
CC: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
v2: Get rid of spurious X
---
 tools/libxl/libxl_linux.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c
index 6475cca64b..59dd945bc1 100644
--- a/tools/libxl/libxl_linux.c
+++ b/tools/libxl/libxl_linux.c
@@ -18,6 +18,14 @@
 #include <sys/resource.h>
 #include "libxl_internal.h"
 
+
+/* Workarounds for Linux-specific lacks can go here: */
+
+#ifndef CLONE_NEWIPC /* Available as of Linux 2.6.19 / glibc 2.8 */
+# define CLONE_NEWIPC 0x08000000
+#endif
+
+
 int libxl__try_phy_backend(mode_t st_mode)
 {
     if (S_ISBLK(st_mode) || S_ISREG(st_mode)) {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-01-11 19:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5C386B5F020000780020C96B@suse.com>
2019-01-11 14:42 ` [PATCH] libxl: fix build on rather old systems Juergen Gross
2019-01-11 17:40   ` Ian Jackson
2019-01-11 18:12     ` [PATCH 1/2] Revert "libxl: fix build on rather old systems" Ian Jackson
2019-01-11 18:12       ` [PATCH 2/2] libxl: fix build (missing CLONE_NEWIPC) on astonishingly old systems Ian Jackson
2019-01-11 18:27         ` Anthony PERARD
2019-01-11 19:21           ` Ian Jackson
2019-01-11 19:23           ` Ian Jackson [this message]
     [not found]             ` <4C7EABEB02000006B8D7C7D4@prv1-mh.provo.novell.com>
     [not found]               ` <9E406FBD020000569DFFD529@prv1-mh.provo.novell.com>
     [not found]                 ` <9E4077BD020000969DFFD529@prv1-mh.provo.novell.com>
     [not found]                   ` <81E41643020000ABCFD95477@prv1-mh.provo.novell.com>
     [not found]                     ` <CE47AFED020000429DFFD529@prv1-mh.provo.novell.com>
2019-01-14  9:47                       ` [PATCH v2 " Jan Beulich
2019-01-14 11:37                         ` Wei Liu
2019-01-14 14:22                           ` Ian Jackson
2019-01-14 14:27                             ` Jan Beulich
2019-01-14 14:59     ` [PATCH v3 1/3] docs/features/qemu-deprivilege.pandoc: No support with Linux <2.6.18 Ian Jackson
2019-01-14 15:02       ` Wei Liu
2019-01-16 10:41       ` Juergen Gross
2019-01-14 14:59     ` [PATCH v3 2/3] Revert "libxl: fix build on rather old systems" Ian Jackson
2019-01-14 15:02       ` Wei Liu
2019-01-14 14:59     ` [PATCH v3 3/3] libxl: fix build (missing CLONE_NEWIPC) on astonishingly old systems Ian Jackson
2019-01-14 15:04       ` 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=20190111192328.25242-1-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.