vmm: improved error messages

Unrelated improvements that help to catch common pitfalls.

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster
2026-06-15 12:05:25 +02:00
committed by Rob Bradford
parent 15cab7ee6a
commit 4491a3e412

View File

@@ -2617,6 +2617,15 @@ impl RequestHandler for Vmm {
&mut self,
receive_data_migration: VmReceiveMigrationData,
) -> result::Result<(), MigratableError> {
match &self.vm {
VmOwnership::Owned(_vm) => {
return Err(MigratableError::MigrateReceive(anyhow!(
"Can't receive a migration when a VM is already created"
)));
}
VmOwnership::None => {}
}
receive_data_migration
.validate()
.context("Invalid receive migration configuration")
@@ -2633,6 +2642,10 @@ impl RequestHandler for Vmm {
receive_data_migration.tls_dir.as_deref(),
)?;
if self.vm_config.is_some() {
warn!("The existing VM config will be overwritten");
}
event!("vm", "migration-receive-ready");
// Accept the connection and get the socket