mistranslation: 0.747 graphic: 0.744 risc-v: 0.739 user-level: 0.730 debug: 0.728 PID: 0.706 x86: 0.701 permissions: 0.699 hypervisor: 0.698 performance: 0.693 VMM: 0.691 ppc: 0.676 semantic: 0.674 TCG: 0.673 socket: 0.665 peripherals: 0.665 register: 0.664 architecture: 0.662 virtual: 0.659 files: 0.648 KVM: 0.634 arm: 0.632 network: 0.630 assembly: 0.617 device: 0.602 kernel: 0.592 vnc: 0.587 boot: 0.563 i386: 0.292 qemu-system-x86_64: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed when paused vm migrating (with shared storage) from dest to src host Description of problem: We are doing migration tests with share storage (nfs) as follows: First, we pause the virtual machine using the 'virsh suspend'command, then migrate the virtual machine to the destination host by 'virsh migrate' command, and there is no problem. After the migration is complete, the virtual machine remains paused on the destination host. However, when we migrate the virtual machine back to the original host, an assertion error is triggered on the current host(dest host): ``` 705 qemu-system-x86_64: ../block.c:6748: bdrv_inactivate_recurse: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed. 706 2024-06-17 11:15:59.972+0000: shutting down, reason=crashed ``` and virsh migrate commant return error: ``` **virsh migrate test qemu+tcp://host_ip/system tcp://host_ip --live --verbose --unsafe Migration: [ 98 %]error: operation failed: domain is not running** ``` Steps to reproduce: 1. We create an vm with shareable storage and then paused vm in source host: ``` virsh create test.xml running virsh suspend test paused ``` 2. Migrate vm to the destination host: ``virsh migrate test qemu+tcp://dest_ip/system tcp://dest_ip --live --verbose --unsafe`` 3. In destination host,vm is paused. 4. Migrate vm back to the source host,and then migration failed and assert error in qemu log in destination host: ``` virsh migrate test qemu+tcp://host_ip/system tcp://host_ip --live --verbose --unsafe Migration: [ 98 %]error: operation failed: domain is not running ``` ``` 705 qemu-system-x86_64: ../block.c:6748: bdrv_inactivate_recurse: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed. 706 2024-06-17 11:15:59.972+0000: shutting down, reason=crashed ``` Additional information: 1) src -----> dest ``` migration_thread() migration_completion global_state_store() vm_stop_force_state(RUN_STATE_FINISH_MIGRATE) qemu_savevm_state_complete_precopy_nop_iterable() bdrv_inactivate_all () bdrv_inactivate_recurse() bs->open_flags |= BDRV_O_INACTIVE; (BDRV_O_INACTIVE=0x0800) ``` 2) dest -----> src ``` migration_thread() qemu_savevm_state_complete_precopy_non_iterable() bdrv_inactivate_all () bdrv_inactivate_recurse() assert(!(bs->open_flags & BDRV_O_INACTIVE)); Assert and Crash ``` I'm not sure how to address this issue. If QEMU does not support such a migration, a gentler way would be to directly report an error and exit, just like what did in migrate_prepare function, instead of crash qemu. If you have any ideas, please let me know, thanks.