mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user