From 3138d6993e32f51dc8f65976bdbb6f5690d1dd01 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Mon, 12 Dec 2016 15:35:07 +0100 Subject: [PATCH] configure: move qemu privileges check to qemu driver file Signed-off-by: Pavel Hrdina --- configure.ac | 27 +-------------------------- m4/virt-driver-qemu.m4 | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index 2099171fb8..4a06e73a4f 100644 --- a/configure.ac +++ b/configure.ac @@ -1500,31 +1500,6 @@ fi AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) -if test $with_freebsd = yes || test $with_osx = yes; then - default_qemu_user=root - default_qemu_group=wheel -else - default_qemu_user=root - default_qemu_group=root -fi - -LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], - ['platform dependent']) -LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], - ['platform dependent']) -if test "x$with_qemu_user" = "xplatform dependent" ; then - QEMU_USER="$default_qemu_user" -else - QEMU_USER="$with_qemu_user" -fi -if test "x$with_qemu_group" = "xplatform dependent" ; then - QEMU_GROUP="$default_qemu_group" -else - QEMU_GROUP="$with_qemu_group" -fi -AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) -AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) - AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-bridge-helper], [/usr/libexec:/usr/lib/qemu:/usr/lib]) AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper]) @@ -1796,5 +1771,5 @@ LIBVIRT_RESULT_WIRESHARK AC_MSG_NOTICE([]) AC_MSG_NOTICE([Privileges]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ QEMU: $QEMU_USER:$QEMU_GROUP]) +LIBVIRT_RESULT_QEMU_PRIVILEGES AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 index 39ec73bfef..9e65e85364 100644 --- a/m4/virt-driver-qemu.m4 +++ b/m4/virt-driver-qemu.m4 @@ -19,6 +19,10 @@ dnl AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [ LIBVIRT_ARG_WITH([QEMU], [QEMU/KVM], [yes]) + LIBVIRT_ARG_WITH_ALT([QEMU_USER], [username to run QEMU system instance as], + ['platform dependent']) + LIBVIRT_ARG_WITH_ALT([QEMU_GROUP], [groupname to run QEMU system instance as], + ['platform dependent']) ]) AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ @@ -26,8 +30,33 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled]) fi AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) + + if test $with_freebsd = yes || test $with_osx = yes; then + default_qemu_user=root + default_qemu_group=wheel + else + default_qemu_user=root + default_qemu_group=root + fi + + if test "x$with_qemu_user" = "xplatform dependent" ; then + QEMU_USER="$default_qemu_user" + else + QEMU_USER="$with_qemu_user" + fi + if test "x$with_qemu_group" = "xplatform dependent" ; then + QEMU_GROUP="$default_qemu_group" + else + QEMU_GROUP="$with_qemu_group" + fi + AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) + AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) ]) AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [ LIBVIRT_RESULT([QEMU], [$with_qemu]) ]) + +AC_DEFUN([LIBVIRT_RESULT_QEMU_PRIVILEGES], [ + LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP]) +]) -- GitLab