libvirt/clone.patch
James Fehlig 6d3a1703e9 - Update to libvirt 1.1.2
- various improvements to libxl driver
  - systemd integration improvements
  - Add flag to BaselineCPU API to return detailed CPU features
  - Introduce a virt-login-shell binary
  - conf: add startupPolicy attribute for harddisk
  - Many incremental improvements and bug fixes, see
    http://libvirt.org/news.html
  - Drop upstream patches: bcef0f01-libxl-console.patch,
    9d0557b9-legacy-xen-double-free.patch,
    d7a45bf2-legacy-xen-dumpxml.patch, 0e671a16-CVE-2013-4239.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=296
2013-09-03 17:08:54 +00:00

79 lines
2.3 KiB
Diff

Index: src/lxc/lxc_container.c
===================================================================
--- src/lxc/lxc_container.c.orig
+++ src/lxc/lxc_container.c
@@ -144,6 +144,7 @@ int lxcContainerHasReboot(void)
int cmd, v;
int status;
char *tmp;
+ int stacksize = getpagesize() * 4;
if (virFileReadAll("/proc/sys/kernel/ctrl-alt-del", 10, &buf) < 0)
return -1;
@@ -160,12 +161,19 @@ int lxcContainerHasReboot(void)
VIR_FREE(buf);
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0)
+#ifdef __ia64__
+ stacksize *= 2;
+#endif
+ if (VIR_ALLOC_N(stack, stacksize) < 0)
return -1;
- childStack = stack + (getpagesize() * 4);
+ childStack = stack + stacksize;
+#ifdef __ia64__
+ cpid = __clone2(lxcContainerRebootChild, childStack, stacksize, flags, &cmd);
+#else
cpid = clone(lxcContainerRebootChild, childStack, flags, &cmd);
+#endif
VIR_FREE(stack);
if (cpid < 0) {
virReportSystemError(errno, "%s",
@@ -1893,7 +1901,11 @@ int lxcContainerStart(virDomainDefPtr de
cflags |= CLONE_NEWNET;
}
+#ifdef __ia64__
+ pid = __clone2(lxcContainerChild, stacktop, stacksize, cflags, &args);
+#else
pid = clone(lxcContainerChild, stacktop, cflags, &args);
+#endif
VIR_FREE(stack);
VIR_DEBUG("clone() completed, new container PID is %d", pid);
@@ -1919,6 +1931,7 @@ int lxcContainerAvailable(int features)
int cpid;
char *childStack;
char *stack;
+ int stacksize = getpagesize() * 4;
if (features & LXC_CONTAINER_FEATURE_USER)
flags |= CLONE_NEWUSER;
@@ -1926,14 +1939,21 @@ int lxcContainerAvailable(int features)
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) {
VIR_DEBUG("Unable to allocate stack");
return -1;
}
- childStack = stack + (getpagesize() * 4);
+ childStack = stack + stacksize;
+#ifdef __ia64__
+ cpid = __clone2(lxcContainerDummyChild, childStack, stacksize, flags, NULL);
+#else
cpid = clone(lxcContainerDummyChild, childStack, flags, NULL);
+#endif
VIR_FREE(stack);
if (cpid < 0) {
char ebuf[1024] ATTRIBUTE_UNUSED;