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

Function send_config

vmm/src/migration_transport.rs:850–865  ·  view source on GitHub ↗

Serialize and send the VM configuration payload.

(
    socket: &mut SocketStream,
    config: &VmMigrationConfig,
)

Source from the content-addressed store, hash-verified

848
849/// Serialize and send the VM configuration payload.
850pub(crate) fn send_config(
851 socket: &mut SocketStream,
852 config: &VmMigrationConfig,
853) -> Result<(), MigratableError> {
854 let config_data = serde_json::to_vec(config)
855 .context("Error serializing VM migration config")
856 .map_err(MigratableError::MigrateSend)?;
857 Request::config(config_data.len() as u64).write_to(socket)?;
858 socket
859 .write_all(&config_data)
860 .map_err(MigratableError::MigrateSocket)?;
861 expect_ok_response(
862 socket,
863 MigratableError::MigrateSend(anyhow!("Error during config migration")),
864 )
865}
866
867/// Serialize and send the VM snapshot payload.
868pub(crate) fn send_state(

Callers 1

send_migrationMethod · 0.85

Calls 4

expect_ok_responseFunction · 0.85
contextMethod · 0.80
write_toMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected