From: Paolo Bonzini <pbonzini@redhat.com>
To: Keqian Zhu <zhukeqian1@huawei.com>,
Kirti Wankhede <kwankhede@nvidia.com>,
Alex Williamson <alex.williamson@redhat.com>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Andrew Jones" <drjones@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
jiangkunkun@huawei.com,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
wanghaibin.wang@huawei.com, "Zenghui Yu" <yuzenghui@huawei.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] vfio/migrate: Move switch of dirty tracking into vfio_memory_listener
Date: Wed, 27 Jan 2021 13:46:31 +0100 [thread overview]
Message-ID: <e5f27643-441c-039c-a20c-a32c11b8d84c@redhat.com> (raw)
In-Reply-To: <20210111073439.20236-1-zhukeqian1@huawei.com>
On 11/01/21 08:34, Keqian Zhu wrote:
> +static void vfio_listener_log_start(MemoryListener *listener,
> + MemoryRegionSection *section,
> + int old, int new)
> +{
> + VFIOContainer *container = container_of(listener, VFIOContainer, listener);
> +
> + vfio_set_dirty_page_tracking(container, true);
> +}
> +
> +static void vfio_listener_log_stop(MemoryListener *listener,
> + MemoryRegionSection *section,
> + int old, int new)
> +{
> + VFIOContainer *container = container_of(listener, VFIOContainer, listener);
> +
> + vfio_set_dirty_page_tracking(container, false);
> +}
> +
This would enable dirty page tracking also just for having a framebuffer
(DIRTY_MEMORY_VGA). Technically it would be correct, but it would also
be more heavyweight than expected.
In order to only cover live migration, you can use the log_global_start
and log_global_stop callbacks instead.
If you want to use log_start and log_stop, you need to add respectively
if (old != 0) {
return;
}
and
if (new != 0) {
return;
}
before the calls to vfio_set_dirty_page_tracking. But I think it's more
appropriate for VFIO to use log_global_*.
Thanks,
Paolo
next prev parent reply other threads:[~2021-01-27 12:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 7:34 [PATCH] vfio/migrate: Move switch of dirty tracking into vfio_memory_listener Keqian Zhu
2021-01-26 22:29 ` Alex Williamson
2021-01-27 12:46 ` Paolo Bonzini [this message]
2021-01-28 20:02 ` Dr. David Alan Gilbert
2021-01-29 7:49 ` Paolo Bonzini
2021-01-29 10:17 ` Keqian Zhu
2021-01-29 16:47 ` Alex Williamson
2021-01-27 21:03 ` Kirti Wankhede
2021-01-28 15:24 ` Keqian Zhu
2021-01-30 6:30 ` Keqian Zhu
2021-03-01 2:04 ` Keqian Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5f27643-441c-039c-a20c-a32c11b8d84c@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=dgilbert@redhat.com \
--cc=drjones@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jiangkunkun@huawei.com \
--cc=kwankhede@nvidia.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wanghaibin.wang@huawei.com \
--cc=yuzenghui@huawei.com \
--cc=zhukeqian1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).