From d5638eb140984bab03ae73588742309a3f8a4af6 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 1 Sep 2018 13:18:49 -0400 Subject: [PATCH] osdict: Make qemu_ga support solely dependent on virtio-serial support We shouldn't concern ourselves with whether the OS supports qemu_ga out of the box, just set up the channel regardless, as long as virtio-serial is supported. This adds the channel for some aarch64 cases which didn't have OS specified, but that's desired IMO --- .../compare/virt-install-aarch64-cdrom.xml | 8 ++++++++ .../compare/virt-install-aarch64-machdefault.xml | 4 ++++ .../compare/virt-install-aarch64-machvirt.xml | 4 ++++ virtinst/guest.py | 2 +- virtinst/osdict.py | 10 ++++++---- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml b/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml index 86eebdc01..69bc1bfc6 100644 --- a/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml +++ b/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml @@ -36,6 +36,10 @@ + + + + @@ -73,5 +77,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml b/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml index 2a60a9670..d37da8e39 100644 --- a/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml +++ b/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml @@ -29,5 +29,9 @@ + + + + diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml b/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml index 2a60a9670..d37da8e39 100644 --- a/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml +++ b/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml @@ -29,5 +29,9 @@ + + + + diff --git a/virtinst/guest.py b/virtinst/guest.py index 0384eff82..e701cc535 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -659,7 +659,7 @@ class Guest(XMLBuilder): return if (self.conn.is_qemu() and - self._os_object.supports_qemu_ga() and + self._supports_virtio(self._os_object.supports_virtioserial()) and self.conn.check_support(self.conn.SUPPORT_CONN_AUTOSOCKET)): dev = DeviceChannel(self.conn) dev.type = "unix" diff --git a/virtinst/osdict.py b/virtinst/osdict.py index 4f828d692..ebfe61fae 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -336,10 +336,6 @@ class _OsVariant(object): return "localtime" return "utc" - def supports_qemu_ga(self): - return self._is_related_to( - ["debian8", "fedora18", "rhel6.0", "sles11sp4"]) - def supported_netmodels(self): return self._device_filter(cls="net") @@ -355,6 +351,12 @@ class _OsVariant(object): def supports_virtiorng(self): return bool(self._device_filter(cls="rng", name="virtio.*-rng")) + def supports_virtioserial(self): + if self._device_filter(cls="console", name="virtio.*-console"): + return True + # 2018-09-01: osinfo data is wrong for RHEL/centos here + return self._is_related_to("rhel6.0") + def get_recommended_resources(self, guest): ret = {} if not self._os: