MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / cleanup

Method cleanup

vmm/src/migration_transport.rs:416–434  ·  view source on GitHub ↗

Signals to the worker threads that the migration is finished and joins them. If any thread encountered an error, this error is returned by this function.

(&mut self)

Source from the content-addressed store, hash-verified

414 /// Signals to the worker threads that the migration is finished and joins them.
415 /// If any thread encountered an error, this error is returned by this function.
416 pub(crate) fn cleanup(&mut self) -> Result<(), MigratableError> {
417 self.terminate_fd
418 .write(1)
419 .context("Failed to signal termination to worker threads.")
420 .map_err(MigratableError::MigrateReceive)?;
421 let accept_thread = self
422 .accept_thread
423 .take()
424 .context("Error taking accept thread.")
425 .map_err(MigratableError::MigrateReceive)?;
426 accept_thread
427 .join()
428 .map_err(|panic| {
429 MigratableError::MigrateReceive(anyhow!(
430 "Accept connections thread panicked: {panic:?}"
431 ))
432 })
433 .flatten()
434 }
435}
436
437impl Drop for ReceiveAdditionalConnections {

Callers 4

send_migrationMethod · 0.45
send_chunkMethod · 0.45
wait_for_pending_dataMethod · 0.45

Calls 5

contextMethod · 0.80
takeMethod · 0.80
okMethod · 0.80
writeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected