Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions cloud-hypervisor/src/bin/ch-remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ fn rest_api_do_command(matches: &ArgMatches, socket: &mut UnixStream) -> ApiResu
.get_one::<PathBuf>("tls-dir")
.cloned(),
wait_for_migration,
*matches
.subcommand_matches("send-migration")
.unwrap()
.get_one::<bool>("skip-zero-pages")
.unwrap(),
);

simple_api_command(socket, "PUT", "send-migration", Some(&send_migration_data))
Expand Down Expand Up @@ -1032,6 +1037,7 @@ fn receive_migration_data(url: String, tls_dir: Option<PathBuf>) -> String {
serde_json::to_string(&receive_migration_data).unwrap()
}

#[allow(clippy::too_many_arguments)]
fn send_migration_data(
url: String,
local: bool,
Expand All @@ -1040,6 +1046,7 @@ fn send_migration_data(
connections: NonZeroU32,
tls_dir: Option<PathBuf>,
keep_alive: bool,
skip_zero_pages: bool,
) -> String {
let send_migration_data = vmm::api::VmSendMigrationData {
destination_url: url,
Expand All @@ -1049,6 +1056,7 @@ fn send_migration_data(
connections,
tls_dir,
keep_alive,
skip_zero_pages,
};

serde_json::to_string(&send_migration_data).unwrap()
Expand Down Expand Up @@ -1275,6 +1283,12 @@ fn get_cli_commands_sorted() -> Box<[Command]> {
.num_args(0)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("skip-zero-pages")
.long("skip-zero-pages")
.help("skip zero-filled pages when sending VM memory to the receiver")
.num_args(0),
)
.arg(
Arg::new("tls-dir")
.long("tls-dir")
Expand Down
4 changes: 4 additions & 0 deletions vm-migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ version = "0.1.0"
[dependencies]
anyhow = { workspace = true }
itertools = { workspace = true }
libc = { workspace = true }
rustls = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
vm-memory = { workspace = true, features = ["backend-atomic", "backend-mmap"] }

[dev-dependencies]
vm-memory = { workspace = true, features = ["backend-bitmap"] }

[lints]
workspace = true
Loading
Loading