All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-6.0] accel: Wire accel to /machine
@ 2020-12-07  8:46 Roman Bolshakov
  2020-12-07 17:38 ` Eduardo Habkost
  2020-12-07 17:44 ` Daniel P. Berrangé
  0 siblings, 2 replies; 8+ messages in thread
From: Roman Bolshakov @ 2020-12-07  8:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Krempa, Eduardo Habkost, libvir-list,
	Philippe Mathieu-Daudé,
	Richard Henderson, Dr. David Alan Gilbert, Markus Armbruster,
	Roman Bolshakov, Claudio Fontana, Paolo Bonzini

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].

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?

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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-08  8:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  8:46 [PATCH for-6.0] accel: Wire accel to /machine Roman Bolshakov
2020-12-07 17:38 ` Eduardo Habkost
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

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.