diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index a719d14fea..e141e11324 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4192,6 +4192,26 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr,
}
}
+ /* Set the default target model */
+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
+ chr->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE) {
+ switch ((virDomainChrSerialTargetType) chr->targetType) {
+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL;
+ break;
+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL;
+ break;
+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
+ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL;
+ break;
+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
+ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
+ /* Nothing to do */
+ break;
+ }
+ }
+
/* clear auto generated unix socket path for inactive definitions */
if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) {
if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0)
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
index 7c106f145c..cba43ca451 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml
@@ -28,7 +28,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
index e76d0211dc..e9998d5542 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml
@@ -29,7 +29,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
index ed67ada0d8..0e9dfe5789 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml
@@ -29,7 +29,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
index 420771dc9c..05374b38da 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml
@@ -28,11 +28,15 @@
-
+
+
+
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
index 7c106f145c..cba43ca451 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml
@@ -28,7 +28,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
index 3fe61ffa05..1ac12440e2 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml
@@ -30,7 +30,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
index 3fc9fd39b0..c10cee903b 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml
@@ -30,7 +30,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
index 5b4af3fe95..fd56dda84c 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml
@@ -30,11 +30,15 @@
-
+
+
+
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
index 6bb291ff7f..70b192f671 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml
@@ -29,7 +29,9 @@
-
+
+
+
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
index 41954fc85d..630844ea0f 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
+++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml
@@ -28,7 +28,9 @@
-
+
+
+
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
index 427f431cce..abe68a0a07 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml
@@ -68,17 +68,23 @@
-
+
+
+
-
+
+
+
-
+
+
+
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
index 144f6eff7a..45161e1e2d 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml
@@ -68,17 +68,23 @@
-
+
+
+
-
+
+
+
-
+
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
index e6c4adb6f3..89dc9e6e1d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml
@@ -29,12 +29,16 @@
-
+
+
+
-
+
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
index f9724d320e..52132a82d7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
@@ -110,10 +110,14 @@
-
+
+
+
-
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
index fddab31f07..b02a5a7db6 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-pci-serial.xml
@@ -34,7 +34,9 @@
-
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
index 5ee73b527e..b6d7a66361 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml
@@ -33,7 +33,9 @@
-
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
index ad77f62d9e..7d5bbdd0ab 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml
@@ -25,13 +25,17 @@
-
+
+
+
-
+
+
+