1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

configure: move qemu privileges check to qemu driver file

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-12-12 15:35:07 +01:00
parent 32af9539a3
commit 3138d6993e
2 changed files with 30 additions and 26 deletions

View File

@ -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([])

View File

@ -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])
])