configure: Allow setting default qemu:///system user

This commit is contained in:
Cole Robinson 2010-12-13 11:22:01 -05:00
parent 2775757728
commit d0c6a9390e
5 changed files with 34 additions and 11 deletions

View File

@ -13,8 +13,6 @@ IT_PROG_INTLTOOL([0.35.0], [no-xml])
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])
AC_SUBST([VIRTINST_VERSION])
dnl ====================================
dnl = Begin tests for scrollkeeper
dnl ====================================
@ -30,7 +28,7 @@ dnl ====================================
dnl = End tests for scrollkeeper
dnl ====================================
dnl Avahi library
dnl Install TUI
AC_ARG_WITH([tui],
AC_HELP_STRING(
[--with-tui],
@ -38,8 +36,19 @@ AC_ARG_WITH([tui],
[],
[with_tui=yes])
dnl Default QEMU user
AC_ARG_WITH([qemu-user],
AC_HELP_STRING(
[--with-qemu-user],
[user libvirt uses to launch qemu processes @<:@default=root@:>@]),
[DEFAULT_QEMU_USER=$withval],
[DEFAULT_QEMU_USER="root"])
AC_SUBST([VIRTINST_VERSION])
AC_SUBST([DEFAULT_QEMU_USER])
AM_CONDITIONAL([INSTALL_TUI], [test "x$with_tui" = "xyes"])
AC_OUTPUT(Makefile
pixmaps/Makefile
pixmaps/hicolor/Makefile
@ -59,3 +68,15 @@ AC_OUTPUT(Makefile
tests/Makefile
virt-manager.spec)
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Required virtinst: $VIRTINST_VERSION])
AC_MSG_NOTICE([Default qemu user: $DEFAULT_QEMU_USER])
if test "x$with_tui" = "xyes" ; then
AC_MSG_NOTICE([Install TUI: yes])
else
AC_MSG_NOTICE([Install TUI: no])
fi
AC_MSG_NOTICE([])
AC_MSG_NOTICE([])

View File

@ -59,7 +59,9 @@ endif
-e "s,::GETTEXTDIR::,$(datadir)/locale," \
-e "s,::DATADIR::,$(datadir)," \
-e "s,::PYARCHLIBDIR::,$(pkglibdir)," \
-e "s,::VIRTINST_VERSION::,$(VIRTINST_VERSION)," < $< > $@
-e "s,::VIRTINST_VERSION::,$(VIRTINST_VERSION)," \
-e "s,::DEFAULT_QEMU_USER::,$(DEFAULT_QEMU_USER)," \
< $< > $@
$(PACKAGE): $(srcdir)/$(PACKAGE).in
sed -e "s,::PACKAGE::,$(PACKAGE)," -e "s,::PYTHONDIR::,$(pkgdatadir)," < $< > $@

View File

@ -56,6 +56,8 @@ pylib_dir = "::PYLIBDIR::"
pyarchlib_dir = "::PYARCHLIBDIR::"
data_dir = "::DATADIR::"
default_qemu_user = "::DEFAULT_QEMU_USER::"
logging_setup = False
def _show_startup_error(msg, details):
@ -376,6 +378,7 @@ def main():
gconf_dir, glade_dir,
icon_dir, data_dir)
virtManager.config.running_config = config
config.default_qemu_user = default_qemu_user
# Now we've got basic environment up & running we can fork
if not options.nofork and not options.debug:

View File

@ -93,11 +93,14 @@ class vmmConfig(object):
self.glade_dir = glade_dir
self.icon_dir = icon_dir
self.data_dir = data_dir
# We don't create it straight away, since we don't want
# to block the app pending user authorizaation to access
# the keyring
self.keyring = None
self.default_qemu_user = "root"
self.status_icons = {
libvirt.VIR_DOMAIN_BLOCKED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 18, 18),
libvirt.VIR_DOMAIN_CRASHED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_crashed.png", 18, 18),

View File

@ -43,12 +43,6 @@ OPTICAL_IS_VALID = 5
SUPPORTED_SOUND_MODELS = None
# What user we guess the qemu:///system starts the emulator as. Some distros
# may use a nonroot user, so simply changing this will cause several UI
# pieces to attempt to verify that permissions are correct. Eventually this
# should be exposed via capabilities so we can determine this programmatically.
QEMU_SYSTEM_EMULATOR_USER = "root"
##############################################################
# Initialize an error object to use for validation functions #
##############################################################
@ -739,7 +733,7 @@ def check_path_search_for_qemu(parent, conn, path):
if conn.is_remote() or not conn.is_qemu_system():
return
user = QEMU_SYSTEM_EMULATOR_USER
user = running_config.default_qemu_user
skip_paths = running_config.get_perms_fix_ignore()
broken_paths = VirtualDisk.check_path_search_for_user(conn.vmm, path, user)