mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: encrypt migration data with TLS if configured
Wire in the code paths that activate the TLS encrypting if the necessary API arguments are provided. On-behalf-of: SAP sebastian.eydam@sap.com Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
320403a11e
commit
cf28552085
@@ -1414,8 +1414,10 @@ impl Vmm {
|
||||
let mut ctx = OngoingMigrationContext::new();
|
||||
|
||||
// Set up the socket connection
|
||||
let mut socket =
|
||||
migration_transport::send_migration_socket(&send_data_migration.destination_url)?;
|
||||
let mut socket = migration_transport::send_migration_socket(
|
||||
&send_data_migration.destination_url,
|
||||
send_data_migration.tls_dir.as_deref(),
|
||||
)?;
|
||||
|
||||
// Start the migration
|
||||
migration_transport::send_request_expect_ok(
|
||||
@@ -1505,6 +1507,7 @@ impl Vmm {
|
||||
let mut mem_send = migration_transport::SendAdditionalConnections::new(
|
||||
&send_data_migration.destination_url,
|
||||
send_data_migration.connections,
|
||||
send_data_migration.tls_dir.as_deref(),
|
||||
&vm.guest_memory(),
|
||||
)?;
|
||||
|
||||
@@ -2549,13 +2552,21 @@ impl RequestHandler for Vmm {
|
||||
&mut self,
|
||||
receive_data_migration: VmReceiveMigrationData,
|
||||
) -> result::Result<(), MigratableError> {
|
||||
receive_data_migration
|
||||
.validate()
|
||||
.context("Invalid receive migration configuration")
|
||||
.map_err(MigratableError::MigrateReceive)?;
|
||||
|
||||
info!(
|
||||
"Receiving migration: receiver_url = {}",
|
||||
receive_data_migration.receiver_url
|
||||
"Receiving migration: receiver_url={},tls={}",
|
||||
receive_data_migration.receiver_url,
|
||||
receive_data_migration.tls_dir.is_some()
|
||||
);
|
||||
|
||||
let mut listener =
|
||||
migration_transport::receive_migration_listener(&receive_data_migration.receiver_url)?;
|
||||
let mut listener = migration_transport::receive_migration_listener(
|
||||
&receive_data_migration.receiver_url,
|
||||
receive_data_migration.tls_dir.as_deref(),
|
||||
)?;
|
||||
|
||||
event!("vm", "migration-receive-ready");
|
||||
|
||||
@@ -2614,9 +2625,10 @@ impl RequestHandler for Vmm {
|
||||
.map_err(MigratableError::MigrateSend)?;
|
||||
|
||||
info!(
|
||||
"Sending migration: destination_url={},local={},downtime={}ms,timeout={}s,timeout_strategy={:?}",
|
||||
"Sending migration: destination_url={},local={},tls={},downtime={}ms,timeout={}s,timeout_strategy={:?}",
|
||||
send_data_migration.destination_url,
|
||||
send_data_migration.local,
|
||||
send_data_migration.tls_dir.is_some(),
|
||||
send_data_migration.downtime().as_millis(),
|
||||
send_data_migration.timeout().as_secs(),
|
||||
send_data_migration.timeout_strategy
|
||||
|
||||
Reference in New Issue
Block a user