qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	David Hildenbrand <david@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Eduardo Habkost <eduardo@habkost.net>,
	Philippe Mathieu-Daude <philmd@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC V1 04/14] accel: set accelerator and machine props earlier
Date: Wed, 23 Oct 2024 16:29:07 -0400	[thread overview]
Message-ID: <faf6e836-d441-4817-a520-9e747a5eb8be@oracle.com> (raw)
In-Reply-To: <ZxZw5xnN4cY7j680@x1n>

On 10/21/2024 11:19 AM, Peter Xu wrote:
> On Thu, Oct 17, 2024 at 08:14:05AM -0700, Steve Sistare wrote:
>> Make all global and compat properties available before the first objects
>> are created.  Set accelerator compatibility properties in
>> configure_accelerators, when the accelerator is chosen, and call
>> configure_accelerators earlier.  Set machine options earlier.
>>
>> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
>> ---
>>   accel/accel-system.c |  2 --
>>   system/vl.c          | 34 ++++++++++++++++++----------------
>>   2 files changed, 18 insertions(+), 18 deletions(-)
>>
>> diff --git a/accel/accel-system.c b/accel/accel-system.c
>> index f6c947d..c8aeae4 100644
>> --- a/accel/accel-system.c
>> +++ b/accel/accel-system.c
>> @@ -41,8 +41,6 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
>>           ms->accelerator = NULL;
>>           *(acc->allowed) = false;
>>           object_unref(OBJECT(accel));
>> -    } else {
>> -        object_set_accelerator_compat_props(acc->compat_props);
>>       }
>>       return ret;
>>   }
>> diff --git a/system/vl.c b/system/vl.c
>> index b94a6b9..bca2292 100644
>> --- a/system/vl.c
>> +++ b/system/vl.c
>> @@ -2346,6 +2346,7 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp)
>>           goto bad;
>>       }
>>   
>> +    object_set_accelerator_compat_props(ac->compat_props);
> 
> This is the probe/preinit iterator, might be good to keep it simple to only
> make the decision of choosing one accel, then move this line over to
> configure_accelerators() at the end.

It's actually simpler to leave it here.  Hoisting object_set_accelerator_compat_props
would require extra code to derive the ac parameter.

- Steve

>>       acs->accel = accel;
>>       return 1;
>>   
>> @@ -3728,29 +3729,14 @@ void qemu_init(int argc, char **argv)
>>       parse_memory_options();
>>   
>>       qemu_create_machine(machine_opts_dict);
>> -
>> -    suspend_mux_open();
>> -
>> -    qemu_disable_default_devices();
>> -    qemu_setup_display();
>> -    qemu_create_default_devices();
>> -    qemu_create_early_backends();
>> -
>>       qemu_apply_legacy_machine_options(machine_opts_dict);
>>       qemu_apply_machine_options(machine_opts_dict);
>>       qobject_unref(machine_opts_dict);
>> -    phase_advance(PHASE_MACHINE_CREATED);
>>   
>> -    /*
>> -     * Note: uses machine properties such as kernel-irqchip, must run
>> -     * after qemu_apply_machine_options.
>> -     */
>>       accel = configure_accelerators(argv[0]);
>> -    create_accelerator(accel);
>> -    phase_advance(PHASE_ACCEL_CREATED);
>>   
>>       /*
>> -     * Beware, QOM objects created before this point miss global and
>> +     * QOM objects created after this point see all global and
>>        * compat properties.
>>        *
>>        * Global properties get set up by qdev_prop_register_global(),
>> @@ -3765,6 +3751,22 @@ void qemu_init(int argc, char **argv)
>>        * called from do_configure_accelerator().
>>        */
>>   
>> +    suspend_mux_open();
>> +
>> +    qemu_disable_default_devices();
>> +    qemu_setup_display();
>> +    qemu_create_default_devices();
>> +    qemu_create_early_backends();
>> +
>> +    phase_advance(PHASE_MACHINE_CREATED);
>> +
>> +    /*
>> +     * Note: uses machine properties such as kernel-irqchip, must run
>> +     * after qemu_apply_machine_options.
>> +     */
>> +    create_accelerator(accel);
>> +    phase_advance(PHASE_ACCEL_CREATED);
>> +
>>       machine_class = MACHINE_GET_CLASS(current_machine);
>>       if (!qtest_enabled() && machine_class->deprecation_reason) {
>>           warn_report("Machine type '%s' is deprecated: %s",
>> -- 
>> 1.8.3.1
>>
> 



  reply	other threads:[~2024-10-23 20:30 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 15:14 [RFC V1 00/14] precreate phase Steve Sistare
2024-10-17 15:14 ` [RFC V1 01/14] accel: encapsulate search state Steve Sistare
2024-10-21 20:03   ` Fabiano Rosas
2024-10-17 15:14 ` [RFC V1 02/14] accel: accel preinit function Steve Sistare
2024-10-17 15:26   ` Steven Sistare
2024-10-21 14:54   ` Peter Xu
2024-10-23 16:13     ` Steven Sistare
2024-10-23 15:53   ` Paolo Bonzini
2024-10-23 16:25     ` Steven Sistare
2024-10-17 15:14 ` [RFC V1 03/14] accel: split configure_accelerators Steve Sistare
2024-10-17 15:14 ` [RFC V1 04/14] accel: set accelerator and machine props earlier Steve Sistare
2024-10-18 15:08   ` Fabiano Rosas
2024-10-18 15:32     ` Steven Sistare
2024-10-18 15:40       ` Steven Sistare
2024-10-18 19:15         ` Steven Sistare
2024-10-21 16:20           ` Peter Xu
2024-10-23 17:16             ` Paolo Bonzini
2024-10-22  8:30           ` David Hildenbrand
2024-10-23 20:28             ` Steven Sistare
2024-10-21 15:19   ` Peter Xu
2024-10-23 20:29     ` Steven Sistare [this message]
2024-10-23 16:00   ` Paolo Bonzini
2024-10-23 17:18     ` Paolo Bonzini
2024-10-23 20:29     ` Steven Sistare
2024-10-17 15:14 ` [RFC V1 05/14] migration: init and listen during precreate Steve Sistare
2024-10-21 16:41   ` Peter Xu
2024-10-21 21:05   ` Fabiano Rosas
2024-10-23 16:01     ` Steven Sistare
2024-10-17 15:14 ` [RFC V1 06/14] vl: precreate phase Steve Sistare
2024-10-23 14:03   ` Fabiano Rosas
2024-10-17 15:14 ` [RFC V1 07/14] monitor: chardev name Steve Sistare
2024-10-17 15:14 ` [RFC V1 08/14] qom: get properties Steve Sistare
2024-10-17 15:14 ` [RFC V1 09/14] qemu-option: filtered foreach Steve Sistare
2024-10-17 15:14 ` [RFC V1 10/14] qemu-options: pass object to filter Steve Sistare
2024-10-17 15:14 ` [RFC V1 11/14] monitor: connect in precreate Steve Sistare
2024-10-21 19:28   ` Peter Xu
2024-10-23 17:34     ` Steven Sistare
2024-10-23 16:05   ` Paolo Bonzini
2024-10-23 17:35     ` Steven Sistare
2024-10-17 15:14 ` [RFC V1 12/14] qtest: " Steve Sistare
2024-10-17 15:14 ` [RFC V1 13/14] net: cleanup for precreate phase Steve Sistare
2024-10-17 15:27   ` Steven Sistare
2024-10-21 19:20   ` Peter Xu
2024-10-23 17:43     ` Steven Sistare
2024-10-17 15:14 ` [RFC V1 14/14] migration: allow commands during precreate and preconfig Steve Sistare
2024-10-21 19:36   ` Peter Xu
2024-10-23 17:50     ` Steven Sistare
2024-10-17 15:19 ` [RFC V1 00/14] precreate phase Steven Sistare
2024-10-17 15:53   ` Peter Xu
2024-10-21 15:56     ` Steven Sistare
2024-10-23 16:31 ` Paolo Bonzini
2024-10-24 21:16   ` Steven Sistare
2024-10-25  8:46     ` Daniel P. Berrangé
2024-10-25 13:33       ` Steven Sistare
2024-10-25 13:43         ` Daniel P. Berrangé
2024-10-25 14:32           ` Steven Sistare
2024-10-25 14:49             ` Daniel P. Berrangé
2024-10-28 21:56           ` Peter Xu
2024-10-29  9:09             ` Daniel P. Berrangé
2024-10-29 11:13           ` Daniel P. Berrangé
2024-10-29 13:20             ` Fabiano Rosas
2024-10-29 15:18               ` Peter Xu
2024-10-29 15:58               ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faf6e836-d441-4817-a520-9e747a5eb8be@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=david@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farosas@suse.de \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).