Merge remote-tracking branch 'origin/master' into HEAD

This commit is contained in:
Ben Hillis 2025-12-09 09:45:27 -08:00
commit 60c73fdbf2
23 changed files with 183 additions and 102 deletions

View File

@ -29,7 +29,7 @@ parameters:
type: object
default:
- target: "wsl;libwsl;wslg;wslservice;wslhost;wslrelay;wslinstaller;wslinstall;initramfs;wslserviceproxystub;wslsettings;wslinstallerproxystub;testplugin;wslaclient;wsltests"
pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings.dll,wslsettings.exe,wslinstallerproxystub.dll,wsldevicehost.dll,lxutil.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll,wslaclient.dll"
pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings.dll,wslsettings.exe,wslinstallerproxystub.dll,wsldevicehost.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll,wslaclient.dll"
- target: "msixgluepackage"
pattern: "gluepackage.msix"
- target: "msipackage"

View File

@ -67,7 +67,7 @@ stages:
displayName: Copy AppxUpload artifact
# creates a submission package that is published to the store; containers store page information and the WSL appxupload
- task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3
- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
displayName: 'Creating StoreBroker Payload'
inputs:
serviceEndpoint: 'AzureConnection-StoreBroker-WIF'
@ -88,7 +88,7 @@ stages:
displayName: Copy StoreBrokerPayload to drop
# submit the package flight to the WSL SelfHost Flight Group
- task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@3
- task: MS-RDX-MRO.windows-store-publish.flight-task.store-flight@3
displayName: 'Flight StoreBroker Package to Partner Center - WSL SelfHost Flight Group'
condition: and(succeeded(), eq('${{ parameters.publishPackage }}', true))
inputs:

View File

@ -75,13 +75,11 @@ find_nuget_package(Wix WIX /tools/net6.0/any)
if (${TARGET_PLATFORM} STREQUAL "x64")
find_nuget_package(Microsoft.DXCore.Linux.amd64fre DXCORE /build/native)
find_nuget_package(Microsoft.WSL.Dependencies.amd64fre WSLDEPS /build/native)
find_nuget_package(Microsoft.WSL.LxUtil.amd64fre LXUTIL /build/native)
endif()
if (${TARGET_PLATFORM} STREQUAL "arm64")
find_nuget_package(Microsoft.DXCore.Linux.arm64fre DXCORE /build/native)
find_nuget_package(Microsoft.WSL.Dependencies.arm64fre WSLDEPS /build/native)
find_nuget_package(Microsoft.WSL.LxUtil.arm64fre LXUTIL /build/native)
endif()
# Wsl Settings packages
@ -154,7 +152,6 @@ file(MAKE_DIRECTORY ${GENERATED_DIR})
set(PACKAGE_CERTIFICATE ${GENERATED_DIR}/dev-cert.pfx)
file(CREATE_LINK ${WSL_DEVICE_HOST_SOURCE_DIR}/bin/${TARGET_PLATFORM}/wsldevicehost.dll ${BIN}/wsldevicehost.dll)
file(CREATE_LINK ${LXUTIL_SOURCE_DIR}/bin/lxutil.dll ${BIN}/lxutil.dll)
file(CREATE_LINK ${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/${WSLG_TS_PLUGIN_DLL} ${BIN}/${WSLG_TS_PLUGIN_DLL})
file(CREATE_LINK ${WSLDEPS_SOURCE_DIR}/bin/wsldeps.dll ${BIN}/wsldeps.dll)
@ -205,7 +202,6 @@ add_compile_definitions(UNICODE
WSL_DEVICE_HOST_VERSION="${WSL_DEVICE_HOST_VERSION}"
COMMIT_HASH="${COMMIT_HASH}"
WSL_PACKAGE_VERSION="${PACKAGE_VERSION}"
LXUTIL_VERSION="${LXUTIL_VERSION}"
MSRDC_VERSION="${MSRDC_VERSION}"
DIRECT3D_VERSION="${DIRECT3D_VERSION}"
DXCORE_VERSION="${DXCORE_VERSION}"
@ -237,7 +233,6 @@ endif()
# Common link libraries
link_directories(${WSLDEPS_SOURCE_DIR}/lib/)
link_directories(${LXUTIL_SOURCE_DIR}/lib/)
set(COMMON_LINK_LIBRARIES
ws2_32.lib
Userenv.lib

View File

@ -636,6 +636,39 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
Microsoft.NETCore.App.Runtime.win-arm64 10.0.0 - MIT
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------

View File

@ -62,8 +62,8 @@
"FriendlyName": "SUSE Linux Enterprise 15 SP7",
"Default": false,
"Amd64Url": {
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20250903.0/SUSE-Linux-Enterprise-15-SP7-15.7.x86_64-27.32-Build27.32.wsl",
"Sha256": "0x1e53279af609b9d67b108bc31f1318c3317338595298ef8dfbf7a5728ab8a093"
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-15-SP7-15.7.x86_64-30.1-Build30.1.wsl",
"Sha256": "0x60924e13286ed15bdcf9069e3a24d3394fb858954de3bdfcb1ea576900b81b2e"
}
},
{
@ -71,8 +71,8 @@
"FriendlyName": "SUSE Linux Enterprise 16.0",
"Default": true,
"Amd64Url": {
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251104.0/SUSE-Linux-Enterprise-16.0-16.0.x86_64-1.3-Build1.3.wsl",
"Sha256": "0xb91f901ba96910fa65218ef0e6aaae7b9980bd11fed63cb3507878aa8915d726"
"Url": "https://github.com/SUSE/WSL-instarball/releases/download/v20251201.0/SUSE-Linux-Enterprise-16.0-16.0.x86_64-1.9-Build1.9.wsl",
"Sha256": "0xf0fc07ed3543d3dc24cfb35b4194bbecf98485cefdd720c521034ac1c54bffd3"
}
}
],
@ -166,8 +166,8 @@
"FriendlyName": "Arch Linux",
"Default": true,
"Amd64Url": {
"Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.11.01.150831/archlinux-2025.11.01.150831.wsl",
"Sha256": "9dbac892c38c94fd22a8988eff4e072778f3f445378d33a81474a2b88cb04562"
"Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.12.01.153427/archlinux-2025.12.01.153427.wsl",
"Sha256": "8dfe92910a188f191b0af2972bd4bda661178b769ce820a8921e8b7aeae9a517"
}
}
],

