diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs index fb8a079275..2e8e959516 100644 --- a/devices/src/virtio/virtio_pci_device.rs +++ b/devices/src/virtio/virtio_pci_device.rs @@ -1132,7 +1132,10 @@ impl Suspendable for VirtioPciDevice { if let Some(queues) = self.device.virtio_sleep()? { anyhow::ensure!( self.device_activated, - "unactivated device returned queues on sleep" + format!( + "unactivated device {} returned queues on sleep", + self.debug_label() + ), ); self.sleep_state = Some(SleepState::Active { activated_queues: queues, @@ -1140,7 +1143,10 @@ impl Suspendable for VirtioPciDevice { } else { anyhow::ensure!( !self.device_activated, - "activated device didn't return queues on sleep" + format!( + "activated device {} didn't return queues on sleep", + self.debug_label() + ), ); self.sleep_state = Some(SleepState::Inactive); } @@ -1158,9 +1164,12 @@ impl Suspendable for VirtioPciDevice { // If the device is already awake, we should not request it to wake again. } Some(SleepState::Inactive) => { - self.device - .virtio_wake(None) - .expect("virtio_wake failed, can't recover"); + self.device.virtio_wake(None).with_context(|| { + format!( + "virtio_wake failed for {}, can't recover", + self.debug_label(), + ) + })?; } Some(SleepState::Active { activated_queues }) => { self.device @@ -1171,7 +1180,12 @@ impl Suspendable for VirtioPciDevice { .expect("interrupt missing for already active queues"), activated_queues, ))) - .expect("virtio_wake failed, can't recover"); + .with_context(|| { + format!( + "virtio_wake failed for {}, can't recover", + self.debug_label(), + ) + })?; } }; Ok(()) diff --git a/vm_control/src/lib.rs b/vm_control/src/lib.rs index 8be7fecd72..18852262ff 100644 --- a/vm_control/src/lib.rs +++ b/vm_control/src/lib.rs @@ -2039,6 +2039,7 @@ fn do_snapshot( let snapshot_writer = SnapshotWriter::new(snapshot_path)?; // Snapshot Vcpus + info!("VCPUs snapshotting..."); let (send_chan, recv_chan) = mpsc::channel(); kick_vcpus(VcpuControl::Snapshot( snapshot_writer.add_namespace("vcpu")?, @@ -2051,14 +2052,18 @@ fn do_snapshot( .context("Failed to recv Vcpu snapshot response")? .context("Failed to snapshot Vcpu")?; } + info!("VCPUs snapshotted."); // Snapshot irqchip + info!("Snapshotting irqchip..."); let irqchip_snap = snapshot_irqchip()?; snapshot_writer .write_fragment("irqchip", &irqchip_snap) .context("Failed to write irqchip state")?; + info!("Snapshotted irqchip."); // Snapshot devices + info!("Devices snapshotting..."); device_control_tube .send(&DeviceControlCommand::SnapshotDevices { snapshot_writer }) .context("send command to devices control socket")?; @@ -2068,6 +2073,7 @@ fn do_snapshot( if !matches!(resp, VmResponse::Ok) { bail!("unexpected SnapshotDevices response: {resp}"); } + info!("Devices snapshotted."); Ok(()) }