Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vl: Improve error message for conflicting -incoming and -loadvm
Currently, the conflict between -incoming and -loadvm is only detected
when loading the snapshot fails because the image is still inactive for
the incoming migration. This results in a suboptimal error message:

$ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
qemu-system-x86_64: Device 'ide0-hd0' is writable but does not support snapshots

Catch the situation already in qemu_validate_options() to improve the
message:

$ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
qemu-system-x86_64: 'incoming' and 'loadvm' options are mutually exclusive

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231201142520.32255-3-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Kevin Wolf committed Dec 21, 2023
1 parent 96d3989 commit 3bfe316
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/vl.c
Expand Up @@ -2426,6 +2426,10 @@ static void qemu_validate_options(const QDict *machine_opts)
}
}

if (loadvm && incoming) {
error_report("'incoming' and 'loadvm' options are mutually exclusive");
exit(EXIT_FAILURE);
}
if (loadvm && preconfig_requested) {
error_report("'preconfig' and 'loadvm' options are "
"mutually exclusive");
Expand Down

0 comments on commit 3bfe316

Please sign in to comment.