vmx: Accept more serial variations

Commit 23c4794488 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>
This commit is contained in:
Martin Kletzander 2024-06-14 12:06:28 +02:00
parent 503a4e6a79
commit 025925a901
3 changed files with 8 additions and 1 deletions

View 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")) {

View 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"

View 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>