aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-12-01 15:25:19 +0100
committerKevin Wolf <kwolf@redhat.com>2023-12-21 22:49:27 +0100
commit5a7f21efaf99c60614fe1967be1c0f9aa46c526e (patch)
tree582b735415e1f265b9fd56f0884dac5bde1ba4ff
parentd3007d348adaaf04ee8b099a475282034a662414 (diff)
downloadqemu-5a7f21efaf99c60614fe1967be1c0f9aa46c526e.zip
qemu-5a7f21efaf99c60614fe1967be1c0f9aa46c526e.tar.gz
qemu-5a7f21efaf99c60614fe1967be1c0f9aa46c526e.tar.bz2
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>
-rw-r--r--system/vl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/system/vl.c b/system/vl.c
index 2bcd9ef..6b87bfa 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -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");