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 <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-05-09 22:44:44 +01:00
parent 74bf0b4a55
commit bca9b97919
+5 -1
View File
@@ -9,7 +9,7 @@ use std::{io, thread};
use anyhow::anyhow; use anyhow::anyhow;
use event_monitor::event; use event_monitor::event;
use log::error; use log::{error, info};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use thiserror::Error; use thiserror::Error;
use vhost::Error as VhostError; use vhost::Error as VhostError;
@@ -303,6 +303,10 @@ impl<S: VhostUserFrontendReqHandler> EpollHelperHandler for VhostUserEpollHandle
let ev_type = event.data as u16; let ev_type = event.data as u16;
match ev_type { match ev_type {
HUP_CONNECTION_EVENT => { HUP_CONNECTION_EVENT => {
info!(
"vhost-user backend for socket {} disconnected, attempting reconnection",
self.socket_path
);
self.reconnect(helper).map_err(|e| { self.reconnect(helper).map_err(|e| {
EpollHelperError::HandleEvent(anyhow!( EpollHelperError::HandleEvent(anyhow!(
"failed to reconnect vhost-user backend for socket {}: {e:?}", "failed to reconnect vhost-user backend for socket {}: {e:?}",