Skip to content

Commit 5088e5b

Browse files
committed
[hyper-v] update comment for the update_state ip invalidation
Signed-off-by: Mustafa Kemal Gilor <[email protected]>
1 parent b85d527 commit 5088e5b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/platform/backends/hyperv/hyperv_virtual_machine.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,8 @@ void mp::HyperVVirtualMachine::update_state()
455455
// Invalidate the management IP address on state update.
456456
if (current_state() == VirtualMachine::State::running)
457457
{
458-
// The reason "why" is as follows:
459-
// - The daemon starts and constructs the VM
460-
// - The mgmt IP address gets cached on the first invocation of management_ipv4()
461-
// - `multipass restart` initiates a guest reboot with "sudo reboot"
462-
// - It's an "out-of-band" reboot in perspective of Hyper-V backend since
463-
// it does not trigger the "on_restart" function afterwards.
464-
// - The cached "vm->ip address is not reset
465-
// - management_ipv4() continues to report the stale IP address from the previous boot
458+
// Cached IPs become stale when the guest is restarted from within. By resetting them here
459+
// we at least cover multipass's restart initiatives, which include state updates.
466460
mpl::log(mpl::Level::debug,
467461
vm_name,
468462
"Invalidating cached mgmt IP address upon state update");

0 commit comments

Comments
 (0)