Skip to content

Deprecate send-migration local flag in favor of memory_mode=local - #8820

Draft
phip1611 wants to merge 2 commits into
cloud-hypervisor:mainfrom
phip1611:upstream-migration-strategy
Draft

Deprecate send-migration local flag in favor of memory_mode=local#8820
phip1611 wants to merge 2 commits into
cloud-hypervisor:mainfrom
phip1611:upstream-migration-strategy

Conversation

@phip1611

@phip1611 phip1611 commented Aug 28, 2026

Copy link
Copy Markdown
Member

Since we have MigrationMode describing the ways memory gets migrated from A to B, we should fold the local flag into this. I really love this cleanup. It makes so much more sense to model it in code like this.

Steps to Undraft

  • do some more testing/code review on Monday

Local migration was modeled as a boolean orthogonal to MigrationMode,
although the two were never independent: local+postcopy was rejected and
local made precopy meaningless. Fold it into the enum as
MigrationMode::Local so only the three valid states are representable.

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
With MigrationMode::Local in place, the boolean local() helper hid the
third state: "not local" still split into precopy and postcopy at every
call site.

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
Comment thread vmm/src/api/mod.rs
#[derive(Copy, Clone, Default, Deserialize, Serialize, Debug, PartialEq, Eq)]
pub enum MigrationMode {
/// Transfer memory as memory FDs via a UNIX socket.
Local,

@phip1611 phip1611 Aug 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbradford @sboeuf while on it. I really dislike the name local. Mind changing it? And isn't every UNIX domain socket migration (unix://) kinda local so the name was misleading since forever?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--local sends the FDs for the memory so no copy so it's different. But a name that conveys that meaning would be an improvement.

Comment thread vmm/src/api/mod.rs
/// field directly; use [`Self::effective_memory_mode`], which translates
/// the old flag to the new setting.
#[deprecated(note = "set `memory_mode` to `MigrationMode::Local` instead")]
#[serde(default)]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbradford @sboeuf Do we have a process for fading out functionality from the API? I think this should be covered with the new #8751 we merged.

@phip1611 phip1611 self-assigned this Aug 28, 2026
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.

2 participants