48 lines
1.7 KiB
Diff
48 lines
1.7 KiB
Diff
|
|
From 2971bbb88efe921f7b3e1ee80295e16ae5954e67 Mon Sep 17 00:00:00 2001
|
||
|
|
From: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Sun, 3 Mar 2024 22:41:52 -0800
|
||
|
|
Subject: [PATCH] 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>
|
||
|
|
(cherry picked from commit 5a7f21efaf99c60614fe1967be1c0f9aa46c526e)
|
||
|
|
|
||
|
|
Signed-off-by: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
softmmu/vl.c | 4 ++++
|
||
|
|
1 file changed, 4 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
||
|
|
index e34c8a0646..9dcbc3b266 100644
|
||
|
|
--- a/softmmu/vl.c
|
||
|
|
+++ b/softmmu/vl.c
|
||
|
|
@@ -2474,6 +2474,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");
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|