virtio-devices: net: add guest-announce plumbing

Advertise `VIRTIO_NET_F_GUEST_ANNOUNCE` on virtio-net devices, surface
`VIRTIO_NET_S_ANNOUNCE` through config status, and handle
`VIRTIO_NET_CTRL_ANNOUNCE_ACK` on the control queue.

This adds the guest-visible state needed for post-migration or
post-restore announce requests; the VMM side triggering is added in
follow-up commits.

The motivation is to reduce post-migration and post-restore
connectivity gap. After a live migration or after restoring, it can
take the guest several seconds to be reachable again over the network.
With these announcements, the network path should be refreshed within a
few milliseconds.

On-behalf-of: SAP sebastian.eydam@sap.com
Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
This commit is contained in:
Sebastian Eydam
2026-03-31 13:21:59 +02:00
committed by Rob Bradford
parent e17c0be127
commit 53a00c0514
9 changed files with 967 additions and 125 deletions
+3
View File
@@ -15,6 +15,7 @@ use std::{fmt, io, result};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use vmm_sys_util::errno::Error as ErrnoError;
#[macro_use]
mod device;
@@ -122,6 +123,8 @@ pub enum ActivateError {
CreateRateLimiter(#[source] io::Error),
#[error("Failed to activate the vDPA device")]
ActivateVdpa(#[source] vdpa::Error),
#[error("Failed to create TimerFd")]
CreateTimerFd(#[source] ErrnoError),
}
pub type ActivateResult = result::Result<(), ActivateError>;