From: Roy Li <rongqing.li(a)windriver.com>
When systemd is used as init, CGroup will be enabled by default, and
lead to virsh unable to start VM(which is using the tun/tap), since
virsh can not access /dev/net/tun device
Signed-off-by: Roy Li <rongqing.li(a)windriver.com>
---
src/qemu/qemu.conf | 3 ++-
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index c6db568..225cd0f 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -272,7 +272,8 @@
# "/dev/null", "/dev/full", "/dev/zero",
# "/dev/random", "/dev/urandom",
# "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
-# "/dev/rtc","/dev/hpet", "/dev/vfio/vfio"
+# "/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
+# "/dev/net/tun"
#]
#
# RDMA migration requires the following extra files to be added to the list:
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 0e94cae..7c15c07 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -45,7 +45,7 @@ static const char *const defaultDeviceACL[] = {
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc", "/dev/hpet", "/dev/vfio/vfio",
- NULL,
+ "/dev/net/tun", NULL,
};
#define DEVICE_PTY_MAJOR 136
#define DEVICE_SND_MAJOR 116
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 30fd27e..2ab7a8d 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -48,6 +48,7 @@ module Test_libvirtd_qemu =
{ "9" = "/dev/rtc" }
{ "10" = "/dev/hpet" }
{ "11" = "/dev/vfio/vfio" }
+ { "12" = "/dev/net/tun" }
}
{ "save_image_format" = "raw" }
{ "dump_image_format" = "raw" }
--
2.1.0
Show replies by date
On Thu, Nov 27, 2014 at 01:42:01PM +0800, rongqing.li(a)windriver.com wrote:
From: Roy Li <rongqing.li(a)windriver.com>
When systemd is used as init, CGroup will be enabled by default, and
lead to virsh unable to start VM(which is using the tun/tap), since
virsh can not access /dev/net/tun device
Signed-off-by: Roy Li <rongqing.li(a)windriver.com>
---
src/qemu/qemu.conf | 3 ++-
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
NACK, libvirt should create all TUN devices, except in the case
of <interface type=ethernet> which is a deprecated/discouraged
option as it is insecure to allow QEMU to create TUN devices
itself.
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|