Skip to content

readconfig with [vnc] only causes assertion failure

Host environment

  • Operating system: Debian Testing
  • OS/kernel version: 6.14rc3
  • Architecture: x86_64
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: QEMU emulator version 9.2.1 (Debian 1:9.2.1+ds-1)
  • QEMU command line: qemu-system-amd64 -readconfig test.config

Emulated/Virtualized environment

N/A

Description of problem

Given test.config containing

[vnc]
$ qemu-system-amd64 -readconfig test.config
qemu-system-amd64: ui/vnc.c:4294: vnc_init_func: Assertion `id' failed.
Aborted
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./nptl/pthread_kill.c:44
#1  0x00007ffff68f3e2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
#2  0x00007ffff689fd02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff68884f0 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff6888418 in __assert_fail_base (fmt=0x7ffff6a0cca0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=assertion@entry=0x55555608eef6 "id", file=file@entry=0x555556068a5e "ui/vnc.c", line=line@entry=4294,
    function=function@entry=0x5555561c3fe0 <__PRETTY_FUNCTION__.0> "vnc_init_func") at ./assert/assert.c:96
#5  0x00007ffff6898612 in __assert_fail (assertion=assertion@entry=0x55555608eef6 "id",
    file=file@entry=0x555556068a5e "ui/vnc.c", line=line@entry=4294,
    function=function@entry=0x5555561c3fe0 <__PRETTY_FUNCTION__.0> "vnc_init_func") at ./assert/assert.c:105
#6  0x0000555555a03adb in vnc_init_func (opaque=<optimized out>, opts=<optimized out>,
    errp=0x5555570db038 <error_fatal>) at ui/vnc.c:4294
#7  0x0000555556037b31 in qemu_opts_foreach (list=<optimized out>, func=0x555555a039f0 <vnc_init_func>,
    opaque=opaque@entry=0x0, errp=errp@entry=0x5555570db038 <error_fatal>) at util/qemu-option.c:1135
#8  0x0000555555c41eff in qemu_init_displays () at system/vl.c:2619
#9  qemu_init (argc=<optimized out>, argv=<optimized out>) at system/vl.c:3762
#10 0x00005555559e1c0d in main (argc=<optimized out>, argv=<optimized out>) at system/main.c:47

https://gitlab.com/qemu-project/qemu/-/blob/master/ui/vnc.c#L4294

Passing an invalid value to id results in qemu-system-amd64: -readconfig test.config: Parameter 'id' expects an identifier Identifiers consist of letters, digits, '-', '.', '_', starting with a letter. so perhaps a missing value should cause a similar error?

PS: Where's the documentation for -readconfig?

Edited by Adam Baxter
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information