[libvirt] [PATCH 5/6] domain conf: Track <console> target type

Cole Robinson crobinso at redhat.com
Mon Jul 26 19:16:24 UTC 2010


All <console> devices now export a <target> type attribute. QEMU defaults
to 'serial', UML defaults to 'uml, xen can be either 'serial' or 'xen'
depending on fullvirt. Understandably there is lots of test fallout.

This will be used to differentiate between a serial vs. virtio console for
QEMU.

Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 docs/schemas/domain.rng                            |   30 +++++++++--
 src/conf/capabilities.h                            |    1 +
 src/conf/domain_conf.c                             |   57 +++++++++++++++----
 src/conf/domain_conf.h                             |    9 +++
 src/qemu/qemu_conf.c                               |    2 +
 src/uml/uml_conf.c                                 |    2 +
 src/xen/xen_hypervisor.c                           |    2 +
 src/xen/xend_internal.c                            |    1 +
 src/xen/xm_internal.c                              |    1 +
 tests/define-dev-segfault                          |    2 +-
 .../qemuxml2argv-console-compat.xml                |    2 +-
 tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml |    2 +-
 .../qemuxml2argvdata/qemuxml2argv-serial-file.xml  |    2 +-
 .../qemuxml2argvdata/qemuxml2argv-serial-many.xml  |    2 +-
 tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml |    2 +-
 .../qemuxml2argv-serial-tcp-telnet.xml             |    2 +-
 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml |    2 +-
 tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml |    2 +-
 .../qemuxml2argvdata/qemuxml2argv-serial-unix.xml  |    2 +-
 tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml  |    2 +-
 .../qemuxml2xmlout-console-compat-auto.xml         |    2 +-
 tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml    |    2 +-
 tests/sexpr2xmldata/sexpr2xml-curmem.xml           |    2 +-
 .../sexpr2xml-disk-block-shareable.xml             |    2 +-
 tests/sexpr2xmldata/sexpr2xml-disk-block.xml       |    2 +-
 .../sexpr2xml-disk-drv-blktap-qcow.xml             |    2 +-
 .../sexpr2xml-disk-drv-blktap-raw.xml              |    2 +-
 tests/sexpr2xmldata/sexpr2xml-disk-file.xml        |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml      |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml        |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml   |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml   |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml   |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml    |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml  |    2 +-
 .../sexpr2xml-fv-serial-tcp-telnet.xml             |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml    |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml    |    2 +-
 tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml   |    2 +-
 tests/sexpr2xmldata/sexpr2xml-net-bridged.xml      |    2 +-
 tests/sexpr2xmldata/sexpr2xml-net-e1000.xml        |    2 +-
 tests/sexpr2xmldata/sexpr2xml-net-routed.xml       |    2 +-
 tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml  |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pci-devs.xml         |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml    |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml     |    2 +-
 .../sexpr2xml-pv-vfb-new-vncdisplay.xml            |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml       |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml      |    2 +-
 .../sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml  |    2 +-
 tests/sexpr2xmldata/sexpr2xml-pv.xml               |    2 +-
 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml    |    2 +-
 tests/vmx2xmldata/vmx2xml-serial-device.xml        |    2 +-
 tests/vmx2xmldata/vmx2xml-serial-file.xml          |    2 +-
 tests/vmx2xmldata/vmx2xml-serial-pipe.xml          |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-file.xml   |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-null.xml   |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-pipe.xml   |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-pty.xml    |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-stdio.xml  |    2 +-
 .../test-fullvirt-serial-tcp-telnet.xml            |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-tcp.xml    |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-udp.xml    |    2 +-
 tests/xmconfigdata/test-fullvirt-serial-unix.xml   |    2 +-
 tests/xmconfigdata/test-no-source-cdrom.xml        |    2 +-
 tests/xmconfigdata/test-paravirt-net-e1000.xml     |    2 +-
 tests/xmconfigdata/test-paravirt-net-vifname.xml   |    2 +-
 .../test-paravirt-new-pvfb-vncdisplay.xml          |    2 +-
 tests/xmconfigdata/test-paravirt-new-pvfb.xml      |    2 +-
 .../test-paravirt-old-pvfb-vncdisplay.xml          |    2 +-
 tests/xmconfigdata/test-paravirt-old-pvfb.xml      |    2 +-
 tests/xmconfigdata/test-pci-devs.xml               |    2 +-
 72 files changed, 151 insertions(+), 80 deletions(-)

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 2d22ce4..1421711 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -1202,17 +1202,37 @@
     <interleave>
       <ref name="qemucdevSrcDef"/>
       <optional>
