From 5c7cf7650a0bdf989ab54b7740958880ccdaaa8a Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 27 Jan 2026 07:26:40 -0800 Subject: [PATCH] vhost-user: tests: Fix set_log_base in dummy backend When it returns an error then the reply message is not sent and the frontend hangs expecting a reply. This bug in the test becomes clear when the correct reply size is read in the frontend for set_log_base. Signed-off-by: Rob Bradford --- vhost/src/vhost_user/dummy_backend.rs | 2 +- vhost/src/vhost_user/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vhost/src/vhost_user/dummy_backend.rs b/vhost/src/vhost_user/dummy_backend.rs index a45d3b4..e2a4682 100644 --- a/vhost/src/vhost_user/dummy_backend.rs +++ b/vhost/src/vhost_user/dummy_backend.rs @@ -345,6 +345,6 @@ impl VhostUserBackendReqHandlerMut for DummyBackendReqHandler { Ok(()) } fn set_log_base(&mut self, _log: &VhostUserLog, _file: File) -> Result<()> { - Err(Error::InvalidMessage) + Ok(()) } } diff --git a/vhost/src/vhost_user/mod.rs b/vhost/src/vhost_user/mod.rs index f8d3384..1ecdc25 100644 --- a/vhost/src/vhost_user/mod.rs +++ b/vhost/src/vhost_user/mod.rs @@ -427,7 +427,7 @@ mod tests { backend.handle_request().unwrap(); // set_log_base,set_log_fd() - backend.handle_request().unwrap_err(); + backend.handle_request().unwrap(); backend.handle_request().unwrap_err(); // set_vring_xxx