From 0499c3f9f6962e6b5b3be046060df03b98d76a65 Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Wed, 7 Jan 2026 12:06:33 -0800 Subject: [PATCH] WSLA: Resolve issue preventing boot from pmem vhds --- src/windows/wslaservice/exe/WSLAVirtualMachine.cpp | 11 +++++------ test/windows/WSLATests.cpp | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp index 35ce84da2..8668ead0a 100644 --- a/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp +++ b/src/windows/wslaservice/exe/WSLAVirtualMachine.cpp @@ -309,14 +309,13 @@ void WSLAVirtualMachine::Start() } else { - hcs::VirtualPMemController pmemController; - pmemController.MaximumCount = 0; - pmemController.MaximumSizeBytes = 0; + hcs::VirtualPMemController pmemController{}; pmemController.Backing = hcs::VirtualPMemBackingType::Virtual; + ULONG nextDeviceId = 0; auto attachPmemDisk = [&](PCWSTR path) { - ULONG deviceId = pmemController.MaximumCount; - pmemController.MaximumCount += 1; - hcs::VirtualPMemDevice vhd; + auto deviceId = nextDeviceId; + nextDeviceId += 1; + hcs::VirtualPMemDevice vhd{}; vhd.HostPath = path; vhd.ReadOnly = true; vhd.ImageFormat = hcs::VirtualPMemImageFormat::Vhd1; diff --git a/test/windows/WSLATests.cpp b/test/windows/WSLATests.cpp index b69afd2ad..eba338f1f 100644 --- a/test/windows/WSLATests.cpp +++ b/test/windows/WSLATests.cpp @@ -1028,9 +1028,6 @@ class WSLATests { WSL2_TEST_ONLY(); - LogSkipped("Skipping pmem test since mounting the WSLA VHD currently fails"); - return; - // Test with SCSI boot VHDs. { auto settings = GetDefaultSessionSettings();