]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix /dev/ population to use char devices (Ryota Ozaki)
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 8 May 2009 10:22:46 +0000 (10:22 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 8 May 2009 10:22:46 +0000 (10:22 +0000)
AUTHORS
ChangeLog
src/lxc_container.c
src/lxc_controller.c

diff --git a/AUTHORS b/AUTHORS
index 35b96ebf0fe950ca5fc3bd4b2dae8e2fface0fde..228a44c9fb6b94112a2be4578fd692a8e3c4bdce 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -63,7 +63,6 @@ Patches have also been contributed by:
   James Morris         <jmorris@namei.org>
   Daniel J Walsh       <dwalsh@redhat.com>
   Maximilian Wilhelm   <max@rfc2324.org>
-  Ryota Ozaki          <ozaki.ryota@gmail.com>
   Pritesh Kothari      <Pritesh.Kothari@Sun.COM>
   Amit Shah            <amit.shah@redhat.com>
   Florian Vichot       <florian.vichot@diateam.net>
index e835dfc573c54943d1370bb5abd283e21d50168a..e71d1663ba88e406344db7f3507881ce7e59fd1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri May  8 11:22:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
+
+       Fix /dev/ population to use char devices (Ryota Ozaki)
+       * src/lxc_controller.c: Add /dev/ptmx to allow cgroup resources
+       * src/lxc_container.c: Create dev nodes as char devices, not
+       plain files
+
 Fri May  8 12:15:05 CEST 2009 Guido Günther <agx@sigxcpu.org>
 
        * src/vbox/vbox_tmpl.c (virDrvOpen): return VIR_DRV_OPEN_DECLINED
index 3946b84f06f27f7a6d0ab95be1d6a24ca93922df..c30daecd9f1f22f64c0d74a26dff9160efcb2b1b 100644 (file)
@@ -440,7 +440,7 @@ static int lxcContainerPopulateDevices(void)
     /* Populate /dev/ with a few important bits */
     for (i = 0 ; i < ARRAY_CARDINALITY(devs) ; i++) {
         dev_t dev = makedev(devs[i].maj, devs[i].min);
-        if (mknod(devs[i].path, 0, dev) < 0 ||
+        if (mknod(devs[i].path, S_IFCHR, dev) < 0 ||
             chmod(devs[i].path, devs[i].mode)) {
             virReportSystemError(NULL, errno,
                                  _("failed to make device %s"),
@@ -457,7 +457,7 @@ static int lxcContainerPopulateDevices(void)
         }
     } else {
         dev_t dev = makedev(LXC_DEV_MAJ_TTY, LXC_DEV_MIN_PTMX);
-        if (mknod("/dev/ptmx", 0, dev) < 0 ||
+        if (mknod("/dev/ptmx", S_IFCHR, dev) < 0 ||
             chmod("/dev/ptmx", 0666)) {
             virReportSystemError(NULL, errno, "%s",
                                  _("failed to make device /dev/ptmx"));
index e0fb05d038a9895c4b520a0eaa6c9a6f8a2e0b06..356ecb80b447da62c3d74531997cb0b9d77691e0 100644 (file)
@@ -75,6 +75,7 @@ static int lxcSetContainerResources(virDomainDefPtr def)
         {'c', LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_RANDOM},
         {'c', LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_URANDOM},
         {'c', LXC_DEV_MAJ_TTY, LXC_DEV_MIN_CONSOLE},
+        {'c', LXC_DEV_MAJ_TTY, LXC_DEV_MIN_PTMX},
         {0,   0, 0}};
 
     if (virCgroupHaveSupport() != 0)