Skip to content

Commit 921de08

Browse files
committed
[hyperv-hcs] Reintroduce delete_endpoint
1 parent d1dbc24 commit 921de08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/platform/backends/hyperv_api/hcs_virtual_machine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ void try_create_endpoints(
175175
std::vector<multipass::hyperv::hcn::CreateEndpointParameters> created_endpoints;
176176
for (const auto& endpoint : create_endpoint_params)
177177
{
178+
if (HCN().delete_endpoint(endpoint.endpoint_guid))
179+
{
180+
mpl::warn(vm_name,
181+
"Endpoint {} was already present, removed it.",
182+
endpoint.endpoint_guid);
183+
}
178184
if (const auto result = HCN().create_endpoint(endpoint))
179185
created_endpoints.push_back(endpoint);
180186
else

0 commit comments

Comments
 (0)