]> xenbits.xensource.com Git - libvirt.git/commit
vmx: Check serialX.vspc before serialX.fileName
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 25 Apr 2024 10:34:21 +0000 (12:34 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 2 May 2024 15:22:37 +0000 (17:22 +0200)
commit23c47944882bca4b0684ff9b4cf71f7e44235eba
tree7f515f90fe0975097270a97e1a54e5b320838b5c
parent8074d64dc2eca846d6a61efe1a9b7428a0ce1dd1
vmx: Check serialX.vspc before serialX.fileName

When using vSPC (Virtual Serial Port Concentrator) in vSphere the actual
address for it is saved in serialX.vspc in which case the
serialX.fileName is most probably something we can't get any useful
information from and we also fail during the parsing rendering any
dumpxml and similar tries unsuccessful.

Instead of parsing the vspc URL with something along the lines of
`virURIParse(vspc ? vspc : fileName)`, which could lead to us reporting
information that is very prune to misuse (the vSPC seemingly has a
protocol on top of the telnet connection; redefining the domain would
change the behaviour; the URL might have a fragment we are not saving;
etc.) or adding more XML knobs to indicate vSPC usage (which we would
not be able to configure; we'd have to properly error out everywhere;
etc.) let's just report dummy serial port that leads to nowhere (i.e.
type="null").

Resolves: https://issues.redhat.com/browse/RHEL-32182
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/vmx/vmx.c
tests/vmx2xmldata/esx-in-the-wild-13.vmx [new file with mode: 0644]
tests/vmx2xmldata/esx-in-the-wild-13.xml [new file with mode: 0644]
tests/vmx2xmltest.c