From 6fc68e8999363dabcda6be60564e19057b6323f4 Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 2 Dec 2025 11:45:49 -0800 Subject: [PATCH] Apply PR feedback --- src/windows/common/WSLAContainerLauncher.h | 4 +++- src/windows/wslaservice/exe/WSLAContainer.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/windows/common/WSLAContainerLauncher.h b/src/windows/common/WSLAContainerLauncher.h index b50d3ae..9a4447e 100644 --- a/src/windows/common/WSLAContainerLauncher.h +++ b/src/windows/common/WSLAContainerLauncher.h @@ -11,7 +11,9 @@ Abstract: This file contains the definition for WSLAContainerLauncher. --*/ -#include "WSLAprocessLauncher.h" + +#pragma once +#include "WSLAProcessLauncher.h" namespace wsl::windows::common { diff --git a/src/windows/wslaservice/exe/WSLAContainer.cpp b/src/windows/wslaservice/exe/WSLAContainer.cpp index a71ccc0..87ace6b 100644 --- a/src/windows/wslaservice/exe/WSLAContainer.cpp +++ b/src/windows/wslaservice/exe/WSLAContainer.cpp @@ -21,10 +21,11 @@ using wsl::windows::service::wsla::WSLAContainer; constexpr const char* nerdctlPath = "/usr/bin/nerdctl"; // Constants for required default arguments for "nerdctl run..." -static std::vector defaultNerdctlRunArgs{//"--pull=never", // TODO: Uncomment once PullImage() is implemented. - "--net=host", // TODO: default for now, change later - "--ulimit", - "nofile=65536:65536"}; +static std::vector defaultNerdctlRunArgs{ + //"--pull=never", // TODO: Uncomment once PullImage() is implemented. + "--net=host", // TODO: default for now, change later + "--ulimit", + "nofile=65536:65536"}; HRESULT WSLAContainer::Start() { @@ -116,7 +117,7 @@ std::vector WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONT args.push_back(options.Name); if (options.ShmSize > 0) { - args.push_back("--shm-size=" + std::to_string(options.ShmSize) + 'm'); + args.push_back(std::format("--shm-size={}m", options.ShmSize)); } if (options.Flags & WSLA_CONTAINER_FLAG_ENABLE_GPU) { @@ -133,7 +134,7 @@ std::vector WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONT THROW_HR_IF_MSG( E_INVALIDARG, options.InitProcessOptions.Environment[i][0] == L'-', - "Invlaid environment string: %hs", + "Invalid environment string: %hs", options.InitProcessOptions.Environment[i]); args.insert(args.end(), {"-e", options.InitProcessOptions.Environment[i]}); @@ -161,6 +162,5 @@ std::vector WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONT } } - return args; } \ No newline at end of file