[Pkg-libvirt-commits] [libguestfs] 99/266: launch: direct: Only issue Debian /dev/kvm group warning if /dev/kvm wasn't openable (RHBZ#1130189).
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:41:47 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.
commit 9609521734c661ec70c34a68f6201a2601190fa6
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Thu Aug 14 15:16:06 2014 +0100
launch: direct: Only issue Debian /dev/kvm group warning if /dev/kvm wasn't openable (RHBZ#1130189).
This warning was meant for the case where /dev/kvm is inaccessible and
the user must add themselves to a special group.
However we didn't take into account whether /dev/kvm was openable in
this test. If it's openable, no point issuing the warning.
Move the is_openable ("/dev/kvm") test earlier, and don't issue the
warning if that was successful.
---
src/launch-direct.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/launch-direct.c b/src/launch-direct.c
index 3bae254..3a8f2b2 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -289,11 +289,19 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
return -1;
}
+ /* Try to guess if KVM is available. We are just checking that
+ * /dev/kvm is openable. That's not reliable, since /dev/kvm
+ * might be openable by qemu but not by us (think: SELinux) in
+ * which case the user would not get hardware virtualization,
+ * although at least shouldn't fail.
+ */
+ has_kvm = is_openable (g, "/dev/kvm", O_RDWR|O_CLOEXEC);
+
force_tcg = guestfs___get_backend_setting_bool (g, "force_tcg");
if (force_tcg == -1)
return -1;
- if (!force_tcg)
+ if (!has_kvm && !force_tcg)
debian_kvm_warning (g);
guestfs___launch_send_progress (g, 0);
@@ -411,14 +419,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
warning (g, "qemu debugging is enabled, connect gdb to tcp::1234 to begin");
}
- /* Try to guess if KVM is available. We are just checking that
- * /dev/kvm is openable. That's not reliable, since /dev/kvm
- * might be openable by qemu but not by us (think: SELinux) in
- * which case the user would not get hardware virtualization,
- * although at least shouldn't fail.
- */
- has_kvm = is_openable (g, "/dev/kvm", O_RDWR|O_CLOEXEC);
-
cpu_model = guestfs___get_cpu_model (has_kvm && !force_tcg);
if (cpu_model) {
ADD_CMDLINE ("-cpu");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list