Skip to content

Commit ef99ee9

Browse files
committed
Fix x86_64 errors and add test
- Fixed errors that occurred on x86 build - Added integration test for checking steal time Signed-off-by: Dakshin Devanand <[email protected]>
1 parent cf0e384 commit ef99ee9

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/vmm/src/builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::sync::{Arc, Mutex};
1111
use event_manager::{MutEventSubscriber, SubscriberOps};
1212
use libc::EFD_NONBLOCK;
1313
use linux_loader::cmdline::Cmdline as LoaderKernelCmdline;
14+
#[cfg(target_arch = "aarch64")]
1415
use log::warn;
1516
use userfaultfd::Uffd;
1617
use utils::time::TimestampUs;
@@ -85,6 +86,7 @@ pub enum StartMicrovmError {
8586
/// Error creating VMGenID device: {0}
8687
CreateVMGenID(VmGenIdError),
8788
/// Error creating PVTime device: {0}
89+
#[cfg(target_arch = "aarch64")]
8890
CreatePVTime(PVTimeError),
8991
/// Invalid Memory Configuration: {0}
9092
GuestMemory(crate::vstate::memory::MemoryError),
@@ -420,6 +422,7 @@ pub enum BuildMicrovmFromSnapshotError {
420422
ACPIDeviManager(#[from] ACPIDeviceManagerRestoreError),
421423
/// VMGenID update failed: {0}
422424
VMGenIDUpdate(std::io::Error),
425+
#[cfg(target_arch = "aarch64")]
423426
/// Failed to restore PVTime device: {0}
424427
RestorePVTime(#[from] PVTimeError),
425428
}

tests/integration_tests/functional/test_pvtime.py

100644100755
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@
66
import re
77
import time
88

9+
import pytest
10+
11+
from framework.properties import global_props
12+
13+
14+
@pytest.mark.skipif(
15+
global_props.cpu_architecture != "aarch64", reason="Only run in aarch64"
16+
)
17+
def test_guest_has_pvtime_enabled(uvm_plain):
18+
"""
19+
Check that the guest kernel has enabled PV steal time.
20+
"""
21+
vm = uvm_plain
22+
vm.spawn()
23+
vm.basic_config()
24+
vm.add_net_iface()
25+
vm.start()
26+
27+
_, stdout, _ = vm.ssh.run("dmesg | grep 'stolen time PV'")
28+
assert (
29+
"stolen time PV" in stdout
30+
), "Guest kernel did not report PV steal time enabled"
31+
932

1033
def test_pvtime_steal_time_increases(uvm_plain):
1134
"""

0 commit comments

Comments
 (0)