migration/cpr: Avoid crashing QEMU when cpr-exec runs with no args
If an user invokes cpr-exec without setting the exec args first, currently it'll crash QEMU. Avoid it, instead fail the QMP migrate command. Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20251021220407.2662288-5-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
89471ef237
commit
ded3cf4aaf
1 changed files with 6 additions and 0 deletions
|
|
@ -2195,6 +2195,12 @@ static bool migrate_prepare(MigrationState *s, bool resume, Error **errp)
|
|||
error_setg(errp, "Cannot use %s with CPR", conflict);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s->parameters.mode == MIG_MODE_CPR_EXEC &&
|
||||
!s->parameters.cpr_exec_command) {
|
||||
error_setg(errp, "Parameter 'cpr-exec-command' required for cpr-exec");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (migrate_init(s, errp)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue