Skip to content

Commit 6e965fb

Browse files
awjiangliu
authored andcommitted
Fix broken tests on aarch64. #89
Signed-off-by: Alex Williams <[email protected]>
1 parent 2ac3adc commit 6e965fb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ioctls/device.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ mod tests {
260260

261261
let device_fd = create_gic_device(&vm, 0);
262262

263+
// GICv3 on arm/aarch64 requires an online vCPU prior to setting device attributes,
264+
// see: https://www.kernel.org/doc/html/latest/virt/kvm/devices/arm-vgic-v3.html
265+
vm.create_vcpu(0).unwrap();
266+
263267
// Following lines to re-construct device_fd are used to test
264268
// DeviceFd::from_raw_fd() and DeviceFd::as_raw_fd().
265269
let raw_fd = unsafe { libc::dup(device_fd.as_raw_fd()) };

src/ioctls/vm.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,10 @@ mod tests {
15561556
// Create the vGIC device.
15571557
let vgic_fd = create_gic_device(&vm_fd, 0);
15581558

1559+
// GICv3 on arm/aarch64 requires an online vCPU prior to setting device attributes,
1560+
// see: https://www.kernel.org/doc/html/latest/virt/kvm/devices/arm-vgic-v3.html
1561+
vm_fd.create_vcpu(0).unwrap();
1562+
15591563
// Set supported number of IRQs.
15601564
set_supported_nr_irqs(&vgic_fd, 128);
15611565
// Request the initialization of the vGIC.

0 commit comments

Comments
 (0)