From 987b1b73f4f7d69fbf7e7a9e79542a0068bdbe16 Mon Sep 17 00:00:00 2001 From: Blue Date: Wed, 26 Nov 2025 14:52:37 -0800 Subject: [PATCH] Prepare for PR --- src/windows/wslaservice/exe/WSLAContainer.cpp | 4 +++- src/windows/wslaservice/exe/WSLAContainer.h | 1 - src/windows/wslaservice/exe/WSLASession.cpp | 1 - src/windows/wslaservice/exe/WSLASession.h | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/windows/wslaservice/exe/WSLAContainer.cpp b/src/windows/wslaservice/exe/WSLAContainer.cpp index 49297d5..51e6404 100644 --- a/src/windows/wslaservice/exe/WSLAContainer.cpp +++ b/src/windows/wslaservice/exe/WSLAContainer.cpp @@ -18,7 +18,7 @@ Abstract: using wsl::windows::service::wsla::WSLAContainer; -const std::string nerdctlPath = "/usr/bin/nerdctl"; +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. @@ -66,6 +66,8 @@ CATCH_RETURN(); Microsoft::WRL::ComPtr WSLAContainer::Create(const WSLA_CONTAINER_OPTIONS& containerOptions, WSLAVirtualMachine& parentVM) { + // TODO: Switch to nerdctl create, and call nerdctl start in Start(). + bool hasStdin = false; bool hasTty = false; for (size_t i = 0; i < containerOptions.InitProcessOptions.FdsCount; i++) diff --git a/src/windows/wslaservice/exe/WSLAContainer.h b/src/windows/wslaservice/exe/WSLAContainer.h index f627da6..d84eaac 100644 --- a/src/windows/wslaservice/exe/WSLAContainer.h +++ b/src/windows/wslaservice/exe/WSLAContainer.h @@ -44,7 +44,6 @@ public: private: ServiceRunningProcess m_containerProcess; WSLAVirtualMachine* m_parentVM = nullptr; - std::string m_id; static std::vector PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector&& inputOptions); }; diff --git a/src/windows/wslaservice/exe/WSLASession.cpp b/src/windows/wslaservice/exe/WSLASession.cpp index bbfceff..1e34394 100644 --- a/src/windows/wslaservice/exe/WSLASession.cpp +++ b/src/windows/wslaservice/exe/WSLASession.cpp @@ -94,7 +94,6 @@ try THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_INVALID_STATE), !m_virtualMachine); // TODO: Log entrance into the function. - m_containerId++; auto container = WSLAContainer::Create(*containerOptions, *m_virtualMachine.Get()); THROW_IF_FAILED(container.CopyTo(__uuidof(IWSLAContainer), (void**)Container)); diff --git a/src/windows/wslaservice/exe/WSLASession.h b/src/windows/wslaservice/exe/WSLASession.h index 362a70e..21eb621 100644 --- a/src/windows/wslaservice/exe/WSLASession.h +++ b/src/windows/wslaservice/exe/WSLASession.h @@ -58,7 +58,6 @@ private: std::wstring m_displayName; std::mutex m_lock; - std::atomic_int m_containerId = 1; // TODO: Add container tracking here. Could reuse m_lock for that. };