summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-07-07 19:00:13 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-07-07 20:48:28 +0200
commita26cf638e070321ec529fce058f1cf1935f36708 (patch)
tree53c93ad483f548bedcdbfe55f244352c5786ce7b
parent4374038cc67405e3f5555b1870d5bb7f6570fa5d (diff)
downloadpodman-a26cf638e070321ec529fce058f1cf1935f36708.tar.gz
podman-a26cf638e070321ec529fce058f1cf1935f36708.tar.bz2
podman-a26cf638e070321ec529fce058f1cf1935f36708.zip
machine: qemu fix chardev id starting with letter
qemu need the id to start with a letter for some reason. If this is not the case qemu will fail: ``` qemu-system-x86_64: -device virtserialport,chardev=ad053e0bb519f_ready,name=org.fedoraproject.port.0: Property 'virtserialport.chardev' can't find value 'ad053e0bb519f_ready' er Identifiers consist of letters, digits, '-', '.', '_', starting with a letter. ``` To fix this we just add an "a" in front of it. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--pkg/machine/qemu/machine.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 322aa3a15..054960e18 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -138,8 +138,10 @@ func (p *Provider) NewMachine(opts machine.InitOptions) (machine.VM, error) {
cmd = append(cmd, []string{
"-device", "virtio-serial",
// qemu needs to establish the long name; other connections can use the symlink'd
- "-chardev", "socket,path=" + vm.ReadySocket.Path + ",server=on,wait=off,id=" + vm.Name + "_ready",
- "-device", "virtserialport,chardev=" + vm.Name + "_ready" + ",name=org.fedoraproject.port.0",
+ // Note both id and chardev start with an extra "a" becuase qemu requires that it
+ // starts with an letter but users can also use numbers
+ "-chardev", "socket,path=" + vm.ReadySocket.Path + ",server=on,wait=off,id=a" + vm.Name + "_ready",
+ "-device", "virtserialport,chardev=a" + vm.Name + "_ready" + ",name=org.fedoraproject.port.0",
"-pidfile", vm.VMPidFilePath.GetPath()}...)
vm.CmdLine = cmd
return vm, nil