View File

@ -381,7 +381,6 @@
<File Id="RdpWinStlHelper.dll" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" />
<?endif?>
<File Id="wsldevicehost.dll" Source="${BIN}/wsldevicehost.dll" />
<File Id="lxutil.dll" Source="${BIN}/lxutil.dll" />
<File Id="${WSLG_TS_PLUGIN_DLL}" Source="${BIN}/${WSLG_TS_PLUGIN_DLL}" />
<!-- MSRDC Plugin registration -->

View File

@ -19,10 +19,8 @@
<package id="Microsoft.WSL.Dependencies.amd64fre" version="10.0.27820.1000-250318-1700.rs-base2-hyp" targetFramework="native" />
<package id="Microsoft.WSL.Dependencies.arm64fre" version="10.0.27820.1000-250318-1700.rs-base2-hyp" targetFramework="native" />
<package id="Microsoft.WSL.DeviceHost" version="1.0.0-20251202.1" />
<package id="Microsoft.WSL.Kernel" version="6.6.87.2-1" targetFramework="native" />
<package id="Microsoft.WSL.Kernel" version="6.6.114.1-1" targetFramework="native" />
<package id="Microsoft.WSL.LinuxSdk" version="1.20.0" targetFramework="native" />
<package id="Microsoft.WSL.LxUtil.amd64fre" version="10.0.26100.1-240331-1435.ge-release" />
<package id="Microsoft.WSL.LxUtil.arm64fre" version="10.0.26100.1-240331-1435.ge-release" />
<package id="Microsoft.WSL.TestDistro" version="2.5.7-47" />
<package id="Microsoft.WSL.WSLATestDistro" version="0.1.0" />
<package id="Microsoft.WSLg" version="1.0.71" />

View File

