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
|
2010-03-22 17:06:03 +01:00
|
|
|
@@ -814,6 +814,9 @@ int lxcContainerStart(virDomainDefPtr de
|
2008-10-26 00:53:14 +02:00
|
|
|
lxc_child_argv_t args = { def, nveths, veths, control, ttyPath };
|
|
|
|
|
|
|
|
/* allocate a stack for the container */
|
|
|
|
+#ifdef __ia64__
|
|
|
|
+ stacksize *= 2;
|
|
|
|
+#endif
|
|
|
|
if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
2010-03-22 17:06:03 +01:00
|
|
|
virReportOOMError(NULL);
|
2008-10-26 00:53:14 +02:00
|
|
|
return -1;
|
2010-03-22 17:06:03 +01:00
|
|
|
@@ -828,7 +831,11 @@ int lxcContainerStart(virDomainDefPtr de
|
|
|
|
if (def->nets != NULL)
|
2008-10-26 00:53:14 +02:00
|
|
|
flags |= CLONE_NEWNET;
|
|
|
|
|
|
|
|
+#ifdef __ia64__
|
|
|
|
+ pid = __clone2(lxcContainerChild, stack, stacksize, flags, &args);
|
|
|
|
+#else
|
|
|
|
pid = clone(lxcContainerChild, stacktop, flags, &args);
|
|
|
|
+#endif
|
|
|
|
VIR_FREE(stack);
|
2010-03-22 17:06:03 +01:00
|
|
|
DEBUG("clone() returned, %d", pid);
|
2008-10-26 00:53:14 +02:00
|
|
|
|
2010-03-22 17:06:03 +01:00
|
|
|
@@ -854,6 +861,7 @@ int lxcContainerAvailable(int features)
|
2008-10-26 00:53:14 +02:00
|
|
|
char *childStack;
|
|
|
|
char *stack;
|
|
|
|
int childStatus;
|
|
|
|
+ int stacksize = getpagesize() * 4;
|
|
|
|
|
2009-07-24 01:36:28 +02:00
|
|
|
if (features & LXC_CONTAINER_FEATURE_USER)
|
|
|
|
flags |= CLONE_NEWUSER;
|
2010-03-22 17:06:03 +01:00
|
|
|
@@ -861,14 +869,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) {
|
|
|
|
DEBUG0("Unable to allocate stack");
|
|
|
|
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) {
|
2009-04-24 23:15:55 +02:00
|
|
|
char ebuf[1024];
|