From: Eduardo Habkost <ehabkost@redhat.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Peter Krempa" <pkrempa@redhat.com>,
libvir-list@redhat.com,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel@nongnu.org,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Claudio Fontana" <cfontana@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH for-6.0] accel: Wire accel to /machine
Date: Mon, 7 Dec 2020 12:38:49 -0500 [thread overview]
Message-ID: <20201207173849.GC1289986@habkost.net> (raw)
In-Reply-To: <20201207084621.23876-1-r.bolshakov@yadro.com>
On Mon, Dec 07, 2020 at 11:46:22AM +0300, Roman Bolshakov wrote:
> There's no generic way to query current accel and its properties via QOM
> because there's no link between an accel and current machine.
>
> The change adds the link, i.e. if HVF is enabled the following will be
> available in QOM:
>
> (qemu) qom-get /machine/accel type
> "hvf-accel"
>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>
> Hi,
>
> this is a follow up patch that deprecates earlier series [1].
>
Is there a reference to the reasoning for dropping the earlier
approach? Your previous approach seems preferable.
> An outstanding issue is whether management applications can rely on the
> value of /machine/accel/type and output of qom-list-types command [2][3]
> to get current and present accels?
>
> i.e. would it be ok if libvirt assumes that everything up to the first
> dash in the accel type is the name of the accel (as specified via -M
> accel=ACCEL flag) when it performs QEMU probing?
There are two big assumption libvirt would need to make:
1) That /machine/accel is a stable path that will never change;
2) That the accel name => QOM type naming rules will never change.
Item #1 is unlikely to change, but having the freedom to change
#2 would be useful for future refactoring (like the idea
mentioned at [4]).
The main issue, however, is having those assumptions not being
documented anywhere. A documented QMP interface is better than a
undocumented `qom-get`-based interface.
* * *
This patch is still a good idea, though. Even if it is just for
debugging or for having clearer object ownership rules, having
the accel object as part of the QOM tree is useful. So this has
my:
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
but we need a commit message that doesn't make people think the
`qom-get` command above will always work.
>
> Also, Eduardo and Claudio earlier had ideas to provide cpu-specific
> accel subclasses [4][5].
>
> 1. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg03944.html
> 2. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg04212.html
> 3. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg07062.html
> 4. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg06513.html
> 5. https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg06741.html
>
> Thanks,
> Roman
>
> accel/accel.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/accel/accel.c b/accel/accel.c
> index cb555e3b06..45c5bf87b1 100644
> --- a/accel/accel.c
> +++ b/accel/accel.c
> @@ -56,10 +56,11 @@ int accel_init_machine(AccelState *accel, MachineState *ms)
> if (ret < 0) {
> ms->accelerator = NULL;
> *(acc->allowed) = false;
> - object_unref(OBJECT(accel));
> } else {
> object_set_accelerator_compat_props(acc->compat_props);
> + object_property_add_child(OBJECT(ms), "accel", OBJECT(accel));
> }
> + object_unref(OBJECT(accel));
> return ret;
> }
>
> --
> 2.29.2
>
--
Eduardo
next prev parent reply other threads:[~2020-12-07 17:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 8:46 [PATCH for-6.0] accel: Wire accel to /machine Roman Bolshakov
2020-12-07 17:38 ` Eduardo Habkost [this message]
2020-12-07 17:50 ` Peter Krempa
2020-12-08 8:13 ` Roman Bolshakov
2020-12-08 8:19 ` Peter Krempa
2020-12-08 8:11 ` Roman Bolshakov
2020-12-07 17:44 ` Daniel P. Berrangé
2020-12-08 7:40 ` Roman Bolshakov
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=20201207173849.GC1289986@habkost.net \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=cfontana@suse.de \
--cc=dgilbert@redhat.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.