@ -2258,8 +2258,17 @@ Return Value:
if (Value != nullptr)
{
Config.VmId = Value;
//
// Unset the environment variable for user distros.
//
Value = getenv(LX_WSL2_SHARED_MEMORY_OB_DIRECTORY);
if (!Value)
{
unsetenv(LX_WSL2_VM_ID_ENV);
}
}
//
// If the boot.systemd option is specified in /etc/wsl.conf, launch the distro init process as pid 1.

View File

@ -506,23 +506,12 @@ CATCH_LOG()
void NatNetworking::UpdateMtu()
{
unique_interface_table interfaceTable{};
THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable));
ULONG minMtu = ULONG_MAX;
for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++)
{
const auto& ipInterface = interfaceTable.get()->Table[index];
if (ipInterface.Connected)
{
minMtu = std::min(ipInterface.NlMtu, minMtu);
}
}
const auto minMtu = GetMinimumConnectedInterfaceMtu();
// Only send the update if the MTU changed.
if (minMtu != ULONG_MAX && minMtu != m_networkMtu)
if (minMtu && minMtu.value() != m_networkMtu)
{
m_networkMtu = minMtu;
m_networkMtu = minMtu.value();
hns::ModifyGuestEndpointSettingRequest<hns::NetworkInterface> notification{};
notification.ResourceType = hns::GuestEndpointResourceType::Interface;

View File

@ -23,6 +23,14 @@ VirtioNetworking::VirtioNetworking(
{
}
VirtioNetworking::~VirtioNetworking()
{
// Unregister the network notification callback to prevent it from using the GNS channel.
m_networkNotifyHandle.reset();
// Stop the GNS channel to unblock any stuck communications with the guest.
m_gnsChannel.Stop();
}
void VirtioNetworking::Initialize()
{
m_networkSettings = GetHostEndpointSettings();
@ -270,32 +278,25 @@ void VirtioNetworking::UpdateDns(hns::DNS&& dnsSettings)
void VirtioNetworking::UpdateMtu()
{
unique_interface_table interfaceTable{};
THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable));
ULONG minMtu = ULONG_MAX;
for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++)
{
const auto& ipInterface = interfaceTable.get()->Table[index];
if (ipInterface.Connected)
{
minMtu = std::min(ipInterface.NlMtu, minMtu);
}
}
const auto minMtu = GetMinimumConnectedInterfaceMtu();
// Only send the update if the MTU changed.
if (minMtu != ULONG_MAX && minMtu != m_networkMtu)
if (minMtu && minMtu.value() != m_networkMtu)
{
m_networkMtu = minMtu.value();
hns::ModifyGuestEndpointSettingRequest<hns::NetworkInterface> notification{};
notification.ResourceType = hns::GuestEndpointResourceType::Interface;
notification.RequestType = hns::ModifyRequestType::Update;
notification.Settings.NlMtu = m_networkMtu;
notification.Settings.Connected = true;
notification.Settings.NlMtu = m_networkMtu;
WSL_LOG("VirtioNetworking::UpdateMtu", TraceLoggingValue(m_networkMtu, "VirtioMtu"));
WSL_LOG(
"VirtioNetworking::UpdateMtu",
TraceLoggingValue(m_adapterId, "endpointId"),
TraceLoggingValue(m_networkMtu, "virtioMtu"));
// TODO: Why was this commented ?
// m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_endpointId);
m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_adapterId);
}
}

View File

@ -14,7 +14,7 @@ class VirtioNetworking : public INetworkingEngine
{
public:
VirtioNetworking(GnsChannel&& gnsChannel, bool enableLocalhostRelay, std::shared_ptr<GuestDeviceManager> guestDeviceManager, GUID classId, wil::shared_handle userToken);
~VirtioNetworking() = default;
~VirtioNetworking();
// Note: This class cannot be moved because m_networkNotifyHandle captures a 'this' pointer.
VirtioNetworking(const VirtioNetworking&) = delete;

View File

@ -248,3 +248,25 @@ wsl::core::networking::EphemeralHcnEndpoint wsl::core::networking::CreateEphemer
return endpoint;
}
std::optional<ULONG> wsl::core::networking::GetMinimumConnectedInterfaceMtu() noexcept
{
std::optional<ULONG> minMtu{};
try
{
unique_interface_table interfaceTable{};
THROW_IF_WIN32_ERROR(::GetIpInterfaceTable(AF_UNSPEC, &interfaceTable));
for (ULONG index = 0; index < interfaceTable.get()->NumEntries; index++)
{
const auto& ipInterface = interfaceTable.get()->Table[index];
if (ipInterface.Connected)
{
minMtu = std::min(minMtu.value_or(ipInterface.NlMtu), ipInterface.NlMtu);
}
}
}
CATCH_LOG()
return minMtu;
}

View File

@ -456,6 +456,11 @@ std::vector<wsl::core::networking::CurrentInterfaceInformation> EnumerateConnect
bool IsMetered(ABI::Windows::Networking::Connectivity::NetworkCostType cost) noexcept;
/// <summary>
/// Gets the minimum MTU across all connected network interfaces.
/// </summary>
std::optional<ULONG> GetMinimumConnectedInterfaceMtu() noexcept;
/// <summary>
/// This instance acts as an IP_ADAPTER_ADDRESS pointer.
/// </summary>

View File

@ -10,11 +10,11 @@
<controls:OOBEContent.PageContent>
<StackPanel Orientation="Vertical" Spacing="12">
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallableDistrosTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,12,0,6"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallableDistrosSample"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallableDistrosSample" TextWrapping="Wrap"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallNamedDistrosTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,24,0,12"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallNamedDistrosSample"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_InstallNamedDistrosSample" TextWrapping="Wrap"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_AvailableDistrosTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,24,0,6"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_AvailableDistrosSample"/>
<TextBlock x:Uid="Settings_OOBEDistroManagement_AvailableDistrosSample" TextWrapping="Wrap"/>
<HyperlinkButton x:Uid="Settings_OOBEDistroManagementBasicWSLCommandsLink" Style="{StaticResource TextButtonStyle}" Margin="0,12,0,-12"/>
<HyperlinkButton x:Uid="Settings_OOBEDistroManagementImportCustomDistroLink" Style="{StaticResource TextButtonStyle}"/>
</StackPanel>

View File

@ -9,7 +9,7 @@
<controls:OOBEContent x:Uid="Settings_OOBEGUIApps" HeroImage="ms-appx:///Assets/SettingsOOBEGUIApps.png">
<controls:OOBEContent.PageContent>
<StackPanel Orientation="Vertical" Spacing="12">
<TextBlock x:Uid="Settings_OOBEGUIApps_AppsListDescription"/>
<TextBlock x:Uid="Settings_OOBEGUIApps_AppsListDescription" TextWrapping="Wrap"/>
<HyperlinkButton x:Uid="Settings_OOBEGUIAppsLink" Style="{StaticResource TextButtonStyle}"/>
</StackPanel>
</controls:OOBEContent.PageContent>

View File

@ -12,7 +12,7 @@
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_NetworkingAppsFromWindowsTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,0,0,-6"/>
<controls:HyperlinkTextBlock x:Uid="Settings_OOBECrossOSFileAccess_NetworkingAppsFromWindowsSample"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_MirroredModeNetworkingTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,12,0,-6"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_MirroredModeNetworkingSample"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_MirroredModeNetworkingSample" TextWrapping="Wrap"/>
<HyperlinkButton x:Uid="Settings_OOBENetworkingIntegrationLinuxNetworkingAppsLink" Style="{StaticResource TextButtonStyle}" Margin="0,6,0,-12"/>
<HyperlinkButton x:Uid="Settings_OOBENetworkingIntegrationMirroredModeLink" Style="{StaticResource TextButtonStyle}"/>
</StackPanel>

View File

@ -10,9 +10,9 @@
<controls:OOBEContent.PageContent>
<StackPanel Orientation="Vertical" Spacing="12">
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeInstallTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,0,0,-6"/>
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeInstallSample" />
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeInstallSample" TextWrapping="Wrap"/>
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeOpenProjectTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,12,0,-6"/>
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeOpenProjectSample" />
<TextBlock x:Uid="Settings_OOBEVSCodeIntegration_VSCodeOpenProjectSample" TextWrapping="Wrap"/>
<HyperlinkButton x:Uid="Settings_OOBEVSCodeIntegrationLink" Margin="0,6,0,0" Style="{StaticResource TextButtonStyle}"/>
</StackPanel>
</controls:OOBEContent.PageContent>