-        <element name="target">
-          <optional>
-            <attribute name="port"/>
-          </optional>
-        </element>
+        <ref name="qemucdevTgtDef"/>
       </optional>
       <optional>
         <ref name="address"/>
       </optional>
     </interleave>
   </define>
+
+  <define name="qemucdevConsoleTgtType">
+    <attribute name="type">
+      <choice>
+        <value>xen</value>
+        <value>serial</value>
+        <value>uml</value>
+      </choice>
+    </attribute>
+  </define>
+
+  <define  name="qemucdevTgtDef">
+    <element name="target">
+      <interleave>
+        <optional>
+          <ref name="qemucdevConsoleTgtType"/>
+        </optional>
+        <optional>
+          <attribute name="port"/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
   <define name="qemucdevSrcType">
     <attribute name="type">
       <choice>
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index cd96cc3..f41be1c 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -140,6 +140,7 @@ struct _virCaps {
     unsigned int emulatorRequired : 1;
     const char *defaultDiskDriverName;
     const char *defaultDiskDriverType;
+    int defaultConsoleTargetType;
     void *(*privateDataAllocFunc)(void);
     void (*privateDataFreeFunc)(void *);
     int (*privateDataXMLFormat)(virBufferPtr, void *);
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6dde832..c9f2d25 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -169,6 +169,12 @@ VIR_ENUM_IMPL(virDomainChrChannelTarget,
               "guestfwd",
               "virtio")
 
+VIR_ENUM_IMPL(virDomainChrConsoleTarget,
+              VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST,
+              "serial",
+              "xen",
+              "uml")
+
 VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST,
               "monitor",
               "parallel",
@@ -2374,7 +2380,7 @@ error:
 }
 
 static int
