diff --git a/src/commands/snapshot.rs b/src/commands/snapshot.rs index 5ac0dda7..7c044c3e 100644 --- a/src/commands/snapshot.rs +++ b/src/commands/snapshot.rs @@ -1082,10 +1082,11 @@ pub async fn cmd_snapshot_run(args: SnapshotRunArgs) -> Result<()> { } } - // Verify pasta's L2 forwarding path has ARP resolved before starting health monitor. + // Verify pasta's L2 forwarding path is ready before starting health monitor. // After snapshot restore, pasta may not have learned the guest's MAC yet. - // This probes each forwarded port to trigger and verify ARP resolution — - // no guest service needs to be running, just the guest's kernel. + // This pings the guest to trigger ARP resolution, then probes each forwarded + // port to confirm end-to-end forwarding works. Only the guest kernel needs + // to be running (no guest services required for the ARP/ping step). network .verify_port_forwarding() .await diff --git a/src/network/pasta.rs b/src/network/pasta.rs index fd82c542..77430602 100644 --- a/src/network/pasta.rs +++ b/src/network/pasta.rs @@ -687,20 +687,22 @@ impl NetworkManager for PastaNetwork { // Ping the guest to trigger ARP resolution. A successful ping (exit 0) // proves ARP resolved AND the guest is reachable — skip the ip neigh check. // Use 200ms timeout for ~16 retries within the 5s deadline. - let ping_result = Command::new(&nsenter_prefix[0]) + let output = Command::new(&nsenter_prefix[0]) .args(&nsenter_prefix[1..]) .args(["ping", "-c", "1", "-W", "0.2", GUEST_IP]) .stdout(Stdio::null()) .stderr(Stdio::null()) .output() - .await; + .await + .context("running ping via nsenter in namespace")?; - if let Ok(ref out) = ping_result { - if out.status.success() { - info!(guest_ip = GUEST_IP, "guest reachable via ping, ARP resolved"); - self.wait_for_port_forwarding().await?; - return Ok(()); - } + if output.status.success() { + info!( + guest_ip = GUEST_IP, + "guest reachable via ping, ARP resolved" + ); + self.wait_for_port_forwarding().await?; + return Ok(()); } if std::time::Instant::now() > deadline {