c1c534
From 09ae09618f6b4f7728b380ea1a9ee7f8ab681877 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <09ae09618f6b4f7728b380ea1a9ee7f8ab681877@dist-git>
c1c534
From: Andrea Bolognani <abologna@redhat.com>
c1c534
Date: Wed, 29 Nov 2017 16:23:08 +0100
c1c534
Subject: [PATCH] qemu: Set targetModel based on targetType for serial devices
c1c534
c1c534
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
c1c534
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
c1c534
(cherry picked from commit 72bf21f23357d2b3d37b4b1b5611d6a5f5dc663e)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1449265
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1511421
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1512929
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1512934
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_domain.c                               | 20 ++++++++++++++++++++
c1c534
 .../qemuargv2xmldata/qemuargv2xml-console-compat.xml |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml   |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml  |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml  |  8 ++++++--
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml   |  4 +++-
c1c534
 .../qemuargv2xml-serial-tcp-telnet.xml               |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml   |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml   |  8 ++++++--
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml  |  4 +++-
c1c534
 tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml    |  4 +++-
c1c534
 ...uhotplug-console-compat-2-live+console-virtio.xml | 12 +++++++++---
c1c534
 .../qemuhotplug-console-compat-2-live.xml            | 12 +++++++++---
c1c534
 ...qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml |  8 ++++++--
c1c534
 tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml |  8 ++++++--
c1c534
 .../qemuxml2xmlout-aarch64-pci-serial.xml            |  4 +++-
c1c534
 .../qemuxml2xmlout-bios-nvram-os-interleave.xml      |  4 +++-
c1c534
 .../qemuxml2xmlout-chardev-label.xml                 |  8 ++++++--
c1c534
 .../qemuxml2xmlout-console-compat-auto.xml           |  4 +++-
c1c534
 .../qemuxml2xmlout-console-compat.xml                |  4 +++-
c1c534
 .../qemuxml2xmlout-console-compat2.xml               |  4 +++-
c1c534
 .../qemuxml2xmlout-console-virtio-many.xml           |  4 +++-
c1c534
 .../qemuxml2xmlout-interface-driver.xml              |  4 +++-
c1c534
 .../qemuxml2xmlout-interface-server.xml              |  8 ++++++--
c1c534
 .../qemuxml2xmlout-net-bandwidth.xml                 |  4 +++-
c1c534
 .../qemuxml2xmlout-net-bandwidth2.xml                |  4 +++-
c1c534
 .../qemuxml2xmlout-net-coalesce.xml                  |  4 +++-
c1c534
 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml  |  4 +++-
c1c534
 .../qemuxml2xmlout-panic-pseries.xml                 |  4 +++-
c1c534
 .../qemuxml2xmlout-pci-serial-dev-chardev.xml        |  4 +++-
c1c534
 .../qemuxml2xmlout-pseries-cpu-compat-power9.xml     |  4 +++-
c1c534
 .../qemuxml2xmlout-pseries-cpu-compat.xml            |  4 +++-
c1c534
 .../qemuxml2xmlout-pseries-cpu-exact.xml             |  4 +++-
c1c534
 .../qemuxml2xmlout-pseries-panic-missing.xml         |  4 +++-
c1c534
 .../qemuxml2xmlout-pseries-panic-no-address.xml      |  4 +++-
c1c534
 .../qemuxml2xmlout-q35-virt-manager-basic.xml        |  4 +++-
c1c534
 .../qemuxml2xmlout-serial-spiceport-nospice.xml      |  4 +++-
c1c534
 .../qemuxml2xmlout-serial-spiceport.xml              |  4 +++-
c1c534
 .../qemuxml2xmlout-serial-target-port-auto.xml       | 12 +++++++++---
c1c534
 .../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml    |  8 ++++++--
c1c534
 .../qemuxml2xmlout-tap-vhost-incorrect.xml           |  4 +++-
c1c534
 .../qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml  |  4 +++-
c1c534
 .../qemuxml2xmlout-vhost_queues.xml                  |  4 +++-
c1c534
 43 files changed, 185 insertions(+), 55 deletions(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
c1c534
index bb25255b94..a8a91de2fe 100644
c1c534
--- a/src/qemu/qemu_domain.c
c1c534
+++ b/src/qemu/qemu_domain.c
c1c534
@@ -4188,6 +4188,26 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
c1c534
         }
c1c534
     }
c1c534
 
c1c534
+    /* Set the default target model */
c1c534
+    if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
c1c534
+        chr->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE) {
c1c534
+        switch ((virDomainChrSerialTargetType) chr->targetType) {
c1c534
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
c1c534
+            chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL;
c1c534
+            break;
c1c534
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
c1c534
+            chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL;
c1c534
+            break;
c1c534
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
c1c534
+            chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL;
c1c534
+            break;
c1c534
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
c1c534
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
c1c534
+            /* Nothing to do */
c1c534
+            break;
c1c534
+        }
c1c534
+    }
c1c534
+
c1c534
     /* clear auto generated unix socket path for inactive definitions */
