[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/16] vl: move icount configuration earlier
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH 04/16] vl: move icount configuration earlier |
Date: |
Thu, 14 Nov 2019 12:24:48 +0400 |
On Wed, Nov 13, 2019 at 6:43 PM Paolo Bonzini <address@hidden> wrote:
>
> Once qemu_tcg_configure is turned into a QOM property setter, it will not
> be able to set a default value for mttcg_enabled. Setting the default will
> move to the TCG init_machine method, which currently runs after "-icount"
> is processed.
>
> However, it is harmless to do configure_icount for all accelerators; we will
> just fail later if a non-TCG accelerator being selected. So do that.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> vl.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index fc9e70f..dbc99d7 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2829,11 +2829,7 @@ static void user_register_global_props(void)
>
> static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp)
> {
> - if (tcg_enabled()) {
> - configure_icount(opts, errp);
> - } else {
> - error_setg(errp, "-icount is not allowed with hardware
> virtualization");
> - }
> + configure_icount(opts, errp);
> return 0;
> }
>
> @@ -2854,6 +2850,9 @@ static void configure_accelerators(const char *progname)
> bool init_failed = false;
> AccelClass *acc = NULL;
>
> + qemu_opts_foreach(qemu_find_opts("icount"),
> + do_configure_icount, NULL, &error_fatal);
> +
> accel = qemu_opt_get(qemu_get_machine_opts(), "accel");
> if (accel == NULL) {
> /* Select the default accelerator */
> @@ -2901,11 +2900,13 @@ static void configure_accelerators(const char
> *progname)
> error_report("Back to %s accelerator", acc->name);
> }
>
> - qemu_opts_foreach(qemu_find_opts("icount"),
> - do_configure_icount, NULL, &error_fatal);
> -
> qemu_opts_foreach(qemu_find_opts("accel"),
> do_configure_accelerator, NULL, &error_fatal);
> +
> + if (!tcg_enabled() && use_icount) {
> + error_report("-icount is not allowed with hardware virtualization");
> + exit(1);
> + }
> }
>
> int main(int argc, char **argv, char **envp)
> --
> 1.8.3.1
>
>
>
--
Marc-André Lureau
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, (continued)
Re: [PATCH 01/16] memory: do not look at current_machine->accel, Thomas Huth, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Thomas Huth, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Peter Maydell, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Peter Maydell, 2019/11/14
- Re: [PATCH 01/16] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/11/14
[PATCH 04/16] vl: move icount configuration earlier, Paolo Bonzini, 2019/11/13
[PATCH 03/16] vl: merge -accel processing into configure_accelerators, Paolo Bonzini, 2019/11/13
[PATCH 05/16] vl: introduce object_parse_property_opt, Paolo Bonzini, 2019/11/13
[PATCH 06/16] vl: configure accelerators from -accel options, Paolo Bonzini, 2019/11/13