mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
numa: Teach ram block notifiers about resizeable ram blocks
Ram block notifiers are currently not aware of resizes. To properly handle resizes during migration, we want to teach ram block notifiers about resizeable ram. Introduce the basic infrastructure but keep using max_size in the existing notifiers. Supply the max_size when adding and removing ram blocks. Also, notify on resizes. Acked-by: Paul Durrant <paul@xen.org> Reviewed-by: Peter Xu <peterx@redhat.com> Cc: xen-devel@lists.xenproject.org Cc: haxm-team@intel.com Cc: Paul Durrant <paul@xen.org> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Wenchao Wang <wenchao.wang@intel.com> Cc: Colin Xu <colin.xu@intel.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20210429112708.12291-3-david@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
082851a3af
commit
8f44304c76
7 changed files with 61 additions and 32 deletions
|
@ -459,26 +459,26 @@ fail_container:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void qemu_vfio_ram_block_added(RAMBlockNotifier *n,
|
||||
void *host, size_t size)
|
||||
static void qemu_vfio_ram_block_added(RAMBlockNotifier *n, void *host,
|
||||
size_t size, size_t max_size)
|
||||
{
|
||||
QEMUVFIOState *s = container_of(n, QEMUVFIOState, ram_notifier);
|
||||
int ret;
|
||||
|
||||
trace_qemu_vfio_ram_block_added(s, host, size);
|
||||
ret = qemu_vfio_dma_map(s, host, size, false, NULL);
|
||||
trace_qemu_vfio_ram_block_added(s, host, max_size);
|
||||
ret = qemu_vfio_dma_map(s, host, max_size, false, NULL);
|
||||
if (ret) {
|
||||
error_report("qemu_vfio_dma_map(%p, %zu) failed: %s", host, size,
|
||||
error_report("qemu_vfio_dma_map(%p, %zu) failed: %s", host, max_size,
|
||||
strerror(-ret));
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_vfio_ram_block_removed(RAMBlockNotifier *n,
|
||||
void *host, size_t size)
|
||||
static void qemu_vfio_ram_block_removed(RAMBlockNotifier *n, void *host,
|
||||
size_t size, size_t max_size)
|
||||
{
|
||||
QEMUVFIOState *s = container_of(n, QEMUVFIOState, ram_notifier);
|
||||
if (host) {
|
||||
trace_qemu_vfio_ram_block_removed(s, host, size);
|
||||
trace_qemu_vfio_ram_block_removed(s, host, max_size);
|
||||
qemu_vfio_dma_unmap(s, host);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue