vhost/vhost-user-backend/src
Paolo Bonzini 888165bd8b set_log_base: use MmapRegion::bitmap() directly
For use in QEMU, I would like GuestMemoryRegion to return a BitmapSlice
instead of a &Bitmap.  This adds some flexibility that QEMU needs in
order to support a single global dirty bitmap that is sliced by the
various GuestMemoryRegions.

However, this removes access to the BitmapReplace trait, because it is of
course not possible to replace a slice of the bitmap only.  Fortunately,
vhost is built around the GM<> type alias, which has a pluggable bitmap
type but hardcodes the backend:

    type GM<B> = GuestMemoryAtomic<GuestMemoryMmap<B>>;

and therefore `region` is known to be a GuestRegionMmap.  Adding a
single dereference of the GuestRegionMmap returns the MmapRegion to
which the bitmap is attached, thus calling MmapRegion::bitmap() instead
of <GuestRegionMmap as GuestRegion>::bitmap().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-21 13:57:16 +02:00
..
backend.rs Add test for VHOST_USER_SHARED_OBJECT 2024-11-19 13:51:47 +01:00
bitmap.rs vhost-user-backend: fix clippy warnings 2024-12-17 14:33:19 +01:00
event_loop.rs Move all crates to workspace root 2023-11-23 16:36:57 +01:00
handler.rs set_log_base: use MmapRegion::bitmap() directly 2025-05-21 13:57:16 +02:00
lib.rs vhost-user-backend: Add vhost-user bitmap trait bounds 2024-03-11 17:21:15 +01:00
vring.rs Move all crates to workspace root 2023-11-23 16:36:57 +01:00