Bug 2137298

Summary: The Operation field of domjobinfo is "Unknown" on migration target host
Product: Red Hat Enterprise Linux 9 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
libvirt sub component: Live Migration QA Contact: Fangge Jin <fjin>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: jdenemar, lcheng, lmen, virt-maint, xuzhang, yafu
Version: 9.2Keywords: Regression, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-8.10.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:27:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 8.10.0
Embargoed:
Attachments:
Description Flags
virtqemud log none

Description Fangge Jin 2022-10-24 11:28:18 UTC
Created attachment 1919951 [details]
virtqemud log

Description of problem:
Check domjobinfo on target host after migration completes, the Operation field is "Unknown".

Version-Release number of selected component (if applicable):
qemu-kvm-7.1.0-3.el9.x86_64
libvirt-8.8.0-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start guest

2. Migrate guest to target host
# virsh migrate vm1 qemu+tcp://{taraget_host}/system --live --p2p

3. After migration completes, check domjobinfo
1) On src host:
# virsh domjobinfo vm1 --completed
Job type:         Completed   
Operation:        Outgoing migration
Time elapsed:     7356         ms
Data processed:   620.024 MiB
...

2) On target host:
# virsh domjobinfo vm1 --completed
Job type:         Completed   
Operation:        Unknown     
Time elapsed:     7349         ms
Data processed:   620.024 MiB


Actual results:
The "Operation" field of domjobinfo of target host is "Unknown"

Expected results:
The "Operation" field of domjobinfo of target host should be "Incoming migration"

Additional info:

Comment 1 Jiri Denemark 2022-12-01 11:27:50 UTC
This is now fixed upstream by

commit af59c944bb36f11996d03069116df2f14d7a8136
Refs: v8.10.0-rc2-9-gaf59c944bb
Author:     Jiri Denemark <jdenemar>
AuthorDate: Wed Nov 30 14:29:55 2022 +0100
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Dec 1 10:30:21 2022 +0100

	qemu: Pass vm to qemuMigrationCookieParse if it exists

    The vm object is used inside qemuMigrationCookieParse based on the flags
    passed to qemuMigrationCookieParse and the content of the cookie. The
    callers should not just blindly guess and pass NULL if they
    (incorrectly) think the vm object is not needed. We should always pass
    the vm object unless it does not exist yet.

    This fixes a bug when statistics of a completed migration reported
    "Unknown" operation instead of "Incoming migration" on the destination
    host.

    https://bugzilla.redhat.com/show_bug.cgi?id=2137298

    Fixes: v8.7.0-79-g0150f7a8c1
    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Michal Privoznik <mprivozn>

Comment 2 Fangge Jin 2022-12-06 03:44:17 UTC
Pre-verified with libvirt-8.10.0-1.el9.x86_64

Comment 6 Fangge Jin 2022-12-27 02:02:28 UTC
Verified with libvirt-8.10.0-2.el9.x86_64

Comment 8 errata-xmlrpc 2023-05-09 07:27:15 UTC
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 (libvirt 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-2023:2171