File lxcpty.patch of Package libvirt

Index: libvirt-0.4.6/src/lxc_container.h
===================================================================
--- libvirt-0.4.6.orig/src/lxc_container.h
+++ libvirt-0.4.6/src/lxc_container.h
@@ -40,6 +40,8 @@ enum {
 #define LXC_DEV_MAJ_TTY     5
 #define LXC_DEV_MIN_CONSOLE 1
 
+#define LXC_DEV_MAJ_PTY     136
+
 int lxcContainerSendContinue(int control);
 
 int lxcContainerStart(virDomainDefPtr def,
Index: libvirt-0.4.6/src/lxc_controller.c
===================================================================
--- libvirt-0.4.6.orig/src/lxc_controller.c
+++ libvirt-0.4.6/src/lxc_controller.c
@@ -106,6 +106,10 @@ static int lxcSetContainerResources(virD
             goto out;
     }
 
+    rc = virCgroupAllowDeviceMajor(cgroup, 'c', LXC_DEV_MAJ_PTY);
+    if (rc != 0)
+        goto out;
+
     rc = virCgroupAddTask(cgroup, getpid());
 out:
     if (rc != 0) {
@@ -452,6 +456,9 @@ lxcControllerRun(virDomainDefPtr def,
         goto cleanup;
     }
 
+    if (lxcSetContainerResources(def) < 0)
+        goto cleanup;
+
     if ((container = lxcContainerStart(def,
                                        nveths,
                                        veths,
@@ -464,9 +471,6 @@ lxcControllerRun(virDomainDefPtr def,
     if (lxcControllerMoveInterfaces(nveths, veths, container) < 0)
         goto cleanup;
 
-    if (lxcSetContainerResources(def) < 0)
-        goto cleanup;
-
     if (lxcContainerSendContinue(control[0]) < 0)
         goto cleanup;
 
openSUSE Build Service is sponsored by