2009-11-05 04:56:27 +01:00
|
|
|
Index: src/lxc/lxc_container.c
|
2009-01-29 01:42:42 +01:00
|
|
|
===================================================================
|
2009-11-05 04:56:27 +01:00
|
|
|
--- src/lxc/lxc_container.c.orig
|
|
|
|
+++ src/lxc/lxc_container.c
|
2012-09-26 00:22:08 +02:00
|
|
|
@@ -1932,6 +1932,9 @@ int lxcContainerStart(virDomainDefPtr de
|
2011-11-10 02:55:47 +01:00
|
|
|
ttyPaths, nttyPaths, handshakefd};
|
2008-10-26 00:53:14 +02:00
|
|
|
|
|
|
|
/* allocate a stack for the container */
|
|
|
|
+#ifdef __ia64__
|
|
|
|
+ stacksize *= 2;
|
|
|
|
+#endif
|
|
|
|
if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
2010-03-22 17:06:05 +01:00
|
|
|
virReportOOMError();
|
2008-10-26 00:53:14 +02:00
|
|
|
return -1;
|
2012-09-26 00:22:08 +02:00
|
|
|
@@ -1951,7 +1954,11 @@ int lxcContainerStart(virDomainDefPtr de
|
2011-08-04 19:12:20 +02:00
|
|
|
cflags |= CLONE_NEWNET;
|
2010-03-22 17:06:05 +01:00
|
|
|
}
|
2008-10-26 00:53:14 +02:00
|
|
|
|
|
|
|
+#ifdef __ia64__
|
2011-08-04 19:12:20 +02:00
|
|
|
+ pid = __clone2(lxcContainerChild, stack, stacksize, cflags, &args);
|
2008-10-26 00:53:14 +02:00
|
|
|
+#else
|
2011-08-04 19:12:20 +02:00
|
|
|
pid = clone(lxcContainerChild, stacktop, cflags, &args);
|
2008-10-26 00:53:14 +02:00
|
|
|
+#endif
|
|
|
|
VIR_FREE(stack);
|
2011-03-31 22:22:32 +02:00
|
|
|
VIR_DEBUG("clone() completed, new container PID is %d", pid);
|
2008-10-26 00:53:14 +02:00
|
|
|
|
2012-09-26 00:22:08 +02:00
|
|
|
@@ -1977,6 +1984,7 @@ int lxcContainerAvailable(int features)
|
2011-11-10 02:55:47 +01:00
|
|
|
int cpid;
|
2008-10-26 00:53:14 +02:00
|
|
|
char *childStack;
|
|
|
|
char *stack;
|
|
|
|
+ int stacksize = getpagesize() * 4;
|
|
|
|
|
2009-07-24 01:36:28 +02:00
|
|
|
if (features & LXC_CONTAINER_FEATURE_USER)
|
|
|
|
flags |= CLONE_NEWUSER;
|
2012-09-26 00:22:08 +02:00
|
|
|
@@ -1984,14 +1992,21 @@ int lxcContainerAvailable(int features)
|
2008-10-26 00:53:14 +02:00
|
|
|
if (features & LXC_CONTAINER_FEATURE_NET)
|
|
|
|
flags |= CLONE_NEWNET;
|
|
|
|
|
|
|
|
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
|
|
|
|
+#ifdef __ia64__
|
|
|
|
+ stacksize *= 2;
|
|
|
|
+#endif
|
|
|
|
+ if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
2011-06-02 20:32:33 +02:00
|
|
|
VIR_DEBUG("Unable to allocate stack");
|
2008-10-26 00:53:14 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- childStack = stack + (getpagesize() * 4);
|
|
|
|
+ childStack = stack + stacksize;
|
|
|
|
|
|
|
|
+#ifdef __ia64__
|
|
|
|
+ cpid = __clone2(lxcContainerDummyChild, stack, stacksize, flags, NULL);
|
|
|
|
+#else
|
|
|
|
cpid = clone(lxcContainerDummyChild, childStack, flags, NULL);
|
|
|
|
+#endif
|
|
|
|
VIR_FREE(stack);
|
|
|
|
if (cpid < 0) {
|
2011-11-10 02:55:47 +01:00
|
|
|
char ebuf[1024] ATTRIBUTE_UNUSED;
|