Skip to content

Fix auto-converge on live migration retry - #189

Open
olivereanderson wants to merge 4 commits into
cyberus-technology:gardenlinuxfrom
olivereanderson:auto-converge-retry
Open

Fix auto-converge on live migration retry#189
olivereanderson wants to merge 4 commits into
cyberus-technology:gardenlinuxfrom
olivereanderson:auto-converge-retry

Conversation

@olivereanderson

@olivereanderson olivereanderson commented Aug 3, 2026

Copy link
Copy Markdown

Fixes https://github.com/cobaltcore-dev/cobaltcore/issues/642.

We may want to consider just spawning the throttling thread per live migration attempt instead, but since we might very well replace auto-converge with post-copy in the not too distant feature it might not be worth investing too much time in perfecting this now.

The existing libvirt test suite seems to pass on this branch: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/267, but it would be nice to include an additional test for this particular case.

The ThrottleCommand does not need to be Clone (nor Copy) as of now and
we will need to introduce a variant wrapping a type that is not Copy in
a follow up commit.

It is also debatable whether a message type should be Clone, as they
are typically intended to be sent only once (and not used for other
purposes).

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
In order to add a command for resetting the throttle thread with
confirmation we have to add an additional variant that wraps a type
that does not implement the PartialEq and Eq traits.

We thus need to choose between manually implementing these traits for
ThrottleCommand, or avoiding them. We choose the latter because that
requires much less code.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
It makes more sense for a command to use the imperative form and the
enum does not need to be used to track the throttling thread's current
state.

This enables us to introduce a reset variant to the enum that asks the
throttle thread to stop its throttle loop and inform us when it is back
to waiting for the next incoming command.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
The current behavior of joining the vCPU throttling thread towards the
end of a live migration is problematic when the live migration fails
because then auto-converge is no longer possible on a second attempt.

We fix this by instead resetting the throttling thread to its initial
state.

The throttling thread is now instead gracefully stopped by the
ThrottleThreadHandle's destructor which runs whenever the Vm instance
goes out of scope.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
@olivereanderson
olivereanderson marked this pull request as ready for review August 3, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant