[libvirt] [PATCH v4 27/30] qemu: Limit isa-serial usage to x86 guests

Andrea Bolognani posted 30 patches 7 years, 5 months ago
[libvirt] [PATCH v4 27/30] qemu: Limit isa-serial usage to x86 guests
Posted by Andrea Bolognani 7 years, 5 months ago
The ISA bus is x86 specific, so we should limit usage of isa-serial
to x86 guests only, just like we already do eg. with sclpconsole and
s390x guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d1e391f48..cf4af14dd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3611,6 +3611,12 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
     if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) {
         bool isCompatible = true;
 
+        if (!ARCH_IS_X86(def->os.arch) &&
+            (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA ||
+             dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL)) {
+            isCompatible = false;
+        }
+
         if (!qemuDomainIsPSeries(def) &&
             (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO ||
              dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY)) {
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 27/30] qemu: Limit isa-serial usage to x86 guests
Posted by Pavel Hrdina 7 years, 5 months ago
On Tue, Nov 28, 2017 at 12:48:10PM +0100, Andrea Bolognani wrote:
> The ISA bus is x86 specific, so we should limit usage of isa-serial
> to x86 guests only, just like we already do eg. with sclpconsole and
> s390x guests.

This patch is not necessary, it's actually dead code because in
qemuDomainChrDefPostParse() we set the target type to "none" if
the parsed XML has target type set to "isa-serial" and then we
set the type based on the architecture.

So this patch can be dropped.

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list