c1c534
     if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) {
c1c534
         if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0)
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
c1c534
index 7c106f145c..cba43ca451 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
c1c534
index e76d0211dc..e9998d5542 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
c1c534
@@ -29,7 +29,9 @@
c1c534
     </controller>
c1c534
     <serial type='dev'>
c1c534
       <source path='/dev/ttyS2'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='dev'>
c1c534
       <source path='/dev/ttyS2'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
c1c534
index ed67ada0d8..0e9dfe5789 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
c1c534
@@ -29,7 +29,9 @@
c1c534
     </controller>
c1c534
     <serial type='file'>
c1c534
       <source path='/tmp/serial.log'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='file'>
c1c534
       <source path='/tmp/serial.log'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
c1c534
index 420771dc9c..05374b38da 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
c1c534
@@ -28,11 +28,15 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='file'>
c1c534
       <source path='/tmp/serial.log'/>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
c1c534
index 7c106f145c..cba43ca451 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
c1c534
index 3fe61ffa05..1ac12440e2 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
c1c534
@@ -30,7 +30,9 @@
c1c534
     <serial type='tcp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='9999'/>
c1c534
       <protocol type='telnet'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='tcp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='9999'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
c1c534
index 3fc9fd39b0..c10cee903b 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
c1c534
@@ -30,7 +30,9 @@
c1c534
     <serial type='tcp'>
c1c534
       <source mode='connect' host='127.0.0.1' service='9999'/>
c1c534
       <protocol type='raw'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='tcp'>
c1c534
       <source mode='connect' host='127.0.0.1' service='9999'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
c1c534
index 5b4af3fe95..fd56dda84c 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
c1c534
@@ -30,11 +30,15 @@
c1c534
     <serial type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='9999'/>
c1c534
       <source mode='connect' host='127.0.0.1' service='9998'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='udp'>
c1c534
       <source mode='connect' service='9999'/>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='9999'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
c1c534
index 6bb291ff7f..70b192f671 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
c1c534
@@ -29,7 +29,9 @@
c1c534
     </controller>
c1c534
     <serial type='unix'>
c1c534
       <source mode='connect' path='/tmp/serial.sock'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='unix'>
c1c534
       <source mode='connect' path='/tmp/serial.sock'/>
c1c534
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
c1c534
index 41954fc85d..630844ea0f 100644
c1c534
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
c1c534
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
c1c534
     </controller>
c1c534
     <serial type='vc'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='vc'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
c1c534
index 427f431cce..abe68a0a07 100644
c1c534
--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
c1c534
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
c1c534
@@ -68,17 +68,23 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial0'/>
c1c534
     </serial>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial1'/>
c1c534
     </serial>
c1c534
     <serial type='tcp'>
c1c534
       <source mode='bind' host='0.0.0.0' service='2445'/>
c1c534
       <protocol type='raw'/>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial2'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
c1c534
index 144f6eff7a..45161e1e2d 100644
c1c534
--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
c1c534
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
c1c534
@@ -68,17 +68,23 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial0'/>
c1c534
     </serial>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial1'/>
c1c534
     </serial>
c1c534
     <serial type='tcp'>
c1c534
       <source mode='bind' host='0.0.0.0' service='2445'/>
c1c534
       <protocol type='raw'/>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <alias name='serial2'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
c1c534
index e6c4adb6f3..89dc9e6e1d 100644
c1c534
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
c1c534
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
c1c534
@@ -29,12 +29,16 @@
c1c534
     <serial type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='1111'/>
c1c534
       <source mode='connect' host='127.0.0.1' service='2222'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='tcp'>
c1c534
       <source mode='connect' host='127.0.0.1' service='5555' tls='no'/>
c1c534
       <protocol type='raw'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='1111'/>
c1c534
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
c1c534
index f9724d320e..52132a82d7 100644
c1c534
--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
c1c534
+++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
c1c534
@@ -110,10 +110,14 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
c1c534
index fddab31f07..b02a5a7db6 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
c1c534
@@ -34,7 +34,9 @@
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
       <log file='/tmp/log' append='on'/>
c1c534
-      <target type='pci-serial' port='0'/>
c1c534
+      <target type='pci-serial' port='0'>
c1c534
+        <model name='pci-serial'/>
c1c534
+      </target>
c1c534
       <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
c1c534
     </serial>
c1c534
   </devices>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
c1c534
index 5ee73b527e..b6d7a66361 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
c1c534
@@ -33,7 +33,9 @@
c1c534
     </controller>
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
c1c534
index ad77f62d9e..7d5bbdd0ab 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
c1c534
@@ -25,13 +25,17 @@
c1c534
       <source path='/tmp/serial.file'>
c1c534
         <seclabel model='dac' relabel='no'/>
c1c534
       </source>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='unix'>
c1c534
       <source mode='connect' path='/tmp/serial.sock'>
c1c534
         <seclabel model='dac' relabel='no'/>
