Bug 2167670

Summary: Guest shutdown's reason is not correct after cancelling multifd migration
Product: Red Hat Enterprise Linux 9 Reporter: yafu <yafu>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
libvirt sub component: Live Migration QA Contact: Fangge Jin <fjin>
Status: NEW --- Docs Contact:
Severity: medium    
Priority: unspecified CC: fjin, lmen, nilal, virt-maint
Version: 9.2   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yafu 2023-02-07 08:56:32 UTC
Description of problem:
Guest shutdown's reason is not correct after cancelling multifd migration

Version-Release number of selected component (if applicable):
libvirt-daemon-9.0.0-3.el9.x86_64
qemu-kvm-7.2.0-7.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Do multifd migration and cancel it:
# virsh migrate test2 qemu+ssh://*.*.com/system --live  --verbose --persistent --parallel --parallel-connections 255
Migration: [ 12 %]^Cerror: operation aborted: job 'migration out' canceled by client

2.Check the guest's domstate:
#virsh domstate test2 --reason
# virsh domstate test2 --reason 
shut off (crashed)

3.Check the qemu log on the target host:
#cat /var/log/libvirt/qemu/test2.log
...
2023-02-07T08:32:44.133243Z qemu-kvm: Unknown combination of migration flags: 0x0
2023-02-07T08:32:44.133294Z qemu-kvm: error while loading state section id 2(ram)
2023-02-07T08:32:44.133451Z qemu-kvm: load of migration failed: Invalid argument
2023-02-07 08:32:44.343+0000: shutting down, reason=crashed

4.Check the coredump on the target host:
# coredumpctl list
no output

Actual results:
Guest shutdown's reason is not correct after cancelling multifd migration, the guest did not crash on the target host.


Expected results:
The guest shutdown's reason should be 'failed'.


Additional info:
1.The guest shutdown's reason is 'failed' after cancelling non-multifd migraiton.