From bca9b97919562ff4f0582012154b64cf8883a1af Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 9 May 2026 22:44:44 +0100 Subject: [PATCH] virtio-devices: vhost-user: Log when attempting reconnection Currently when the socket is disconnected by the other end there is no logging of such an event. Add a log to aid identifying when this has happened. Signed-off-by: Rob Bradford --- virtio-devices/src/vhost_user/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/virtio-devices/src/vhost_user/mod.rs b/virtio-devices/src/vhost_user/mod.rs index 7759782fd..bb354406a 100644 --- a/virtio-devices/src/vhost_user/mod.rs +++ b/virtio-devices/src/vhost_user/mod.rs @@ -9,7 +9,7 @@ use std::{io, thread}; use anyhow::anyhow; use event_monitor::event; -use log::error; +use log::{error, info}; use serde::{Deserialize, Serialize}; use thiserror::Error; use vhost::Error as VhostError; @@ -303,6 +303,10 @@ impl EpollHelperHandler for VhostUserEpollHandle let ev_type = event.data as u16; match ev_type { HUP_CONNECTION_EVENT => { + info!( + "vhost-user backend for socket {} disconnected, attempting reconnection", + self.socket_path + ); self.reconnect(helper).map_err(|e| { EpollHelperError::HandleEvent(anyhow!( "failed to reconnect vhost-user backend for socket {}: {e:?}",