From: Doug Evans <dje@google.com>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [DISCUSSION] How to set properties of non-pluggable devices?
Date: Wed, 2 Dec 2020 10:52:11 -0800 [thread overview]
Message-ID: <CADPb22T6ML4hzOaa7Y1K8X-2vB6j-7=JJpYdtuDMwv+889fLpg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]
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?
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 ?
[-- Attachment #2: Type: text/html, Size: 2463 bytes --]
next reply other threads:[~2020-12-02 18:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 18:52 Doug Evans [this message]
2020-12-02 19:59 ` [DISCUSSION] How to set properties of non-pluggable devices? BALATON Zoltan via
2020-12-03 8:37 ` Gerd Hoffmann
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='CADPb22T6ML4hzOaa7Y1K8X-2vB6j-7=JJpYdtuDMwv+889fLpg@mail.gmail.com' \
--to=dje@google.com \
--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).