On Tue, Jan 05, 2021 at 21:54:05 +0800, Keqian Zhu wrote:
> On 2021/1/5 21:34, Daniel P. Berrangé wrote:
> > On Tue, Jan 05, 2021 at 09:28:27PM +0800, Keqian Zhu wrote:
> >>>> The purpose of QEMU commit 65ace0604551 (migration: add postcopy total 
> >>>> blocktime into query-migrate)
> >>>> is to query some postcopy related information on destination side.

The total post-copy block time is only computed when postcopy-blocktime
migration capability is enabled. Libvirt does not support this
capability so I believe this patch is fixing something that can never
happen.

> >>>>
> >>>> We can call query-migrate on destination side *after* migration 
> >>>> complete, thanks.
> >>>
> >>> But nothing in libvirt ever tries to call query-migrate on the dest
> >>> side. 
> >> Yes, but the dest side does not always act as dest. After migration 
> >> completion, the dest side enters
> >> to a normal status and libvirt does not forbid us to query migration 
> >> status.
> >>
> >> Before QEMU commit 65ace0604551, we can successfully query the migration 
> >> status, which is
> >> MIGRATION_STATUS_NONE. But this commit will return valid status 
> >> (MIGRATION_STATUS_COMPLETED)
> >> without ram info, causing libvirt reports error (migration was active, but 
> >> no RAM info was set).
> >>
> >>>
> >>> Do you have more patches that add such calls ? If so, then please send a
> >>> patch series that does the full job.
> >> I do not add new feature to libvirt, but just manually execute 
> >> query-migrate on dest side *after
> >> migration completion* will trigger this problem.
> > 
> > How are you running query-migrate ? If you're doing that with monitor
> > command passthrough then we shouldn't need to change the libvirt migration
> > code.
> OK. I am not very familiar with libvirt code logic, and my work flow is:
> 
>      source side                                dest side
> 
>  virsh start domain_name                            |
>       |                                             |
>  virsh migrate --live domain_name       (wait for migrate complete)
>       |                                             |
>   (migrate complete)                                |
>                                         virsh domjobinfo domain_name
>                                                     |
>                                  (migration was active, but no RAM info was 
> set)
> 
> Hope the above work flow helps.

You're trying to fetch statistics about a completed migration, for which
virsh domjobinfo --completed should be used.

Instead of hacking around it, we should properly implement support for
postcopy-blocktime and fetch the blocktime once migration completes
internally to make it available via the existing virsh domjobinfo
--completed command. Libvirt users should not need to know that
domjobinfo may magically be called even when migration is not running to
fetch some additional data.

Jirka

Reply via email to