c1c534
       </source>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='file'>
c1c534
       <source path='/tmp/serial.file'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
c1c534
index cd9d75c4b7..267b253b15 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
c1c534
@@ -27,7 +27,9 @@
c1c534
     </controller>
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml
c1c534
index 0c0bd7b348..6a52800a33 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
     </controller>
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
c1c534
index 305c53eab7..8c7bbb768e 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
c1c534
@@ -31,7 +31,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml
c1c534
index b38b3ce987..1a22b78b8c 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml
c1c534
@@ -30,7 +30,9 @@
c1c534
     </controller>
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml
c1c534
index 06192fbb4a..5be590e759 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml
c1c534
@@ -47,7 +47,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml
c1c534
index a6eaa38079..049b1472a8 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml
c1c534
@@ -104,10 +104,14 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml
c1c534
index e6ad234240..4ec77d154f 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml
c1c534
@@ -55,7 +55,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml
c1c534
index 66448ec3dd..ee65c3a5b1 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml
c1c534
@@ -44,7 +44,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
c1c534
index b1240b8ed1..56792b9999 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml
c1c534
@@ -57,7 +57,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml
c1c534
index 4f7ad323ed..fc7b2e39ae 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml
c1c534
@@ -54,7 +54,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
c1c534
index a563b6dddf..496df0696c 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml
c1c534
@@ -22,7 +22,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml
c1c534
index 2f704cc0a1..8f77ef043a 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-serial-dev-chardev.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='dev'>
c1c534
       <source path='/dev/ttyS2'/>
c1c534
-      <target type='pci-serial' port='0'/>
c1c534
+      <target type='pci-serial' port='0'>
c1c534
+        <model name='pci-serial'/>
c1c534
+      </target>
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
c1c534
     </serial>
c1c534
     <console type='dev'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
c1c534
index 59587b3c32..9d4c5efe67 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml
c1c534
@@ -25,7 +25,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
c1c534
index a39e1fd015..6059859abd 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml
c1c534
@@ -25,7 +25,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
c1c534
index 666eede1a5..f3216523ed 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml
c1c534
@@ -26,7 +26,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
c1c534
index a563b6dddf..496df0696c 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml
c1c534
@@ -22,7 +22,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
c1c534
index a563b6dddf..496df0696c 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml
c1c534
@@ -22,7 +22,9 @@
c1c534
       <target index='0'/>
c1c534
     </controller>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
       <address type='spapr-vio' reg='0x30000000'/>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml
c1c534
index 27baaa3f14..2437fdec44 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml
c1c534
@@ -79,7 +79,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml
c1c534
index 63462e6f94..e1d5cb9d72 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='spiceport'>
c1c534
       <source channel='org.qemu.console.serial.0'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='spiceport'>
c1c534
       <source channel='org.qemu.console.serial.0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml
c1c534
index c90bbeb7d5..ff92435afe 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml
c1c534
@@ -28,7 +28,9 @@
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='spiceport'>
c1c534
       <source channel='org.qemu.console.serial.0'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='spiceport'>
c1c534
       <source channel='org.qemu.console.serial.0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
c1c534
index a8790b5098..fded758eac 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
c1c534
@@ -27,13 +27,19 @@
c1c534
     </controller>
c1c534
     <controller type='pci' index='0' model='pci-root'/>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='null'>
c1c534
-      <target type='isa-serial' port='1'/>
c1c534
+      <target type='isa-serial' port='1'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='stdio'>
c1c534
-      <target type='isa-serial' port='2'/>
c1c534
+      <target type='isa-serial' port='2'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml
c1c534
index a8af87b53b..76d8948204 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml
c1c534
@@ -29,12 +29,16 @@
c1c534
     <serial type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='1111'/>
c1c534
       <source mode='connect' host='127.0.0.1' service='2222'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <serial type='tcp'>
c1c534
       <source mode='connect' host='127.0.0.1' service='5555'/>
c1c534
       <protocol type='raw'/>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='udp'>
c1c534
       <source mode='bind' host='127.0.0.1' service='1111'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml
c1c534
index 6d847de3a2..df4c67bb4d 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml
c1c534
@@ -40,7 +40,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml
c1c534
index 30989658f4..70c6a1a0fb 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml
c1c534
@@ -47,7 +47,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml
c1c534
index 72cbcc4cb5..49a7b550b3 100644
c1c534
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml
c1c534
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml
c1c534
@@ -46,7 +46,9 @@
c1c534
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c1c534
     </interface>
c1c534
     <serial type='pty'>
c1c534
-      <target type='isa-serial' port='0'/>
c1c534
+      <target type='isa-serial' port='0'>
c1c534
+        <model name='isa-serial'/>
c1c534
+      </target>
c1c534
     </serial>
c1c534
     <console type='pty'>
c1c534
       <target type='serial' port='0'/>
c1c534
-- 
c1c534
2.15.1
c1c534