Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Dec 12, 2024
1 parent 22abc8b commit ae0f618
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/propolis/src/block/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::sync::{Arc, Mutex};

use crate::accessors::MemAccessor;
use crate::block;
use crate::common::Lifecycle;
use crate::migrate::{
MigrateCtx, MigrateSingle, MigrateStateError, Migrator, PayloadOffer,
PayloadOutput,
Expand All @@ -17,8 +18,6 @@ use crate::vmm::{MemCtx, SubMapping};

use anyhow::Context;

use super::Lifecycle;

pub struct InMemoryBackend {
state: Arc<WorkingState>,

Expand Down
8 changes: 8 additions & 0 deletions phd-tests/framework/src/guest_os/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ impl WindowsVm<'_> {
}
}

impl<'a> std::ops::Deref for WindowsVm<'a> {
type Target = TestVm;

fn deref(&self) -> &Self::Target {
self.vm
}
}

const CYGWIN_CMD: &str = "C:\\cygwin\\cygwin.bat\r";

/// Prepends a `reset` command to the shell command supplied in `cmd`. Windows
Expand Down
4 changes: 2 additions & 2 deletions phd-tests/tests/src/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ async fn launch_vm_and_find_in_memory_disk(
vm.launch().await?;
vm.wait_to_boot().await?;

let device_path = if let Some(win_vm) = vm.get_windows_vm() {
let device_path = if let Some(vm) = vm.get_windows_vm() {
// Cygwin documents that \Device\HardDisk devices in the NT device
// namespace map to /dev/sd devices in the emulated POSIX namespace:
// disk 0 is /dev/sda, disk 1 is /dev/sdb, and so on. Get the NT device
// number of the attached in-memory disk.
let cmd = "(Get-PhysicalDisk | Where {$_.BusType -ne 'NVMe'}).DeviceId";
let num = win_vm.run_powershell_command(cmd).await?.parse::<u8>()?;
let num = vm.run_powershell_command(cmd).await?.parse::<u8>()?;

// If the test requires the disk to be writable, run diskpart to ensure
// that its readonly attribute is cleared.
Expand Down

0 comments on commit ae0f618

Please sign in to comment.