guest: Never use vmvga if host is RHEL (bz 1147662)

We basically need to do this independent of whether the build is configured
for RHEL defaults or not
This commit is contained in:
Cole Robinson 2015-03-25 09:04:51 -04:00
parent af2aea8bbc
commit 7866e291f6
3 changed files with 15 additions and 8 deletions

View File

@ -318,12 +318,12 @@ class TestXMLMisc(unittest.TestCase):
g = _make_guest(conn=conn)
try:
cliconfig.stable_defaults = True
g.emulator = "/usr/libexec/qemu-kvm"
g.add_default_video_device()
g.os_variant = "ubuntu13.10"
g.get_install_xml(True)
self._compare(g, "install-novmvga-rhel", True)
cliconfig.stable_defaults = True
self._compare(g, "install-novmvga-rhel", True)
finally:
cliconfig.stable_defaults = False

View File

@ -327,8 +327,14 @@ class VirtualConnection(object):
self._conn_version = self._libvirtconn.getVersion()
return self._conn_version
def stable_defaults(self, emulator=None):
if not cliconfig.stable_defaults:
def stable_defaults(self, emulator=None, force=False):
"""
:param force: Just check if we are running on RHEL, regardless of
whether stable defaults are requested by the build. This is needed
to ensure we don't enable VM devices that are compiled out on
RHEL, like vmvga
"""
if not cliconfig.stable_defaults and not force:
return False
if not self.is_qemu_system():

View File

@ -563,8 +563,8 @@ class Guest(XMLBuilder):
# Device defaults #
###################
def stable_defaults(self):
return self.conn.stable_defaults(self.emulator)
def stable_defaults(self, *args, **kwargs):
return self.conn.stable_defaults(self.emulator, *args, **kwargs)
def add_default_input_device(self):
if self.os.is_container():
@ -1066,8 +1066,9 @@ class Guest(XMLBuilder):
self._add_spice_usbredir()
video_model = self._os_object.get_videomodel(self)
if self.stable_defaults() and video_model == 'vmvga':
if video_model == 'vmvga' and self.stable_defaults(force=True):
video_model = 'vga'
for video in self.get_devices("video"):
if video.model == video.MODEL_DEFAULT:
video.model = video_model