From: BALATON Zoltan via <qemu-devel@nongnu.org>
To: Doug Evans <dje@google.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [DISCUSSION] How to set properties of non-pluggable devices?
Date: Wed, 2 Dec 2020 20:59:32 +0100 (CET) [thread overview]
Message-ID: <bd66adf6-32d8-6fb-5cb2-4ab8d8869d1b@eik.bme.hu> (raw)
In-Reply-To: <CADPb22T6ML4hzOaa7Y1K8X-2vB6j-7=JJpYdtuDMwv+889fLpg@mail.gmail.com>
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 ?
>
next prev parent reply other threads:[~2020-12-02 20:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 18:52 [DISCUSSION] How to set properties of non-pluggable devices? Doug Evans
2020-12-02 19:59 ` BALATON Zoltan via [this message]
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=bd66adf6-32d8-6fb-5cb2-4ab8d8869d1b@eik.bme.hu \
--to=qemu-devel@nongnu.org \
--cc=balaton@eik.bme.hu \
--cc=dje@google.com \
/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).