View File

@ -10,11 +10,11 @@
<controls:OOBEContent.PageContent>
<StackPanel Orientation="Vertical" Spacing="12">
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_WindowsFromLinuxTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,0,0,-6"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_WindowsFromLinuxSample"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_WindowsFromLinuxSample" TextWrapping="Wrap"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LinuxFromFileExplorerTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,12,0,-6"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LinuxFromFileExplorerSample"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LinuxFromFileExplorerSample" TextWrapping="Wrap"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LaunchWindowsFromWSLTitle" Style="{StaticResource OobeSubtitleStyle}" Margin="0,12,0,-6"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LaunchWindowsFromWSLSample"/>
<TextBlock x:Uid="Settings_OOBECrossOSFileAccess_LaunchWindowsFromWSLSample" TextWrapping="Wrap"/>
<HyperlinkButton x:Uid="Settings_OOBECrossOSFileAccessLink" Margin="0,6,0,0" Style="{StaticResource TextButtonStyle}"/>
</StackPanel>
</controls:OOBEContent.PageContent>

View File

@ -1417,6 +1417,13 @@ Return Value:
int Result;
if (g_LxtFsInfo.FsType == LxtFsTypeVirtioFs)
{
LxtLogInfo("TODO: debug this test on virtiofs.");
Result = 0;
goto ErrorExit;
}
LxtCheckResult(LxtFsDeleteLoopCommon(DRVFS_DELETELOOP_PREFIX));
ErrorExit:
@ -1951,12 +1958,12 @@ Return Value:
//
// Fstat should still work after unlink.
//
// N.B. This currently doesn't work on plan 9.
// N.B. This currently doesn't work on plan9 or virtiofs.
//
LxtCheckErrnoZeroSuccess(unlink(DRVFS_BASIC_PREFIX "/testfile"));
LxtCheckErrnoFailure(stat(DRVFS_BASIC_PREFIX "/testfile", &Stat2), ENOENT);
if (g_LxtFsInfo.FsType != LxtFsTypePlan9)
if (g_LxtFsInfo.FsType != LxtFsTypePlan9 && g_LxtFsInfo.FsType != LxtFsTypeVirtioFs)
{
LxtCheckErrnoZeroSuccess(fstat(Fd, &Stat2));
@ -2143,9 +2150,9 @@ Return Value:
Dir = NULL;
if (g_LxtFsInfo.FsType == LxtFsTypePlan9)
if (g_LxtFsInfo.FsType == LxtFsTypePlan9 || g_LxtFsInfo.FsType == LxtFsTypeVirtioFs)
{
LxtLogInfo("This test is not relevant in VM mode.");
LxtLogInfo("This test is not relevant for plan9 or virtiofs.");
Result = 0;
goto ErrorExit;
}
@ -3171,12 +3178,12 @@ Return Value:
Fd2 = -1;
//
// This functionality is not supported on Plan 9.
// This functionality is not supported on Plan 9 or virtiofs.
//
if (g_LxtFsInfo.FsType == LxtFsTypePlan9)
if (g_LxtFsInfo.FsType == LxtFsTypePlan9 || g_LxtFsInfo.FsType == LxtFsTypeVirtioFs)
{
LxtLogInfo("This test is not supported in VM mode.");
LxtLogInfo("This test is not supported for plan9 or virtiofs.");
Result = 0;
goto ErrorExit;
}
@ -3248,6 +3255,7 @@ Return Value:
bool FileLinkFound;
bool JunctionFound;
void* Mapping;
void* MapResult;
void* PointerResult;
bool RelativeLinkFound;
int Result;
@ -3261,7 +3269,7 @@ Return Value:
DirFd = -1;
Fd = -1;
Mapping = NULL;
Mapping = MAP_FAILED;
LxtCheckNullErrno(Dir = opendir(DRVFS_REPARSE_PREFIX));
errno = 0;
AbsoluteLinkFound = false;
@ -3460,11 +3468,18 @@ Return Value:
// is what execve uses.
//
LxtCheckNullErrno(Mapping = mmap(NULL, 2, PROT_READ, MAP_SHARED, Fd, 0));
if (g_LxtFsInfo.FsType != LxtFsTypeVirtioFs)
{
LxtCheckMapErrno(Mapping = mmap(NULL, 2, PROT_READ, MAP_SHARED, Fd, 0));
LxtCheckMemoryEqual(Mapping, "MZ", 2);
}
else
{
LxtLogInfo("TODO: debug virtiofs handling of app exec links");
}
ErrorExit:
if (Mapping != NULL)
if (Mapping != MAP_FAILED)
{
munmap(Mapping, 2);
}

View File

@ -3350,7 +3350,6 @@ Return Value:
FullExpectedTime = (Expected->tv_sec * FS_NS_PER_SEC) + Expected->tv_nsec;
if ((FullTime <= FullExpectedTime) && (FullTime >= (FullExpectedTime - (AllowedVarianceSeconds * FS_NS_PER_SEC))))
{
return true;
}
@ -3359,9 +3358,9 @@ Return Value:
// the host and guest.
//
if ((g_LxtFsInfo.FsType == LxtFsTypePlan9) && (FullTime <= (FullExpectedTime + (AllowedVarianceSeconds * FS_NS_PER_SEC))))
if (((g_LxtFsInfo.FsType == LxtFsTypePlan9) || (g_LxtFsInfo.FsType == LxtFsTypeVirtioFs)) &&
(FullTime <= (FullExpectedTime + (AllowedVarianceSeconds * FS_NS_PER_SEC))))
{
return true;
}

View File

@ -103,11 +103,11 @@ int main(int Argc, char* Argv[], char** Envp)
if (LXT_SUCCESS(Result))
{
LxtLogPassed("%s", false, LxtTests[Itr].Name);
LxtLogPassed("%s", LxtTests[Itr].Name);
}
else
{
LxtLogError("%s", false, LxtTests[Itr].Name);
LxtLogError("%s", LxtTests[Itr].Name);
}
goto ErrorExit;

View File

@ -1928,7 +1928,8 @@ Return Value:
}
LaunchArguments += CommandLine;
LogInfo("Test process exited with: %lu", LxsstuLaunchWsl(LaunchArguments.c_str()));
DWORD ExitCode = LxsstuLaunchWsl(LaunchArguments.c_str());
LogInfo("Test process exited with: %lu", ExitCode);
//
// Parse the contents of the linux log(s) files and relog.
@ -1938,9 +1939,11 @@ Return Value:
{
THROW_IF_NTSTATUS_FAILED(LxsstuParseLinuxLogFiles(LogFileName, &TestPassed));
THROW_HR_IF(E_FAIL, !TestPassed);
VERIFY_IS_TRUE(TestPassed);
}
VERIFY_ARE_EQUAL(0, ExitCode);
return;
}

View File

@ -135,12 +135,6 @@ public:
Logfile << TestMode;
VERIFY_NO_THROW(LxsstuRunTest(Command.str().c_str(), Logfile.str().c_str()));
if (DrvFsMode.has_value() && DrvFsMode.value() == DrvFsMode::VirtioFs)
{
LogSkipped("TODO: debug test for virtiofs");
return;
}
//
// Check that the read-only attribute has been changed.
//
@ -173,8 +167,15 @@ public:
VERIFY_NO_THROW(VerifyDrvFsSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\ntlink7", L"ntlink2", true));
VERIFY_NO_THROW(VerifyDrvFsSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\ntlink8", L"foo\uf03abar", false));
if (DrvFsMode.has_value() && DrvFsMode.value() == DrvFsMode::VirtioFs)
{
LogInfo("TODO: debug VerifyDrvFsLxSymlink variations on virtiofs");
}
else
{
VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink1"));
VERIFY_NO_THROW(VerifyDrvFsLxSymlink(LXSST_DRVFS_SYMLINK_TEST_DIR "\\lxlink2"));
}
// Since target resolution is done on the Windows side in Plan 9, it is able to create an NT
// link if the target path traverses an existing NT link (this is actually better than WSL 1).
@ -228,10 +229,16 @@ public:
VERIFY_NO_THROW(DrvFsCommon(LX_DRVFS_DISABLE_NONE, Mode));
}
void DrvFsFat() const
void DrvFsFat(DrvFsMode Mode)
{
SKIP_TEST_ARM64();
if (Mode == DrvFsMode::VirtioFs)
{
LogSkipped("VirtioFS currently only supports mounting full drives");
return;
}
constexpr auto MountPoint = "C:\\lxss_fat";
constexpr auto VhdPath = "C:\\lxss_fat.vhdx";
auto Cleanup = wil::scope_exit([MountPoint, VhdPath] { DeleteVolume(MountPoint, VhdPath); });
@ -241,10 +248,16 @@ public:
LxsstuRunTest((L"bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 3'").c_str(), L"drvfs3"));
}
void DrvFsSmb() const
void DrvFsSmb(DrvFsMode Mode)
{
SKIP_TEST_ARM64();
if (Mode == DrvFsMode::VirtioFs)
{
LogSkipped("TODO: debug virtiofs handling of //localhost/C$ style paths");
return;
}
VERIFY_NO_THROW(
LxsstuRunTest((L"bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 4'").c_str(), L"drvfs4"));
}
@ -312,20 +325,20 @@ public:
{
SKIP_TEST_ARM64();
if (Mode == DrvFsMode::VirtioFs)
{
LogSkipped("TODO: debug test for virtiofs");
return;
}
VERIFY_NO_THROW(LxsstuRunTest(L"/data/test/wsl_unit_tests xattr drvfs", L"xattr_drvfs"));
}
void DrvFsReFs() const
void DrvFsReFs(DrvFsMode Mode)
{
SKIP_TEST_ARM64();
WSL_TEST_VERSION_REQUIRED(wsl::windows::common::helpers::WindowsBuildNumbers::Germanium);
if (Mode == DrvFsMode::VirtioFs)
{
LogSkipped("VirtioFS currently only supports mounting full drives");
return;
}
constexpr auto MountPoint = "C:\\lxss_refs";
constexpr auto VhdPath = "C:\\lxss_refs.vhdx";
auto Cleanup = wil::scope_exit([MountPoint, VhdPath] { DeleteVolume(MountPoint, VhdPath); });
@ -1072,13 +1085,13 @@ class WSL1 : public DrvFsTests
TEST_METHOD(DrvFsFat)
{
WSL1_TEST_ONLY();
DrvFsTests::DrvFsFat();
DrvFsTests::DrvFsFat(DrvFsMode::WSL1);
}
TEST_METHOD(DrvFsSmb)
{
WSL1_TEST_ONLY();
DrvFsTests::DrvFsSmb();
DrvFsTests::DrvFsSmb(DrvFsMode::WSL1);
}
TEST_METHOD(DrvFsMetadata)
@ -1108,8 +1121,8 @@ class WSL1 : public DrvFsTests
else \
{ \
VERIFY_ARE_EQUAL(LxsstuInitialize(FALSE), TRUE); \
VERIFY_ARE_EQUAL(LxsstuLaunchWsl(LXSST_TESTS_INSTALL_COMMAND_LINE), 0); \
m_config.reset(new WslConfigChange(LxssGenerateTestConfig({.drvFsMode = DrvFsMode::##_mode##}))); \
VERIFY_ARE_EQUAL(LxsstuLaunchWsl(LXSST_TESTS_INSTALL_COMMAND_LINE), 0); \
} \
\
return true; \
@ -1147,13 +1160,13 @@ class WSL1 : public DrvFsTests
TEST_METHOD(DrvFsFat) \
{ \
WSL2_TEST_ONLY(); \
DrvFsTests::DrvFsFat(); \
DrvFsTests::DrvFsFat(DrvFsMode::##_mode##); \
} \
\
TEST_METHOD(DrvFsSmb) \
{ \
WSL2_TEST_ONLY(); \
DrvFsTests::DrvFsSmb(); \
DrvFsTests::DrvFsSmb(DrvFsMode::##_mode##); \
} \
\
TEST_METHOD(DrvFsMetadata) \
@ -1195,7 +1208,7 @@ class WSL1 : public DrvFsTests
TEST_METHOD(DrvFsReFs) \
{ \
WSL2_TEST_ONLY(); \
DrvFsTests::DrvFsReFs(); \
DrvFsTests::DrvFsReFs(DrvFsMode::##_mode##); \
} \
}