From 070f3bbea15f8e8ffea31afbfc6e50bbc7672625 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 31 Mar 2026 06:52:10 -0700 Subject: [PATCH] virtio-devices: Reject dirty logging if backend does not support it Signed-off-by: Rob Bradford --- virtio-devices/src/vhost_user/vu_common_ctrl.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virtio-devices/src/vhost_user/vu_common_ctrl.rs b/virtio-devices/src/vhost_user/vu_common_ctrl.rs index 1e356f648..23e06a3c0 100644 --- a/virtio-devices/src/vhost_user/vu_common_ctrl.rs +++ b/virtio-devices/src/vhost_user/vu_common_ctrl.rs @@ -670,6 +670,10 @@ impl VhostUserHandle { } pub fn dirty_log(&mut self, last_ram_addr: u64) -> Result { + if !self.supports_migration { + return Err(Error::MigrationNotSupported); + } + // The log region is updated by creating a new region that is sent to // the backend. This ensures the backend stops logging to the previous // region. The previous region is returned and processed to create the