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

View File

@@ -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<S: VhostUserFrontendReqHandler> 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:?}",