mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: More detailed vhost user errors
Make it easier to chase down which vhost user socket failed and why in systems that have many vhost user devices. Signed-off-by: Dylan Reid <dgreid@fb.com>
This commit is contained in:
@@ -254,7 +254,11 @@ impl VirtioDevice for Blk {
|
||||
.set_config(offset as u32, VhostUserConfigFlags::WRITABLE, data)
|
||||
.map_err(Error::VhostUserSetConfig)
|
||||
{
|
||||
error!("Failed setting vhost-user-blk configuration: {e:?}");
|
||||
error!(
|
||||
"Failed setting vhost-user-blk configuration for socket {} at offset 0x{offset:x} with length {}: {e:?}",
|
||||
self.vu_common.socket_path,
|
||||
data.len()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +317,10 @@ impl VirtioDevice for Blk {
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
|
||||
{
|
||||
error!("Failed to reset vhost-user daemon: {e:?}");
|
||||
error!(
|
||||
"Failed to reset vhost-user daemon for socket {}: {e:?}",
|
||||
self.vu_common.socket_path
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,10 @@ impl VirtioDevice for Fs {
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
|
||||
{
|
||||
error!("Failed to reset vhost-user daemon: {e:?}");
|
||||
error!(
|
||||
"Failed to reset vhost-user daemon for socket {}: {e:?}",
|
||||
self.vu_common.socket_path
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -317,7 +317,10 @@ impl VirtioDevice for GenericVhostUser {
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
|
||||
{
|
||||
error!("Failed to reset vhost-user daemon: {e:?}");
|
||||
error!(
|
||||
"Failed to reset vhost-user daemon for socket {}: {e:?}",
|
||||
self.vu_common.socket_path
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,8 @@ impl<S: VhostUserFrontendReqHandler> VhostUserEpollHandler<S> {
|
||||
)
|
||||
.map_err(|e| {
|
||||
EpollHelperError::IoError(std::io::Error::other(format!(
|
||||
"failed connecting vhost-user backend {e:?}"
|
||||
"failed connecting vhost-user backend for socket {}: {e:?}",
|
||||
self.socket_path
|
||||
)))
|
||||
})?;
|
||||
|
||||
@@ -282,7 +283,8 @@ impl<S: VhostUserFrontendReqHandler> EpollHelperHandler for VhostUserEpollHandle
|
||||
HUP_CONNECTION_EVENT => {
|
||||
self.reconnect(helper).map_err(|e| {
|
||||
EpollHelperError::HandleEvent(anyhow!(
|
||||
"failed to reconnect vhost-user backend: {e:?}"
|
||||
"failed to reconnect vhost-user backend for socket {}: {e:?}",
|
||||
self.socket_path
|
||||
))
|
||||
})?;
|
||||
}
|
||||
@@ -370,7 +372,7 @@ impl VhostUserCommon {
|
||||
};
|
||||
|
||||
if self.vu.is_none() {
|
||||
error!("Missing vhost-user handle");
|
||||
error!("Missing vhost-user handle for socket {}", self.socket_path);
|
||||
return Err(ActivateError::BadActivate);
|
||||
}
|
||||
let vu = self.vu.as_ref().unwrap();
|
||||
|
||||
@@ -374,7 +374,10 @@ impl VirtioDevice for Net {
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
|
||||
{
|
||||
error!("Failed to reset vhost-user daemon: {e:?}");
|
||||
error!(
|
||||
"Failed to reset vhost-user daemon for socket {}: {e:?}",
|
||||
self.vu_common.socket_path
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,9 @@ impl VhostUserHandle {
|
||||
}
|
||||
};
|
||||
|
||||
error!("Failed connecting the backend after trying for 1 minute: {err:?}");
|
||||
error!(
|
||||
"Failed connecting the backend after trying for 1 minute for socket {socket_path}: {err:?}"
|
||||
);
|
||||
Err(Error::VhostUserConnect)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user