[pve-devel] applied: [PATCH qemu] async snapshot: fix crash with VirtIO block with iothread when not saving VM state

Fiona Ebner f.ebner at proxmox.com
Mon Jul 1 14:07:58 CEST 2024


Am 28.06.24 um 11:02 schrieb Fiona Ebner:
> As reported in the community forum [0], doing a snapshot without
> saving the VM state for a VM with a VirtIO block device with iothread
> would lead to an assertion failure [1] and thus crash.
> 
> The issue is that vm_start() is called from the coroutine
> qmp_savevm_end() which violates assumptions about graph locking down
> the line. Factor out the part of qmp_savevm_end() that actually needs
> to be a coroutine into a separate helper and turn qmp_savevm_end()
> into a non-coroutine, so that it can call vm_start() safely.
> 
> The issue is likely not new, but was exposed by the recent graph
> locking rework introducing stricter checks.
> 
> The issue does not occur when saving the VM state, because then the
> non-coroutine process_savevm_finalize() will already call vm_start()
> before qmp_savevm_end().
> 
> [0]: https://forum.proxmox.com/threads/149883/
> 
> [1]:
> 
>> #0  0x00007353e6096e2c __pthread_kill_implementation (libc.so.6 + 0x8ae2c)
>> #1  0x00007353e6047fb2 __GI_raise (libc.so.6 + 0x3bfb2)
>> #2  0x00007353e6032472 __GI_abort (libc.so.6 + 0x26472)
>> #3  0x00007353e6032395 __assert_fail_base (libc.so.6 + 0x26395)
>> #4  0x00007353e6040eb2 __GI___assert_fail (libc.so.6 + 0x34eb2)
>> #5  0x0000592002307bb3 bdrv_graph_rdlock_main_loop (qemu-system-x86_64 + 0x83abb3)
>> #6  0x00005920022da455 bdrv_change_aio_context (qemu-system-x86_64 + 0x80d455)
>> #7  0x00005920022da6cb bdrv_try_change_aio_context (qemu-system-x86_64 + 0x80d6cb)
>> #8  0x00005920022fe122 blk_set_aio_context (qemu-system-x86_64 + 0x831122)
>> #9  0x00005920021b7b90 virtio_blk_start_ioeventfd (qemu-system-x86_64 + 0x6eab90)
>> #10 0x0000592002022927 virtio_bus_start_ioeventfd (qemu-system-x86_64 + 0x555927)
>> #11 0x0000592002066cc4 vm_state_notify (qemu-system-x86_64 + 0x599cc4)
>> #12 0x000059200205d517 vm_prepare_start (qemu-system-x86_64 + 0x590517)
>> #13 0x000059200205d56b vm_start (qemu-system-x86_64 + 0x59056b)
>> #14 0x00005920020a43fd qmp_savevm_end (qemu-system-x86_64 + 0x5d73fd)
>> #15 0x00005920023f3749 qmp_marshal_savevm_end (qemu-system-x86_64 + 0x926749)
>> #16 0x000059200242f1d8 qmp_dispatch (qemu-system-x86_64 + 0x9621d8)
>> #17 0x000059200238fa98 monitor_qmp_dispatch (qemu-system-x86_64 + 0x8c2a98)
>> #18 0x000059200239044e monitor_qmp_dispatcher_co (qemu-system-x86_64 + 0x8c344e)
>> #19 0x000059200245359b coroutine_trampoline (qemu-system-x86_64 + 0x98659b)
>> #20 0x00007353e605d9c0 n/a (libc.so.6 + 0x519c0)
> 
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>

applied after receiving positive off-list feedback from Fabian and Wolfgang




More information about the pve-devel mailing list