aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-09-23 14:00:29 +0200
committerThomas Huth <thuth@redhat.com>2019-10-01 11:54:17 +0200
commit3d5e90a50bd4ffa199166e01a365f5c5995534ae (patch)
tree1227116108c843742480fe1e7a6d65ff5b881feb
parente423455c4f23a1a828901c78fe6d03b7dde79319 (diff)
downloadqemu-3d5e90a50bd4ffa199166e01a365f5c5995534ae.zip
qemu-3d5e90a50bd4ffa199166e01a365f5c5995534ae.tar.gz
qemu-3d5e90a50bd4ffa199166e01a365f5c5995534ae.tar.bz2
Disallow colons in the parameter of "-accel"
Everybody who used something like "-machine accel=kvm:tcg" in the past might be tempted to specify a similar list with the -accel parameter, too, for example "-accel kvm:tcg". However, this is not how this options is thought to be used, since each "-accel" should only take care of one specific accelerator. In the long run, we really should rework the "-accel" code completely, so that it does not set "-machine accel=..." anymore internally, but is completely independent from "-machine". For the short run, let's make sure that users cannot use "-accel xyz:tcg", so that we avoid that we have to deal with such cases in the wild later. Message-Id: <20190930123505.11607-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/cdrom-test.c2
-rw-r--r--vl.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c
index 05611da..34e9974 100644
--- a/tests/cdrom-test.c
+++ b/tests/cdrom-test.c
@@ -120,7 +120,7 @@ static void test_cdboot(gconstpointer data)
{
QTestState *qts;
- qts = qtest_initf("-accel kvm:tcg -no-shutdown %s%s", (const char *)data,
+ qts = qtest_initf("-M accel=kvm:tcg -no-shutdown %s%s", (const char *)data,
isoimage);
boot_sector_test(qts);
qtest_quit(qts);
diff --git a/vl.c b/vl.c
index 630f5c5..002bf49 100644
--- a/vl.c
+++ b/vl.c
@@ -3554,6 +3554,11 @@ int main(int argc, char **argv, char **envp)
g_slist_free(accel_list);
exit(0);
}
+ if (optarg && strchr(optarg, ':')) {
+ error_report("Don't use ':' with -accel, "
+ "use -M accel=... for now instead");
+ exit(1);
+ }
opts = qemu_opts_create(qemu_find_opts("machine"), NULL,
false, &error_abort);
qemu_opt_set(opts, "accel", optarg, &error_abort);