[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/28] vl: rename local variable in configure_accelerators
From: |
Paolo Bonzini |
Subject: |
[PATCH 25/28] vl: rename local variable in configure_accelerators |
Date: |
Wed, 2 Dec 2020 04:03:02 -0500 |
Silly patch extracted from the next one, which is already big enough.
Because there are already local variables named "accel", we will name
the global vl.c variable for "-M accel" accelerators instead. Rename
it already in configure_accelerators to be ready.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
softmmu/vl.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index f083881f21..a942ce2004 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2251,17 +2251,17 @@ static int do_configure_accelerator(void *opaque,
QemuOpts *opts, Error **errp)
static void configure_accelerators(const char *progname)
{
- const char *accel;
+ const char *accelerators;
bool init_failed = false;
qemu_opts_foreach(qemu_find_opts("icount"),
do_configure_icount, NULL, &error_fatal);
- accel = qemu_opt_get(qemu_get_machine_opts(), "accel");
+ accelerators = qemu_opt_get(qemu_get_machine_opts(), "accel");
if (QTAILQ_EMPTY(&qemu_accel_opts.head)) {
char **accel_list, **tmp;
- if (accel == NULL) {
+ if (accelerators == NULL) {
/* Select the default accelerator */
bool have_tcg = accel_find("tcg");
bool have_kvm = accel_find("kvm");
@@ -2269,21 +2269,21 @@ static void configure_accelerators(const char *progname)
if (have_tcg && have_kvm) {
if (g_str_has_suffix(progname, "kvm")) {
/* If the program name ends with "kvm", we prefer KVM */
- accel = "kvm:tcg";
+ accelerators = "kvm:tcg";
} else {
- accel = "tcg:kvm";
+ accelerators = "tcg:kvm";
}
} else if (have_kvm) {
- accel = "kvm";
+ accelerators = "kvm";
} else if (have_tcg) {
- accel = "tcg";
+ accelerators = "tcg";
} else {
error_report("No accelerator selected and"
" no default accelerator available");
exit(1);
}
}
- accel_list = g_strsplit(accel, ":", 0);
+ accel_list = g_strsplit(accelerators, ":", 0);
for (tmp = accel_list; *tmp; tmp++) {
/*
@@ -2299,7 +2299,7 @@ static void configure_accelerators(const char *progname)
}
g_strfreev(accel_list);
} else {
- if (accel != NULL) {
+ if (accelerators != NULL) {
error_report("The -accel and \"-machine accel=\" options are
incompatible");
exit(1);
}
--
2.26.2
- [PATCH 04/28] qemu-option: move help handling to get_opt_name_value, (continued)
- [PATCH 04/28] qemu-option: move help handling to get_opt_name_value, Paolo Bonzini, 2020/12/02
- [PATCH 02/28] qemu-option: pass QemuOptsList to opts_accepts_any, Paolo Bonzini, 2020/12/02
- [PATCH 01/28] qemu-option: simplify search for end of key, Paolo Bonzini, 2020/12/02
- [PATCH 05/28] qemu-option: warn for short-form boolean options, Paolo Bonzini, 2020/12/02
- [PATCH 06/28] keyval: accept escaped commas in implied option, Paolo Bonzini, 2020/12/02
- [PATCH 11/28] qom: use qemu_printf to print help for user-creatable objects, Paolo Bonzini, 2020/12/02
- [PATCH 07/28] keyval: simplify keyval_parse_one, Paolo Bonzini, 2020/12/02
- [PATCH 08/28] tests: convert check-qom-proplist to keyval, Paolo Bonzini, 2020/12/02
- [PATCH 09/28] keyval: introduce keyval_parse_into, Paolo Bonzini, 2020/12/02
- [PATCH 19/28] qemu-io: use keyval for -object parsing, Paolo Bonzini, 2020/12/02
- [PATCH 25/28] vl: rename local variable in configure_accelerators,
Paolo Bonzini <=
- [PATCH 24/28] qom: export more functions for use with non-UserCreatable objects, Paolo Bonzini, 2020/12/02
- [PATCH 10/28] hmp: replace "O" parser with keyval, Paolo Bonzini, 2020/12/02
- [PATCH 14/28] qemu-config: add error propagation to qemu_config_parse, Paolo Bonzini, 2020/12/02
- [PATCH 13/28] remove -writeconfig, Paolo Bonzini, 2020/12/02
- [PATCH 18/28] qom: do not modify QDict argument in user_creatable_add_dict, Paolo Bonzini, 2020/12/02
- [PATCH 28/28] vl: switch -accel parsing to keyval, Paolo Bonzini, 2020/12/02
- [PATCH 27/28] qemu-option: remove now-dead code, Paolo Bonzini, 2020/12/02
- [PATCH 12/28] hmp: special case help options for object_add, Paolo Bonzini, 2020/12/02
- [PATCH 22/28] qemu: use keyval for -object parsing, Paolo Bonzini, 2020/12/02
- [PATCH 21/28] qemu-img: use keyval for -object parsing, Paolo Bonzini, 2020/12/02