]> xenbits.xensource.com Git - libvirt.git/commitdiff
vmx: Accept more serial variations
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 14 Jun 2024 10:06:28 +0000 (12:06 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 19 Jun 2024 12:28:38 +0000 (14:28 +0200)
Commit 23c47944882b added parsing of serial ports connected to vspc, but
the VM can also have a network serial port with an empty filename or no
filename at all.  Parse these the same way, as a <serial type='null'>.

Resolves: https://issues.redhat.com/browse/RHEL-32182

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/vmx/vmx.c
tests/vmx2xmldata/esx-in-the-wild-13.vmx
tests/vmx2xmldata/esx-in-the-wild-13.xml

index d90b41d2ad14a80f6db85b21ce0f5bc8f5c021d7..d082a0766010e0f54800c492784d9c88e2576afb 100644 (file)
@@ -3065,7 +3065,7 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
         (*def)->target.port = port;
         (*def)->source->type = VIR_DOMAIN_CHR_TYPE_PIPE;
         (*def)->source->data.file.path = g_steal_pointer(&fileName);
-    } else if (STRCASEEQ(fileType, "network") && vspc) {
+    } else if (STRCASEEQ(fileType, "network") && (vspc || !fileName || STREQ(fileName, ""))) {
         (*def)->target.port = port;
         (*def)->source->type = VIR_DOMAIN_CHR_TYPE_NULL;
     } else if (STRCASEEQ(fileType, "network")) {
index 1016acab28d8a1d829e8537e3c2e2da0abbd83d6..d67e01814e93522dfd9d882e5bbb376b63085351 100644 (file)
@@ -29,6 +29,10 @@ serial0.fileName = "ZmVybmV0IGdBQUFBQUJrdFotaW8yclpkRXR6N3dBcDdyYkFMaWFUMVd4RENJ
 serial0.vspc = "telnets://10.28.100.26:18979#thumbprint=18:F5:79:E5:73:A5:22:83:C0:57:B9:B4:FA:CE:60:19:F1:12:F5:7B"
 serial0.yieldOnMsrRead = "TRUE"
 serial0.present = "TRUE"
+serial1.fileType = "network"
+serial1.fileName = ""
+serial1.yieldOnMsrRead = "TRUE"
+serial1.present = "TRUE"
 displayName = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)"
 annotation = "name:Test-Mig-VM-1|0Auserid:962314ba515c48388a0e95c0961709ff|0Ausername:admin|0Aprojectid:b06b5f77b6bb442f85b1c67cff980ef9|0Aprojectname:MIS|0Aflavor:name:mig-test-flavor|0Aflavor:memory_mb:1024|0Aflavor:vcpus:1|0Aflavor:ephemeral_gb:0|0Aflavor:root_gb:10|0Aflavor:swap:0|0Aimageid:8b90d6fa-20ab-4adf-8015-aad3dddb246c|0Apackage:20.6.2|0A"
 guestOS = "other-64"
index 552c9a2a1a263681640c95f30e6755a6d76fa31a..e6ef947d501ffe468432c97a6f697e977fe83cdd 100644 (file)
@@ -43,6 +43,9 @@ package:20.6.2
     <serial type='null'>
       <target port='0'/>
     </serial>
+    <serial type='null'>
+      <target port='1'/>
+    </serial>
     <console type='null'>
       <target type='serial' port='0'/>
     </console>