mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 02:02:24 +00:00
agent: Add additional info while returning errors for update_interface
This should provide additional context for errors while updating network interface. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
2127288437
commit
82a1892d34
@ -134,14 +134,33 @@ impl Handle {
|
|||||||
.arp(iface.raw_flags & libc::IFF_NOARP as u32 == 0)
|
.arp(iface.raw_flags & libc::IFF_NOARP as u32 == 0)
|
||||||
.up()
|
.up()
|
||||||
.execute()
|
.execute()
|
||||||
.await?;
|
.await
|
||||||
|
.map_err(|err| {
|
||||||
|
anyhow!(
|
||||||
|
"Failure in LinkSetRequest for interface {}: {}",
|
||||||
|
iface.name.as_str(),
|
||||||
|
err
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
// swap the updated iface's name.
|
// swap the updated iface's name.
|
||||||
if let Some(nlink) = new_link {
|
if let Some(nlink) = new_link {
|
||||||
let mut request = self.handle.link().set(nlink.index());
|
let mut request = self.handle.link().set(nlink.index());
|
||||||
request.message_mut().header = nlink.header.clone();
|
request.message_mut().header = nlink.header.clone();
|
||||||
|
|
||||||
request.name(link.name()).up().execute().await?;
|
request
|
||||||
|
.name(link.name())
|
||||||
|
.up()
|
||||||
|
.execute()
|
||||||
|
.await
|
||||||
|
.map_err(|err| {
|
||||||
|
anyhow!(
|
||||||
|
"Error swapping back interface name {} to {}: {}",
|
||||||
|
nlink.name().as_str(),
|
||||||
|
link.name(),
|
||||||
|
err
|
||||||
|
)
|
||||||
|
})?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user