Skip to content

For QEMU 7.0.0-rc1, nbd-server-add fails with qcow2 image with iothread in migration context

Host environment

  • Operating system: Proxmox VE 7.1 (but using upstream QEMU build)
  • OS/kernel version: Linux pve701 5.13.19-6-pve #1 SMP PVE 5.13.19-14 (Thu, 10 Mar 2022 16:24:52 +0100)
  • Architecture: x86
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: QEMU emulator version 6.2.91 (v7.0.0-rc1)
  • QEMU command line:
    qemu-system-x86_64 -chardev socket,id=qmp,path=/var/run/qemu-server/145.qmp,server=on,wait=off -mon chardev=qmp,mode=control -pidfile /var/run/qemu-server/145.pid -m 512 -object iothread,id=iothread-virtioscsi0 -device pci-bridge,id=pci.3,chassis_nr=3,bus=pci.0,addr=0x5 -device virtio-scsi-pci,id=virtioscsi0,bus=pci.3,addr=0x1,iothread=iothread-virtioscsi0 -drive file=/root/target-disk.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none -device scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0 -incoming defer -S

Description of problem

Upon adding the drive for NBD (via QMP), there is an error message kvm: ../block.c:3657: bdrv_open_child: Assertion `qemu_in_main_thread()' failed. and then the process aborts.

Steps to reproduce

  1. Create image: qemu-img create -f qcow2 /root/target-disk.qcow2 4G
  2. Start QEMU as mentioned above.
  3. Issue nbd-server-start QMP command (I used type unix).
  4. Issue nbd-server-add command for the single disk.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information