Test with libvirt-7.0.0-14.3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Scenario 1: poweroff inside vm during live migration.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I got 3 different kinds result with virsh: 1) It returned "Input/output error" [root@rhel8-4 ~]# virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 1 %]error: End of file while reading data: : Input/output error 2) It returned nothing [root@rhel8-4 ~]# virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 1 %] [root@rhel8-4 ~]# 3) It returned "domain is not running" which is expected [root@rhel8-4 ~]# virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 3 %]error: operation failed: domain is not running ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Scenario 2: destroy src vm during live migration.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@rhel8-4 ~]# virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 0 %]error: operation failed: domain is not running ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Scenario 3: kill src qemu-kvm process during live migration.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 0 %]error: operation failed: domain is not running ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Scenario 4: destroy dest vm during live migration.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 0 %]error: End of file while reading data: : Input/output error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Scenario 5: kill dest qemu-kvm process during live migration.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # virsh migrate avocado-vt-vm1 qemu+ssh://10.0.151.215/system --live --verbose --p2p --persistent --migrateuri tcp://10.0.151.215 --bandwidth 2 Migration: [ 0 %]error: operation failed: domain is no longer running
The different behavior can be partially caused by --verbose because it results in virDomainGetJobInfo (which calls query-migrate QMP command) changing the interactions and timing between EOF callback and the thread controlling the migration. Another reason (when the progress says 0%) might caused by killing QEMU too early before actual migration starts. Anyway, scenario 1, case 2 is strange and deserves some investigation (as a separate bug, because migration did not get stuck and thus this BZ is fixed) in case you are able to reproduce it and provide debug logs from both the source libvirtd and virsh.
I can't reproduce scenario 1, case 2 now. I will file a bug if I can reproduce it in the future.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:3340