From 7cf58493ee2a85f78bbb5f6584aa26b46e3ffd71 Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 9 Dec 2025 11:36:24 -0800 Subject: [PATCH] Apply PR feedback --- src/windows/wslaservice/exe/ContainerEventTracker.cpp | 6 +----- src/windows/wslaservice/exe/ContainerEventTracker.h | 2 +- src/windows/wslaservice/exe/WSLAContainer.cpp | 4 ++-- src/windows/wslaservice/exe/WSLAContainer.h | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/windows/wslaservice/exe/ContainerEventTracker.cpp b/src/windows/wslaservice/exe/ContainerEventTracker.cpp index bf61661..e7d5940 100644 --- a/src/windows/wslaservice/exe/ContainerEventTracker.cpp +++ b/src/windows/wslaservice/exe/ContainerEventTracker.cpp @@ -24,11 +24,6 @@ ContainerEventTracker::ContainerTrackingReference::ContainerTrackingReference(Co { } -ContainerEventTracker::ContainerTrackingReference::ContainerTrackingReference(ContainerEventTracker::ContainerTrackingReference&& other) -{ - (*this) = std::move(other); -} - ContainerEventTracker::ContainerTrackingReference& ContainerEventTracker::ContainerTrackingReference::operator=(ContainerEventTracker::ContainerTrackingReference&& other) { Reset(); @@ -36,6 +31,7 @@ ContainerEventTracker::ContainerTrackingReference& ContainerEventTracker::Contai m_tracker = other.m_tracker; other.m_tracker = nullptr; + other.m_id = {}; return *this; } diff --git a/src/windows/wslaservice/exe/ContainerEventTracker.h b/src/windows/wslaservice/exe/ContainerEventTracker.h index 9491dd9..5584ae7 100644 --- a/src/windows/wslaservice/exe/ContainerEventTracker.h +++ b/src/windows/wslaservice/exe/ContainerEventTracker.h @@ -40,7 +40,7 @@ public: ContainerTrackingReference() = default; ContainerTrackingReference(ContainerEventTracker* tracker, size_t id); - ContainerTrackingReference(ContainerTrackingReference&&); + ContainerTrackingReference(ContainerTrackingReference&&) = default; ~ContainerTrackingReference(); ContainerTrackingReference& operator=(ContainerTrackingReference&&); diff --git a/src/windows/wslaservice/exe/WSLAContainer.cpp b/src/windows/wslaservice/exe/WSLAContainer.cpp index 21e1d6c..1f13cc3 100644 --- a/src/windows/wslaservice/exe/WSLAContainer.cpp +++ b/src/windows/wslaservice/exe/WSLAContainer.cpp @@ -208,7 +208,7 @@ Microsoft::WRL::ComPtr WSLAContainer::Create( inputOptions.push_back("-t"); } - auto args = PrepareNerdctlRunCommand(containerOptions, std::move(inputOptions)); + auto args = PrepareNerdctlCreateCommand(containerOptions, std::move(inputOptions)); ServiceProcessLauncher launcher(nerdctlPath, args, {}); auto result = launcher.Launch(parentVM).WaitAndCaptureOutput(); @@ -225,7 +225,7 @@ Microsoft::WRL::ComPtr WSLAContainer::Create( return wil::MakeOrThrow(&parentVM, containerOptions, std::move(id), eventTracker); } -std::vector WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector&& inputOptions) +std::vector WSLAContainer::PrepareNerdctlCreateCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector&& inputOptions) { std::vector args{nerdctlPath}; args.push_back("create"); diff --git a/src/windows/wslaservice/exe/WSLAContainer.h b/src/windows/wslaservice/exe/WSLAContainer.h index 89f4aea..ab82462 100644 --- a/src/windows/wslaservice/exe/WSLAContainer.h +++ b/src/windows/wslaservice/exe/WSLAContainer.h @@ -59,6 +59,6 @@ private: WSLAVirtualMachine* m_parentVM = nullptr; ContainerEventTracker::ContainerTrackingReference m_trackingReference; - static std::vector PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector&& inputOptions); + static std::vector PrepareNerdctlCreateCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector&& inputOptions); }; } // namespace wsl::windows::service::wsla \ No newline at end of file