mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-12 09:18:00 +03:00
configure: Add option to disable unsupported RHEL config
This commit is contained in:
parent
f8d3701f29
commit
187190c362
32
configure.ac
32
configure.ac
@ -28,6 +28,10 @@ dnl ====================================
|
|||||||
dnl = End tests for scrollkeeper
|
dnl = End tests for scrollkeeper
|
||||||
dnl ====================================
|
dnl ====================================
|
||||||
|
|
||||||
|
|
||||||
|
dnl ---------------
|
||||||
|
dnl Option handling
|
||||||
|
dnl ---------------
|
||||||
dnl Install TUI
|
dnl Install TUI
|
||||||
AC_ARG_WITH([tui],
|
AC_ARG_WITH([tui],
|
||||||
AC_HELP_STRING(
|
AC_HELP_STRING(
|
||||||
@ -44,8 +48,21 @@ AC_ARG_WITH([qemu-user],
|
|||||||
[DEFAULT_QEMU_USER=$withval],
|
[DEFAULT_QEMU_USER=$withval],
|
||||||
[DEFAULT_QEMU_USER="root"])
|
[DEFAULT_QEMU_USER="root"])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
AC_ARG_ENABLE([unsupported-rhel-options],
|
||||||
|
AC_HELP_STRING(
|
||||||
|
[--enable-unsupported-rhel-options],
|
||||||
|
[enable VM config options unsupported by RHEL @<:@default=yes@:>@]),
|
||||||
|
[test "x$enableval" == "xno" && ENABLE_UNSUPPORTED_RHEL_OPTS=0],
|
||||||
|
[ENABLE_UNSUPPORTED_RHEL_OPTS=1])
|
||||||
|
|
||||||
|
|
||||||
|
dnl -----------------------
|
||||||
|
dnl Variable substitution
|
||||||
|
dnl -----------------------
|
||||||
AC_SUBST([VIRTINST_VERSION])
|
AC_SUBST([VIRTINST_VERSION])
|
||||||
AC_SUBST([DEFAULT_QEMU_USER])
|
AC_SUBST([DEFAULT_QEMU_USER])
|
||||||
|
AC_SUBST([ENABLE_UNSUPPORTED_RHEL_OPTS])
|
||||||
AM_CONDITIONAL([INSTALL_TUI], [test "x$with_tui" = "xyes"])
|
AM_CONDITIONAL([INSTALL_TUI], [test "x$with_tui" = "xyes"])
|
||||||
|
|
||||||
|
|
||||||
@ -71,12 +88,19 @@ AC_OUTPUT(Makefile
|
|||||||
|
|
||||||
AC_MSG_NOTICE([])
|
AC_MSG_NOTICE([])
|
||||||
AC_MSG_NOTICE([])
|
AC_MSG_NOTICE([])
|
||||||
AC_MSG_NOTICE([Required virtinst: $VIRTINST_VERSION])
|
|
||||||
AC_MSG_NOTICE([Default qemu user: $DEFAULT_QEMU_USER])
|
AC_MSG_NOTICE([Required virtinst: $VIRTINST_VERSION])
|
||||||
|
AC_MSG_NOTICE([Default qemu user: $DEFAULT_QEMU_USER])
|
||||||
if test "x$with_tui" = "xyes" ; then
|
if test "x$with_tui" = "xyes" ; then
|
||||||
AC_MSG_NOTICE([Install TUI: yes])
|
AC_MSG_NOTICE([Install TUI: yes])
|
||||||
else
|
else
|
||||||
AC_MSG_NOTICE([Install TUI: no])
|
AC_MSG_NOTICE([Install TUI: no])
|
||||||
fi
|
fi
|
||||||
|
if test "x$ENABLE_UNSUPPORTED_RHEL_OPTS" = "x1" ; then
|
||||||
|
AC_MSG_NOTICE([Enable unsupported RHEL opts: yes])
|
||||||
|
else
|
||||||
|
AC_MSG_NOTICE([Enable unsupported RHEL opts: no])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_MSG_NOTICE([])
|
AC_MSG_NOTICE([])
|
||||||
AC_MSG_NOTICE([])
|
AC_MSG_NOTICE([])
|
||||||
|
@ -61,6 +61,7 @@ endif
|
|||||||
-e "s,::PYARCHLIBDIR::,$(pkglibdir)," \
|
-e "s,::PYARCHLIBDIR::,$(pkglibdir)," \
|
||||||
-e "s,::VIRTINST_VERSION::,$(VIRTINST_VERSION)," \
|
-e "s,::VIRTINST_VERSION::,$(VIRTINST_VERSION)," \
|
||||||
-e "s,::DEFAULT_QEMU_USER::,$(DEFAULT_QEMU_USER)," \
|
-e "s,::DEFAULT_QEMU_USER::,$(DEFAULT_QEMU_USER)," \
|
||||||
|
-e "s,::ENABLE_UNSUPPORTED_RHEL_OPTS::,$(ENABLE_UNSUPPORTED_RHEL_OPTS)," \
|
||||||
< $< > $@
|
< $< > $@
|
||||||
|
|
||||||
$(PACKAGE): $(srcdir)/$(PACKAGE).in
|
$(PACKAGE): $(srcdir)/$(PACKAGE).in
|
||||||
|
@ -57,6 +57,7 @@ pyarchlib_dir = "::PYARCHLIBDIR::"
|
|||||||
data_dir = "::DATADIR::"
|
data_dir = "::DATADIR::"
|
||||||
|
|
||||||
default_qemu_user = "::DEFAULT_QEMU_USER::"
|
default_qemu_user = "::DEFAULT_QEMU_USER::"
|
||||||
|
rhel_enable_unsupported_opts = bool(int("::ENABLE_UNSUPPORTED_RHEL_OPTS::"))
|
||||||
|
|
||||||
logging_setup = False
|
logging_setup = False
|
||||||
|
|
||||||
@ -379,6 +380,7 @@ def main():
|
|||||||
icon_dir, data_dir)
|
icon_dir, data_dir)
|
||||||
virtManager.config.running_config = config
|
virtManager.config.running_config = config
|
||||||
config.default_qemu_user = default_qemu_user
|
config.default_qemu_user = default_qemu_user
|
||||||
|
config.enable_unsupported_rhel_opts = rhel_enable_unsupported_opts
|
||||||
|
|
||||||
# Now we've got basic environment up & running we can fork
|
# Now we've got basic environment up & running we can fork
|
||||||
if not options.nofork and not options.debug:
|
if not options.nofork and not options.debug:
|
||||||
|
@ -472,8 +472,10 @@ class vmmAddHardware(vmmGObjectUI):
|
|||||||
add_dev("ide", virtinst.VirtualDisk.DEVICE_DISK, "IDE disk")
|
add_dev("ide", virtinst.VirtualDisk.DEVICE_DISK, "IDE disk")
|
||||||
add_dev("ide", virtinst.VirtualDisk.DEVICE_CDROM, "IDE cdrom")
|
add_dev("ide", virtinst.VirtualDisk.DEVICE_CDROM, "IDE cdrom")
|
||||||
add_dev("fdc", virtinst.VirtualDisk.DEVICE_FLOPPY, "Floppy disk")
|
add_dev("fdc", virtinst.VirtualDisk.DEVICE_FLOPPY, "Floppy disk")
|
||||||
add_dev("scsi", virtinst.VirtualDisk.DEVICE_DISK, "SCSI disk")
|
|
||||||
add_dev("usb", virtinst.VirtualDisk.DEVICE_DISK, "USB disk")
|
if self.vm.enable_unsupported_rhel_opts():
|
||||||
|
add_dev("scsi", virtinst.VirtualDisk.DEVICE_DISK, "SCSI disk")
|
||||||
|
add_dev("usb", virtinst.VirtualDisk.DEVICE_DISK, "USB disk")
|
||||||
if self.vm.get_hv_type() == "kvm":
|
if self.vm.get_hv_type() == "kvm":
|
||||||
add_dev("virtio", virtinst.VirtualDisk.DEVICE_DISK, "Virtio Disk")
|
add_dev("virtio", virtinst.VirtualDisk.DEVICE_DISK, "Virtio Disk")
|
||||||
if self.vm.get_connection().is_xen():
|
if self.vm.get_connection().is_xen():
|
||||||
|
@ -101,6 +101,9 @@ class vmmConfig(object):
|
|||||||
|
|
||||||
self.default_qemu_user = "root"
|
self.default_qemu_user = "root"
|
||||||
|
|
||||||
|
# Use this key to disable certain features not supported on RHEL
|
||||||
|
self.enable_unsupported_rhel_opts = True
|
||||||
|
|
||||||
self.status_icons = {
|
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_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),
|
libvirt.VIR_DOMAIN_CRASHED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_crashed.png", 18, 18),
|
||||||
|
@ -426,6 +426,15 @@ class vmmDomainBase(vmmLibvirtObject):
|
|||||||
def get_handle(self):
|
def get_handle(self):
|
||||||
return self._backend
|
return self._backend
|
||||||
|
|
||||||
|
def enable_unsupported_rhel_opts(self):
|
||||||
|
if not self.is_libexec_qemu():
|
||||||
|
return True
|
||||||
|
return self.config.enable_unsupported_rhel_opts
|
||||||
|
|
||||||
|
def is_libexec_qemu(self):
|
||||||
|
return bool(self.connection.is_qemu_system() and
|
||||||
|
str(self.get_emulator()).startswith("/usr/libexec"))
|
||||||
|
|
||||||
def is_read_only(self):
|
def is_read_only(self):
|
||||||
if self.connection.is_read_only():
|
if self.connection.is_read_only():
|
||||||
return True
|
return True
|
||||||
|
@ -41,8 +41,6 @@ OPTICAL_DEV_KEY = 3
|
|||||||
OPTICAL_MEDIA_KEY = 4
|
OPTICAL_MEDIA_KEY = 4
|
||||||
OPTICAL_IS_VALID = 5
|
OPTICAL_IS_VALID = 5
|
||||||
|
|
||||||
SUPPORTED_SOUND_MODELS = None
|
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# Initialize an error object to use for validation functions #
|
# Initialize an error object to use for validation functions #
|
||||||
##############################################################
|
##############################################################
|
||||||
@ -140,7 +138,6 @@ def build_video_combo(vm, video_dev, no_default=False):
|
|||||||
video_dev.set_active(0)
|
video_dev.set_active(0)
|
||||||
|
|
||||||
def build_sound_combo(vm, combo, no_default=False):
|
def build_sound_combo(vm, combo, no_default=False):
|
||||||
ignore = vm
|
|
||||||
dev_model = gtk.ListStore(str)
|
dev_model = gtk.ListStore(str)
|
||||||
combo.set_model(dev_model)
|
combo.set_model(dev_model)
|
||||||
text = gtk.CellRendererText()
|
text = gtk.CellRendererText()
|
||||||
@ -148,12 +145,14 @@ def build_sound_combo(vm, combo, no_default=False):
|
|||||||
combo.add_attribute(text, 'text', 0)
|
combo.add_attribute(text, 'text', 0)
|
||||||
dev_model.set_sort_column_id(0, gtk.SORT_ASCENDING)
|
dev_model.set_sort_column_id(0, gtk.SORT_ASCENDING)
|
||||||
|
|
||||||
|
disable_rhel = not vm.enable_unsupported_rhel_opts()
|
||||||
|
rhel6_soundmodels = ["ac97", "es1370"]
|
||||||
|
|
||||||
for m in virtinst.VirtualAudio.MODELS:
|
for m in virtinst.VirtualAudio.MODELS:
|
||||||
if m == virtinst.VirtualAudio.MODEL_DEFAULT and no_default:
|
if m == virtinst.VirtualAudio.MODEL_DEFAULT and no_default:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (SUPPORTED_SOUND_MODELS is not None and
|
if (disable_rhel and m not in rhel6_soundmodels):
|
||||||
m not in SUPPORTED_SOUND_MODELS):
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
dev_model.append([m])
|
dev_model.append([m])
|
||||||
|
Loading…
Reference in New Issue
Block a user