-virDomainChrDefaultTargetType(int devtype) {
+virDomainChrDefaultTargetType(virCapsPtr caps, int devtype) {
 
     int target = -1;
 
@@ -2386,6 +2392,9 @@ virDomainChrDefaultTargetType(int devtype) {
         break;
 
     case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+        target = caps->defaultConsoleTargetType;
+        break;
+
     case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
     case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
     default:
@@ -2398,14 +2407,15 @@ virDomainChrDefaultTargetType(int devtype) {
 }
 
 static int
-virDomainChrTargetTypeFromString(int devtype,
+virDomainChrTargetTypeFromString(virCapsPtr caps,
+                                 int devtype,
                                  const char *targetType)
 {
     int ret = -1;
     int target = 0;
 
     if (!targetType) {
-        target = virDomainChrDefaultTargetType(devtype);
+        target = virDomainChrDefaultTargetType(caps, devtype);
         goto out;
     }
 
@@ -2414,6 +2424,10 @@ virDomainChrTargetTypeFromString(int devtype,
         target = virDomainChrChannelTargetTypeFromString(targetType);
         break;
 
+    case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+        target = virDomainChrConsoleTargetTypeFromString(targetType);
+        /* Fall through */
+
     case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
     case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
     default:
@@ -2437,6 +2451,9 @@ virDomainChrTargetTypeToString(int deviceType,
     case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
         type = virDomainChrChannelTargetTypeToString(targetType);
         break;
+    case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+        type = virDomainChrConsoleTargetTypeToString(targetType);
+        break;
     default:
         break;
     }
@@ -2445,7 +2462,8 @@ virDomainChrTargetTypeToString(int deviceType,
 }
 
 static int
-virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
+virDomainChrDefParseTargetXML(virCapsPtr caps,
+                              virDomainChrDefPtr def,
                               xmlNodePtr cur,
                               int flags ATTRIBUTE_UNUSED)
 {
@@ -2456,7 +2474,8 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
     const char *portStr = NULL;
 
     if ((def->targetType =
-        virDomainChrTargetTypeFromString(def->deviceType, targetType)) < 0) {
+        virDomainChrTargetTypeFromString(caps,
+                                         def->deviceType, targetType)) < 0) {
         goto error;
     }
 
@@ -2586,7 +2605,8 @@ error:
  *
  */
 static virDomainChrDefPtr
-virDomainChrDefParseXML(xmlNodePtr node,
+virDomainChrDefParseXML(virCapsPtr caps,
+                        xmlNodePtr node,
                         int flags) {
     xmlNodePtr cur;
     char *type = NULL;
@@ -2664,7 +2684,7 @@ virDomainChrDefParseXML(xmlNodePtr node,
                 if (protocol == NULL)
                     protocol = virXMLPropString(cur, "type");
             } else if (xmlStrEqual(cur->name, BAD_CAST "target")) {
-                if (virDomainChrDefParseTargetXML(def, cur, flags) < 0) {
+                if (virDomainChrDefParseTargetXML(caps, def, cur, flags) < 0) {
                     goto error;
                 }
             }
@@ -4504,7 +4524,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         goto no_memory;
 
     for (i = 0 ; i < n ; i++) {
-        virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+        virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+                                                         nodes[i],
                                                          flags);
         if (!chr)
             goto error;
@@ -4523,7 +4544,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         goto no_memory;
 
     for (i = 0 ; i < n ; i++) {
-        virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+        virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+                                                         nodes[i],
                                                          flags);
         if (!chr)
             goto error;
@@ -4534,7 +4556,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
     VIR_FREE(nodes);
 
     if ((node = virXPathNode("./devices/console[1]", ctxt)) != NULL) {
-        virDomainChrDefPtr chr = virDomainChrDefParseXML(node,
+        virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+                                                         node,
                                                          flags);
         if (!chr)
             goto error;
@@ -4570,7 +4593,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         goto no_memory;
 
     for (i = 0 ; i < n ; i++) {
-        virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+        virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+                                                         nodes[i],
                                                          flags);
         if (!chr)
             goto error;
@@ -5820,8 +5844,17 @@ virDomainChrDefFormat(virBufferPtr buf,
         /* Nothing to format */
         break;
 
+    case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+        virBufferVSprintf(buf,
+                          "      <target type='%s' port='%d'/>\n",
+                          virDomainChrTargetTypeToString(def->deviceType,
+                                                         def->targetType),
+                          def->target.port);
+        break;
+
     default:
-        virBufferVSprintf(buf, "      <target port='%d'/>\n", def->target.port);
+        virBufferVSprintf(buf, "      <target port='%d'/>\n",
+                          def->target.port);
         break;
     }
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 966607f..c82dc60 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -330,6 +330,14 @@ enum virDomainChrChannelTargetType {
     VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST,
 };
 
+enum virDomainChrConsoleTargetType {
+    VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL = 0,
+    VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN,
+    VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML,
+
+    VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST,
+};
+
 enum virDomainChrType {
     VIR_DOMAIN_CHR_TYPE_NULL,
     VIR_DOMAIN_CHR_TYPE_VC,
@@ -1137,6 +1145,7 @@ VIR_ENUM_DECL(virDomainFS)
 VIR_ENUM_DECL(virDomainNet)
 VIR_ENUM_DECL(virDomainChrDevice)
 VIR_ENUM_DECL(virDomainChrChannelTarget)
+VIR_ENUM_DECL(virDomainChrConsoleTarget)
 VIR_ENUM_DECL(virDomainChr)
 VIR_ENUM_DECL(virDomainSoundModel)
 VIR_ENUM_DECL(virDomainMemballoonModel)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 8873e40..3f77e6a 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1137,6 +1137,8 @@ virCapsPtr qemudCapsInit(virCapsPtr old_caps) {
     /* QEMU Requires an emulator in the XML */
     virCapabilitiesSetEmulatorRequired(caps);
 
+    caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+
     return caps;
 
  no_memory:
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index ea40efb..bef8c38 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -97,6 +97,8 @@ virCapsPtr umlCapsInit(void) {
                                       NULL) == NULL)
         goto error;
 
+    caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML;
+
     return caps;
 
  error:
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index ae17c60..67d0f4b 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -2342,6 +2342,8 @@ xenHypervisorBuildCapabilities(virConnectPtr conn,
         }
     }
 
+    caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+
     return caps;
 
  no_memory:
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index a492231..fad5ce8 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2367,6 +2367,7 @@ xenDaemonParseSxpr(virConnectPtr conn,
         if (!(def->console = xenDaemonParseSxprChar("pty", tty)))
             goto error;
         def->console->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+        def->console->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
     }
     VIR_FREE(tty);
 
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 4230504..20b828d 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1441,6 +1441,7 @@ xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
         if (!(def->console = xenDaemonParseSxprChar("pty", NULL)))
             goto cleanup;
         def->console->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+        def->console->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
     }
 
     if (hvm) {
diff --git a/tests/define-dev-segfault b/tests/define-dev-segfault
index 7a9a7b6..19d4e67 100755
--- a/tests/define-dev-segfault
+++ b/tests/define-dev-segfault
@@ -55,7 +55,7 @@ cat <<\EOF > D.xml || fail=1
       <target port='2'/>
     </parallel>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <sound model='pcspk'/>
     <sound model='es1370'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
index 611ddb8..9591c87 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
@@ -24,7 +24,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
index 5d24986..cc0ab43 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
@@ -26,7 +26,7 @@
     </serial>
     <console type='dev'>
       <source path='/dev/ttyS2'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
index 98bc4ef..3e60e98 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
@@ -26,7 +26,7 @@
     </serial>
     <console type='file'>
       <source path='/tmp/serial.log'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
index b121c5c..1d042f1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
@@ -28,7 +28,7 @@
       <target port='1'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
index 611ddb8..9591c87 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
@@ -24,7 +24,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
index 5aeceb0..5bf6a08 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
@@ -28,7 +28,7 @@
     <console type='tcp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <protocol type='telnet'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
index 286417e..304792e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
@@ -28,7 +28,7 @@
     <console type='tcp'>
       <source mode='connect' host='127.0.0.1' service='9999'/>
       <protocol type='raw'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
index 2c44738..e4fe4fd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
@@ -28,7 +28,7 @@
     <console type='udp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <source mode='connect' host='127.0.0.1' service='9998'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
index 2c07e94..61dff3f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
@@ -26,7 +26,7 @@
     </serial>
     <console type='unix'>
       <source mode='connect' path='/tmp/serial.sock'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
index 5b39736..36bd622 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
@@ -24,7 +24,7 @@
       <target port='0'/>
     </serial>
     <console type='vc'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
index 611ddb8..9591c87 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
@@ -24,7 +24,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml b/tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml
index 14dc37c..bfac0f4 100644
--- a/tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml
@@ -28,7 +28,7 @@
       <target dev='vif6.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-curmem.xml b/tests/sexpr2xmldata/sexpr2xml-curmem.xml
index fb1217b..6be4d5d 100644
--- a/tests/sexpr2xmldata/sexpr2xml-curmem.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-curmem.xml
@@ -28,7 +28,7 @@
       <target dev='vif5.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml b/tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
index f164c4d..d7e3054 100644
--- a/tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
@@ -26,7 +26,7 @@
       <target dev='vif6.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-disk-block.xml b/tests/sexpr2xmldata/sexpr2xml-disk-block.xml
index 9eb116c..d9d7552 100644
--- a/tests/sexpr2xmldata/sexpr2xml-disk-block.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-disk-block.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml b/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
index 4c56a72..04824ba 100644
--- a/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml b/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
index 4c8273f..3e935db 100644
--- a/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-disk-file.xml b/tests/sexpr2xmldata/sexpr2xml-disk-file.xml
index 10cbc2d..8aa3214 100644
--- a/tests/sexpr2xmldata/sexpr2xml-disk-file.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-disk-file.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
index 6efe8de..3f501e7 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='tablet' bus='usb'/>
     <input type='mouse' bus='ps2'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
index 2809867..bd38a25 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
@@ -25,7 +25,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
index 5a6b414..db010ad 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
@@ -41,7 +41,7 @@
     </serial>
     <console type='file'>
       <source path='/tmp/serial.log'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
index f496433..faeed77 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='null'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
index 97d4528..0967ac7 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
@@ -41,7 +41,7 @@
     </serial>
     <console type='pipe'>
       <source path='/tmp/serial.pipe'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
index 06da049..3773d3b 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
index 5f89a75..d46df09 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='stdio'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
index e6cb357..34f25ac 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
@@ -43,7 +43,7 @@
     <console type='tcp'>
       <source mode='bind' host='localhost' service='9999'/>
       <protocol type='telnet'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
index 2eac19c..6c69214 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
@@ -43,7 +43,7 @@
     <console type='tcp'>
       <source mode='bind' host='localhost' service='9999'/>
       <protocol type='raw'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
index 9a3a0e2..bcc20dd 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
@@ -43,7 +43,7 @@
     <console type='udp'>
       <source mode='bind' host='localhost' service='9999'/>
       <source mode='connect' host='localhost' service='9998'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
index e026cf8..93f20fa 100644
--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
@@ -41,7 +41,7 @@
     </serial>
     <console type='unix'>
       <source mode='bind' path='/tmp/serial.sock'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5901' autoport='no'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-net-bridged.xml b/tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
index 717ec79..a1249ba 100644
--- a/tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
@@ -27,7 +27,7 @@
       <target dev='vif6.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml b/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml
index be77a82..91fd656 100644
--- a/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml
@@ -28,7 +28,7 @@
       <model type='e1000'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-net-routed.xml b/tests/sexpr2xmldata/sexpr2xml-net-routed.xml
index 07a08db..a519551 100644
--- a/tests/sexpr2xmldata/sexpr2xml-net-routed.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-net-routed.xml
@@ -27,7 +27,7 @@
       <target dev='vif6.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
index db34474..5a82775 100644
--- a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
@@ -38,7 +38,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pci-devs.xml b/tests/sexpr2xmldata/sexpr2xml-pci-devs.xml
index 40e12c0..fe0ecb6 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pci-devs.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pci-devs.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <hostdev mode='subsystem' type='pci' managed='no'>
       <source>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
index eddf32f..920c058 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
@@ -20,7 +20,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml b/tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml
index 480327d..6466192 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
index 40302d0..0914bc9 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='5925' autoport='no' listen='0.0.0.0' keymap='ja'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
index 9a0ad1f..0657fba 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
index 9a0ad1f..0657fba 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
index 19c7ab8..766c78d 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
@@ -26,7 +26,7 @@
       <target dev='vif1.0'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
diff --git a/tests/sexpr2xmldata/sexpr2xml-pv.xml b/tests/sexpr2xmldata/sexpr2xml-pv.xml
index 10cbc2d..8aa3214 100644
--- a/tests/sexpr2xmldata/sexpr2xml-pv.xml
+++ b/tests/sexpr2xmldata/sexpr2xml-pv.xml
@@ -21,7 +21,7 @@
       <target dev='xvda' bus='xen'/>
     </disk>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml
index 5b8fbb9..4238882 100644
--- a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml
+++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml
@@ -36,7 +36,7 @@
     </parallel>
     <console type='file'>
       <source path='[498076b2-02796c1a-ef5b-000ae484a6a3] virtMonServ1/serial1.file'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/vmx2xmldata/vmx2xml-serial-device.xml b/tests/vmx2xmldata/vmx2xml-serial-device.xml
index 83e1ce9..c9f00eb 100644
--- a/tests/vmx2xmldata/vmx2xml-serial-device.xml
+++ b/tests/vmx2xmldata/vmx2xml-serial-device.xml
@@ -17,7 +17,7 @@
     </serial>
     <console type='dev'>
       <source path='/dev/ttyS0'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/vmx2xmldata/vmx2xml-serial-file.xml b/tests/vmx2xmldata/vmx2xml-serial-file.xml
index 95816e0..21b6263 100644
--- a/tests/vmx2xmldata/vmx2xml-serial-file.xml
+++ b/tests/vmx2xmldata/vmx2xml-serial-file.xml
@@ -17,7 +17,7 @@
     </serial>
     <console type='file'>
       <source path='[datastore] directory/serial0.file'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe.xml b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml
index 38e69a6..cf8a797 100644
--- a/tests/vmx2xmldata/vmx2xml-serial-pipe.xml
+++ b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml
@@ -17,7 +17,7 @@
     </serial>
     <console type='pipe'>
       <source path='serial0.pipe'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
   </devices>
 </domain>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-file.xml b/tests/xmconfigdata/test-fullvirt-serial-file.xml
index a601ee2..02ecaa2 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-file.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-file.xml
@@ -42,7 +42,7 @@
     </serial>
     <console type='file'>
       <source path='/tmp/serial.log'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-null.xml b/tests/xmconfigdata/test-fullvirt-serial-null.xml
index 94b4034..542b779 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-null.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-null.xml
@@ -40,7 +40,7 @@
       <target port='0'/>
     </serial>
     <console type='null'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
index 217806a..6150168 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
@@ -42,7 +42,7 @@
     </serial>
     <console type='pipe'>
       <source path='/tmp/serial.pipe'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-pty.xml b/tests/xmconfigdata/test-fullvirt-serial-pty.xml
index 4576087..53e6d4f 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-pty.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-pty.xml
@@ -40,7 +40,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
index 8717799..b540481 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
@@ -40,7 +40,7 @@
       <target port='0'/>
     </serial>
     <console type='stdio'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
index 52c433e..31c5de8 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
@@ -44,7 +44,7 @@
     <console type='tcp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <protocol type='telnet'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
index 062cf54..3b2994a 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
@@ -44,7 +44,7 @@
     <console type='tcp'>
       <source mode='connect' host='127.0.0.1' service='7777'/>
       <protocol type='raw'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-udp.xml b/tests/xmconfigdata/test-fullvirt-serial-udp.xml
index 7871310..66b3824 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-udp.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-udp.xml
@@ -44,7 +44,7 @@
     <console type='udp'>
       <source mode='bind' host='0.0.0.0' service='99998'/>
       <source mode='connect' host='127.0.0.1' service='9999'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-fullvirt-serial-unix.xml b/tests/xmconfigdata/test-fullvirt-serial-unix.xml
index e517b33..1ffe6be 100644
--- a/tests/xmconfigdata/test-fullvirt-serial-unix.xml
+++ b/tests/xmconfigdata/test-fullvirt-serial-unix.xml
@@ -42,7 +42,7 @@
     </serial>
     <console type='unix'>
       <source mode='bind' path='/tmp/serial.sock'/>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-no-source-cdrom.xml b/tests/xmconfigdata/test-no-source-cdrom.xml
index 9b1dd01..4114510 100644
--- a/tests/xmconfigdata/test-no-source-cdrom.xml
+++ b/tests/xmconfigdata/test-no-source-cdrom.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.xml b/tests/xmconfigdata/test-paravirt-net-e1000.xml
index bb8308b..d709e69 100644
--- a/tests/xmconfigdata/test-paravirt-net-e1000.xml
+++ b/tests/xmconfigdata/test-paravirt-net-e1000.xml
@@ -25,7 +25,7 @@
       <model type='e1000'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-paravirt-net-vifname.xml b/tests/xmconfigdata/test-paravirt-net-vifname.xml
index 9814577..b6c4739 100644
--- a/tests/xmconfigdata/test-paravirt-net-vifname.xml
+++ b/tests/xmconfigdata/test-paravirt-net-vifname.xml
@@ -26,7 +26,7 @@
       <model type='e1000'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
index eb95fd4..39325ea 100644
--- a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
+++ b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
@@ -24,7 +24,7 @@
       <script path='vif-bridge'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.xml b/tests/xmconfigdata/test-paravirt-new-pvfb.xml
index f359ba1..40c79cb 100644
--- a/tests/xmconfigdata/test-paravirt-new-pvfb.xml
+++ b/tests/xmconfigdata/test-paravirt-new-pvfb.xml
@@ -24,7 +24,7 @@
       <script path='vif-bridge'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml
index eb95fd4..39325ea 100644
--- a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml
+++ b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml
@@ -24,7 +24,7 @@
       <script path='vif-bridge'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.xml b/tests/xmconfigdata/test-paravirt-old-pvfb.xml
index f359ba1..40c79cb 100644
--- a/tests/xmconfigdata/test-paravirt-old-pvfb.xml
+++ b/tests/xmconfigdata/test-paravirt-old-pvfb.xml
@@ -24,7 +24,7 @@
       <script path='vif-bridge'/>
     </interface>
     <console type='pty'>
-      <target port='0'/>
+      <target type='xen' port='0'/>
     </console>
     <input type='mouse' bus='xen'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
diff --git a/tests/xmconfigdata/test-pci-devs.xml b/tests/xmconfigdata/test-pci-devs.xml
index 09456d0..74bc227 100644
--- a/tests/xmconfigdata/test-pci-devs.xml
+++ b/tests/xmconfigdata/test-pci-devs.xml
@@ -39,7 +39,7 @@
       <target port='0'/>
     </serial>
     <console type='pty'>
-      <target port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes'/>
-- 
1.7.1.1




More information about the libvir-list mailing list