Skip to content

CP-311123 support xenguest compression for live migration#6921

Merged
lindig merged 1 commit intoxapi-project:masterfrom
lindig:private/christianlin/xenguest-compress-v2
Feb 25, 2026
Merged

CP-311123 support xenguest compression for live migration#6921
lindig merged 1 commit intoxapi-project:masterfrom
lindig:private/christianlin/xenguest-compress-v2

Conversation

@lindig
Copy link
Copy Markdown
Contributor

@lindig lindig commented Feb 23, 2026

Add support for migration stream compression implemented in XenGuest. This complements the existing compression scheme that uses zstd to compress the VM and vGPU memory stream during compression.

Which compression is used is controlled by xenopsd.conf and not through the API: we expect to switch to the new method in the long run.

This patch modifies the existing code that sets up the compression/decompression pipeline to be used only when the "stream" method is used. When the "xenguest" method is used, we only need to pass a flag from emu-manager. The receiving side recognises the compression as part of the migration stream it receives and does not rely on outside signalling.

For now we pass a generic -compress true" command line to xenguest but we could pass a different argument in the future.

This patch relies on support by emu-manager to receive a new command line option "-compress" that it passes to xenguest. However, as long as Pool.migration-compressor = "stream" (the default), this parameter would not passed be to emu-manager.

Comment thread ocaml/xenopsd/lib/xenops_server.ml Outdated
| "stream" ->
Stream
| str ->
warn "%s: unknown migration compressor %S" __FUNCTION__ str ;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
warn "%s: unknown migration compressor %S" __FUNCTION__ str ;
warn "%s: unknown migration compressor %S" __FUNCTION__ !migration_compressor;

For a more accurate message

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now you would have an unused binding of str; why is this better or more readable? For me we are reporting the actual match.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True, should make str into _. It's better IMO because we're reporting back what the user actually wrote - converting to lowercase is an internal processing step that doesn't need to be exposed to the user.

Comment thread ocaml/xenopsd/xenopsd.conf Outdated
Comment thread ocaml/xenopsd/lib/xenops_server.ml Outdated
@@ -1,5 +1,5 @@
(*
* Copyright (C) Citrix Systems Inc.
a Copyright (C) Citrix Systems Inc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems like a typo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Will fix.

@cplaursen
Copy link
Copy Markdown
Contributor

For reference, this is the corresponding emu-manager PR: xenserver/emu-manager#2. It's not yet merged.

@lindig
Copy link
Copy Markdown
Contributor Author

lindig commented Feb 23, 2026

Tested this - so I'm confident it works as before by default and passes -compress true to emu-manager when xenguest.conf is updated to use xenguest compression. We don't have to wait for emu-manager because this is like a feature flag: by default, we never pass this to emu-manager.

@lindig
Copy link
Copy Markdown
Contributor Author

lindig commented Feb 24, 2026

I think this is save to merge given that we won't pass new options to emu-manager/xenguest in the default configuration of xenopsd. The required change in xenopsd.conf (or the source code) acts like a feature flag.

@lindig lindig marked this pull request as ready for review February 24, 2026 10:27
@lindig lindig requested review from mg12 and robhoes February 24, 2026 11:23
@mg12
Copy link
Copy Markdown
Member

mg12 commented Feb 24, 2026

if the default xenopsd behaviour is unchanged, and a manual effort is needed to change the feature flag in xenopsd.conf to modify the default behaviour, then this change looks good to me

Copy link
Copy Markdown
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

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

While I'd prefer lib/xenops_xenserver.ml to not have names that are implementation details of the xc backend, like Xenguest, the logic is good.

Comment thread ocaml/xenopsd/xc/domain.ml
@lindig
Copy link
Copy Markdown
Contributor Author

lindig commented Feb 25, 2026

@psafont I am not fussed about how to name this method; realistically, xenguest is going to implement this first but overall, we can pass down to emu-manager anything that is different from stream.

* doc/content/design/migration-compression.md
* xapi-project#6909

Add support for migration stream compression implemented in XenGuest.
This complements the existing compression scheme that uses zstd to
compress the VM and vGPU memory stream during compression.

Which compression is used is controlled by xenopsd.conf and not through
the API: we expect to switch to the new method in the long run.

This patch modifies the existing code that sets up the
compression/decompression pipeline to be used only when the "stream"
method is used. When the "xenguest" method is used, we only need to pass
a flag from emu-manager. The receiving side recognises the compression
as part of the migration stream it receives and does not rely on outside
signalling.

For now we pass a generic -compress true" command line to xenguest but
we could pass a different argument in the future.

This patch relies on support by emu-manager to receive a new command
line option "-compress" that it passes to xenguest. However, as long as
Pool.migration-compressor = "stream" (the default), this parameter would
not passed be to emu-manager.

Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
@lindig lindig force-pushed the private/christianlin/xenguest-compress-v2 branch from 36b59ab to ca5fac6 Compare February 25, 2026 13:39
@lindig lindig added this pull request to the merge queue Feb 25, 2026
Merged via the queue into xapi-project:master with commit 64dbf1f Feb 25, 2026
16 checks passed
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.

5 participants