qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DISCUSSION] How to set properties of non-pluggable devices?


From: BALATON Zoltan
Subject: Re: [DISCUSSION] How to set properties of non-pluggable devices?
Date: Wed, 2 Dec 2020 20:59:32 +0100 (CET)

Hello,

On Wed, 2 Dec 2020, Doug Evans wrote:
Hi.

Suppose I want to set a property of a non-pluggable device that cannot be
set after the device has been realized (e.g., I can't use qmp to set the
property after QEMU has started).
Being non-pluggable means I can't use "-device foo,bar=baz" on the command
line.
[But I can use "-device foo,help" to list its properties :-)  (if I also
specify -M bar) ]

How do people do this?

I don't know but there's a -global option than may be what you need but I never know how to use it. You may be able to find examples in the doc dir or hopefully someone who knows it better will correct me.

Hope this helps or sorry if this is not the right answer.

Regards,
BALATON Zoltan

The device is part of a "machine" (board really), so I could add the
property to the machine to be passed on to the device when it's realized
(at least I think I can), but that doesn't feel right: The machine has lots
of devices -> it feels cleaner to associate the property with the device
and not the machine (lest the machine over time collect a myriad of random
properties to pass on to its devices). Things get a little complicated
because the machine can have multiple copies of a device: specifying the
device's name is insufficient.

The device has an object path: /machine/foo/bar/device[0]. There's also
/.../device[1].
IWBN to be able to do something along the lines of:
-device-property /device/path[,PROP1=VALUE1,...]
copying the syntax used for "-object".

It's perhaps even nicer if this could be accomplished with -device:
avoiding further confusion on what -device can and can't be used for (e.g.,
can I use -device-property to set a property that could also be set with
-device?).

If what I'm asking for is reasonable and isn't doable today (I'm certainly
willing to believe I'm missing something), I'm happy to work on the patch
(with some guidance as to what would be acceptable).

One thought that comes to mind is to use -object, store the properties
there, and have the machine collect them from there when realizing its
devices. Or is that an abuse of -object ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]