Apply PR feedback

This commit is contained in:
Blue 2025-12-09 11:36:24 -08:00
parent 52e020f8a4
commit 7cf58493ee
4 changed files with 5 additions and 9 deletions

View File

@ -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) ContainerEventTracker::ContainerTrackingReference& ContainerEventTracker::ContainerTrackingReference::operator=(ContainerEventTracker::ContainerTrackingReference&& other)
{ {
Reset(); Reset();
@ -36,6 +31,7 @@ ContainerEventTracker::ContainerTrackingReference& ContainerEventTracker::Contai
m_tracker = other.m_tracker; m_tracker = other.m_tracker;
other.m_tracker = nullptr; other.m_tracker = nullptr;
other.m_id = {};
return *this; return *this;
} }

View File

@ -40,7 +40,7 @@ public:
ContainerTrackingReference() = default; ContainerTrackingReference() = default;
ContainerTrackingReference(ContainerEventTracker* tracker, size_t id); ContainerTrackingReference(ContainerEventTracker* tracker, size_t id);
ContainerTrackingReference(ContainerTrackingReference&&); ContainerTrackingReference(ContainerTrackingReference&&) = default;
~ContainerTrackingReference(); ~ContainerTrackingReference();
ContainerTrackingReference& operator=(ContainerTrackingReference&&); ContainerTrackingReference& operator=(ContainerTrackingReference&&);

View File

@ -208,7 +208,7 @@ Microsoft::WRL::ComPtr<WSLAContainer> WSLAContainer::Create(
inputOptions.push_back("-t"); inputOptions.push_back("-t");
} }
auto args = PrepareNerdctlRunCommand(containerOptions, std::move(inputOptions)); auto args = PrepareNerdctlCreateCommand(containerOptions, std::move(inputOptions));
ServiceProcessLauncher launcher(nerdctlPath, args, {}); ServiceProcessLauncher launcher(nerdctlPath, args, {});
auto result = launcher.Launch(parentVM).WaitAndCaptureOutput(); auto result = launcher.Launch(parentVM).WaitAndCaptureOutput();
@ -225,7 +225,7 @@ Microsoft::WRL::ComPtr<WSLAContainer> WSLAContainer::Create(
return wil::MakeOrThrow<WSLAContainer>(&parentVM, containerOptions, std::move(id), eventTracker); return wil::MakeOrThrow<WSLAContainer>(&parentVM, containerOptions, std::move(id), eventTracker);
} }
std::vector<std::string> WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector<std::string>&& inputOptions) std::vector<std::string> WSLAContainer::PrepareNerdctlCreateCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector<std::string>&& inputOptions)
{ {
std::vector<std::string> args{nerdctlPath}; std::vector<std::string> args{nerdctlPath};
args.push_back("create"); args.push_back("create");

View File

@ -59,6 +59,6 @@ private:
WSLAVirtualMachine* m_parentVM = nullptr; WSLAVirtualMachine* m_parentVM = nullptr;
ContainerEventTracker::ContainerTrackingReference m_trackingReference; ContainerEventTracker::ContainerTrackingReference m_trackingReference;
static std::vector<std::string> PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector<std::string>&& inputOptions); static std::vector<std::string> PrepareNerdctlCreateCommand(const WSLA_CONTAINER_OPTIONS& options, std::vector<std::string>&& inputOptions);
}; };
} // namespace wsl::windows::service::wsla } // namespace wsl::windows::service::wsla