Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
78a15c6
vmm: Revert "skip pending memory sends on worker failure"
phip1611 Sep 22, 2026
bc6d7e1
vmm: Revert "fix migration sender hang on worker failure"
phip1611 Sep 22, 2026
61bb025
vmm: Revert "Reset throttle thread when do_memory_iteration fails"
phip1611 Sep 22, 2026
8ce9c5b
vmm: Revert "Do not stop vCPU throttle thread after migration"
phip1611 Sep 22, 2026
ac70bd6
vmm: Revert "clean up migration threads on failure"
phip1611 Sep 22, 2026
9684289
vmm, vm-migration: Revert "streamline error chain message with upstream"
phip1611 Sep 22, 2026
8a9e565
vmm, vm-migration: Revert "add MigrationStateOngoingPhase::Started"
phip1611 Sep 22, 2026
58e8d5b
vmm: Revert "Remove duplicated update_migration_progress"
phip1611 Sep 22, 2026
aed01fb
vmm: Revert "Fix memory_transmission_bps value in do_memory_iterations"
phip1611 Sep 22, 2026
ea46800
vmm: Revert "Fix memory_bytes_total value in do_memory_iterations"
phip1611 Sep 22, 2026
e31b846
vmm: Revert "keep virtio activation alive in migration"
phip1611 Sep 22, 2026
89db6ab
vmm: Revert "reduce API event verbosity"
phip1611 Sep 22, 2026
3e5b8bb
vmm: Revert "defer guest exit during migration"
phip1611 Sep 22, 2026
a2326fb
vmm: Revert "migration: properly print error chain on failure"
phip1611 Sep 22, 2026
afb625a
ch-remote: Revert "add cancel-migration"
phip1611 Sep 22, 2026
8af0f21
vmm: Revert "migration cancellation: integrate into TCP threads"
phip1611 Sep 22, 2026
c1c4ccb
vmm: Revert "migration: early cancellation (add more checks)"
phip1611 Sep 22, 2026
4fef0d3
vmm: Revert "migration: actually support cancellation"
phip1611 Sep 22, 2026
749bed3
vmm: Revert "add try_resume_vm() helper"
phip1611 Sep 22, 2026
24628b3
vmm: Revert "migration: add handle wrapper for MigrationWorker"
phip1611 Sep 22, 2026
3cc95e1
vmm: Revert "http api: add VmCancelMigration action"
phip1611 Sep 22, 2026
eb382e3
vmm: Revert "api: add VmCancelMigration action"
phip1611 Sep 22, 2026
afc30fa
vmm: Revert "streamline migration failure cleanup"
phip1611 Sep 22, 2026
92a03cc
vmm: Revert "migration: switch downtime on postponed event"
phip1611 Sep 22, 2026
8fcc228
vmm: Revert "postpone reset/exit during migration"
phip1611 Sep 22, 2026
17bac69
vmm: Revert "add post-migration event to VmSnapshot"
phip1611 Sep 22, 2026
362a302
vmm: Revert "api: less verbose log"
phip1611 Sep 22, 2026
a8f5c5a
ch-remote: Revert "wait for migration to finish via progress"
phip1611 Sep 22, 2026
ea1d139
ch-remote: Revert "add `migration-progress` command"
phip1611 Sep 22, 2026
06a8b76
vmm: Revert "migration: switch to non-blocking SendMigration call"
phip1611 Sep 22, 2026
8bd22d8
vmm: Revert "actually populate migration progress"
phip1611 Sep 22, 2026
6e93ca8
vmm: Revert "add migration-progress HTTP endpoint"
phip1611 Sep 22, 2026
a38ab26
vmm: Revert "add migration-progress API endpoint"
phip1611 Sep 22, 2026
c67d4ef
vm-migration: Revert "prepare progress types for new API endpoint"
phip1611 Sep 22, 2026
13cf42e
vmm: Revert "migration: limit to running VMs only"
phip1611 Sep 22, 2026
0dd098a
vmm: Revert "migration: fix missing resume() after failure"
phip1611 Sep 22, 2026
244176b
vmm: Revert "api: temporarily make VmSendMigration call blocking again"
phip1611 Sep 22, 2026
3b96496
vmm: Revert "better VM ownership handling in context of live migration"
phip1611 Sep 22, 2026
17aac38
vmm: Revert "migration: handle in dedicated thread (make async)"
phip1611 Sep 22, 2026
17469c4
vmm: Revert "migration: prepare EventFd for async migration events"
phip1611 Sep 22, 2026
5232436
vmm: improve VM ownership handling
phip1611 Oct 30, 2025
80cebd5
vmm: init migration worker module
phip1611 Jun 1, 2026
d036af3
vmm: migration: prepare EventFd for async migration events
phip1611 Nov 21, 2025
e19adcd
vmm: migration: handle in dedicated thread (make async)
phip1611 Jun 1, 2026
649a438
vmm: streamline request handlers to use match{} on vm
phip1611 Jun 17, 2026
519cd2f
vmm: move migration modules into folder
phip1611 May 12, 2026
e9ea9b2
tests: adjust to new dispatch semantics of `ch-remote send-migration`
phip1611 May 29, 2026
fff7199
vm-migration: prepare progress types for new API endpoint
phip1611 Jan 13, 2026
d4e846f
vmm: add migration-progress API endpoint
phip1611 Jan 13, 2026
fbd0dd6
vmm: add migration-progress HTTP endpoint
phip1611 Jan 12, 2026
1a16722
vmm: actually populate migration progress
phip1611 Jan 22, 2026
1ec0d15
ch-remote: add `migration-progress` command
phip1611 Feb 12, 2026
af24c95
vmm: keep the VMM alive after a migration if requested
phip1611 Sep 22, 2026
722cce5
ch-remote: wait for migration to finish by querying migration progress
phip1611 Feb 12, 2026
8c9b013
tests: dispatch the migration in the TCP timeout test
phip1611 Sep 22, 2026
aa67073
vmm: api: less verbose log
phip1611 Feb 19, 2026
82fc547
vmm: add post-migration event to VmSnapshot
Coffeeri Feb 17, 2026
dab1d8f
vmm: postpone reset/exit during migration
Coffeeri Feb 17, 2026
fbd4642
vmm: migration: switch downtime on postponed event
Coffeeri Feb 17, 2026
54d497a
vmm: api: add VmCancelMigration action
phip1611 Feb 19, 2026
145e2ab
vmm: http api: add VmCancelMigration action
phip1611 Feb 19, 2026
234c627
vmm: migration: actually support cancellation
phip1611 Mar 2, 2026
6e0465d
vmm: migration: early cancellation (add more checks)
phip1611 Mar 2, 2026
43ee9ac
vmm: migration cancellation: integrate into TCP threads
phip1611 Mar 5, 2026
39296b4
ch-remote: add cancel-migration
phip1611 Feb 19, 2026
8c42401
vmm: migration: properly print error chain on failure
phip1611 Mar 30, 2026
17539fe
vmm: defer guest exit during migration
Coffeeri Mar 9, 2026
dbcc815
vmm: reduce API event verbosity
phip1611 Mar 13, 2026
3c44fa9
vmm: keep virtio activation alive in migration
Coffeeri Mar 10, 2026
62c9d67
vmm: Fix memory_bytes_total value in do_memory_iterations
olivereanderson May 27, 2026
33f709f
vmm: Fix memory_transmission_bps value in do_memory_iterations
olivereanderson May 27, 2026
48de5cf
vmm: Remove duplicated update_migration_progress in do_memory_iterations
olivereanderson May 27, 2026
90d72a2
vmm, vm-migration: add MigrationStateOngoingPhase::Started
phip1611 Jul 1, 2026
aaa060d
vmm, vm-migration: streamline error chain message with upstream
phip1611 Jul 1, 2026
fd16dfe
vmm: clean up migration threads on failure
arctic-alpaca Jul 29, 2026
6dd5f15
vmm: Do not stop vCPU throttle thread at the end of a live migration
olivereanderson Aug 3, 2026
a1cc49e
vmm: Reset throttle thread when do_memory_iteration fails
olivereanderson Aug 6, 2026
1800bdd
vmm: fix migration sender hang on worker failure
Coffeeri Aug 18, 2026
a562ac2
vmm: skip pending memory sends on worker failure
Coffeeri Aug 18, 2026
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
72 changes: 46 additions & 26 deletions cloud-hypervisor/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6675,6 +6675,8 @@ mod common_parallel {

let src_vm_path = clh_command("cloud-hypervisor");
let src_api_socket = temp_api_path(&guest.tmp_dir);
let event_path = temp_event_monitor_path(&guest.tmp_dir);
let src_event_path = format!("{event_path}.src");
let mut src_vm_cmd = GuestCommand::new_with_binary_path(&guest, &src_vm_path);
src_vm_cmd
.args(["--cpus", format!("boot={boot_vcpus}").as_str()])
Expand All @@ -6684,6 +6686,7 @@ mod common_parallel {
.default_disks()
.args(["--net", net_params.as_str()])
.args(["--api-socket", &src_api_socket])
.args(["--event-monitor", format!("path={src_event_path}").as_str()])
.capture_output();
let mut src_child = src_vm_cmd.spawn().unwrap();

Expand Down Expand Up @@ -6731,6 +6734,7 @@ mod common_parallel {
.args([
&format!("--api-socket={src_api_socket}"),
"send-migration",
"--dispatch",
&format!(
"destination_url=tcp:{host_ip}:{migration_port},downtime_ms=1,timeout_s=1,timeout_strategy={timeout_strategy:?}"
),
Expand All @@ -6748,6 +6752,18 @@ mod common_parallel {
.wait_timeout(Duration::from_secs(60))
.unwrap();

let send_dispatched = match send_status {
Some(status) => status.success(),
None => {
let _ = send_migration.kill();
false
}
};
assert!(
send_dispatched,
"send-migration should have dispatched successfully"
);

// Clean up receive-migration regardless of its outcome
if receive_status.is_none() {
let _ = receive_migration.kill();
Expand All @@ -6759,19 +6775,21 @@ mod common_parallel {

match timeout_strategy {
TimeoutStrategy::Cancel => {
// With cancel strategy the send must fail and the source VM
// must keep running.
let send_failed = match send_status {
Some(status) => !status.success(),
None => {
let _ = send_migration.kill();
false
}
};
assert!(
send_failed,
"send-migration should have failed due to 1s timeout with cancel strategy"
);
let expected_events = [
&MetaEvent {
event: "migration-started".to_string(),
device_id: None,
},
&MetaEvent {
event: "migration-failed".to_string(),
device_id: None,
},
];
assert!(wait_for_sequential_events(
Duration::from_secs(30),
&expected_events,
&src_event_path
));

thread::sleep(Duration::from_secs(2));
assert!(
Expand All @@ -6783,19 +6801,21 @@ mod common_parallel {
assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus);
}
TimeoutStrategy::Ignore => {
// With Ignore strategy the send must succeed despite the timeout
// being reached, and the source VM must have terminated.
let send_succeeded = match send_status {
Some(status) => status.success(),
None => {
let _ = send_migration.kill();
false
}
};
assert!(
send_succeeded,
"send-migration should have succeeded with timeout_strategy=ignore"
);
let expected_events = [
&MetaEvent {
event: "migration-started".to_string(),
device_id: None,
},
&MetaEvent {
event: "migration-finished".to_string(),
device_id: None,
},
];
assert!(wait_for_sequential_events(
Duration::from_secs(30),
&expected_events,
&src_event_path
));

thread::sleep(Duration::from_secs(3));
assert!(
Expand Down
8 changes: 4 additions & 4 deletions fuzz/fuzz_targets/http_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ impl RequestHandler for StubApiRequestHandler {
Ok(())
}

fn vm_post_migration_announce(&mut self) -> Result<(), VmError> {
Ok(())
}

fn vm_migration_progress(&mut self) -> Option<MigrationProgress> {
None
}

fn vm_cancel_migration(&mut self) -> Result<(), MigratableError> {
Ok(())
}

fn vm_post_migration_announce(&mut self) -> Result<(), VmError> {
Ok(())
}
}

fn http_receiver_stub(exit_evt: EventFd, api_evt: EventFd, api_receiver: Receiver<ApiRequest>) {
Expand Down
31 changes: 1 addition & 30 deletions vmm/src/api/http/http_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
use std::fs::File;
use std::sync::mpsc::Sender;

use log::info;
use micro_http::{Body, Method, Request, Response, StatusCode, Version};
use vmm_sys_util::eventfd::EventFd;

Expand Down Expand Up @@ -433,6 +432,7 @@ vm_action_put_handler_body!(VmRemoveDevice);
vm_action_put_handler_body!(VmResizeDisk);
vm_action_put_handler_body!(VmResizeZone);
vm_action_put_handler_body!(VmSnapshot);
vm_action_put_handler_body!(VmSendMigration);

#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
vm_action_put_handler_body!(VmCoredump);
Expand Down Expand Up @@ -489,35 +489,6 @@ impl PutHandler for VmReceiveMigration {

impl GetHandler for VmReceiveMigration {}

// Special Handling for virtio-net Devices Backed by Network File Descriptors
//
// See above.
impl PutHandler for VmSendMigration {
fn handle_request(
&'static self,
api_notifier: EventFd,
api_sender: Sender<ApiRequest>,
body: &Option<Body>,
_files: Vec<File>,
) -> std::result::Result<Option<Body>, HttpError> {
if let Some(body) = body {
self.send(
api_notifier,
api_sender,
serde_json::from_slice(body.raw())?,
)
.inspect(|_| {
info!("live migration started (in background)");
})
.map_err(HttpError::ApiError)
} else {
Err(HttpError::BadRequest)
}
}
}

impl GetHandler for VmSendMigration {}

impl PutHandler for VmResize {
fn handle_request(
&'static self,
Expand Down
2 changes: 1 addition & 1 deletion vmm/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub use self::http::{start_http_fd_thread, start_http_path_thread};
use crate::Error as VmmError;
use crate::config::{RestoreConfig, RestoredNetConfig};
use crate::device_tree::DeviceTree;
use crate::migration_transport::MAX_MIGRATION_CONNECTIONS;
use crate::migration::transport::MAX_MIGRATION_CONNECTIONS;
use crate::vm::{Error as VmError, VmState};
use crate::vm_config::{
DeviceConfig, DiskConfig, FsConfig, GenericVhostUserConfig, MemoryZoneConfig, NetConfig,
Expand Down
Loading
Loading