John Snow <js...@redhat.com> writes:

> On 04/18/2017 07:57 AM, Gerd Hoffmann wrote:
>>   Hi,
>> 
>>>> Just like -device is a general way to plug in devices, replacing
>>>> multiple special ways (-net, -drive, -usb, ...), we could use a general
>>>> way to configure onboard devices.
>>>
>>> I looked at the -device implementation to see if the bus= parameter
>>> could be used to specify onboard device addresses, but I think you may
>>> be right that we need a separate command-line argument for onboard
>>> devices.
>> 
>> I think so.
>> 
>> There is -global, which is actually used by libvirt to configure
>> built-in floppy devices.  But as the name suggests it sets properties
>> globally, i.e. for all instances.  Which works in this specific use
>> case, as there can be only one floppy controller per machine, but I
>
> Spec-wise, Can't you have two?

You can, but approximately nobody wants to.

>> don't think this is something we want build on.
>> 
>> There is -set, but that works only for devices created via -device,
>> because it operates on QemuOpts, and we don't have QemuOpts for built-in
>> devices.

Yes.  QAPIfying the command line wouldn't change that.

>> We probably want something like
>>   -qom-set-property {objpath|alias}.prop=value

Makes sense to me.

We should be able to desugar -net, ... to -qom-set-property then.
However, the desugaring would be machine-specific in general.  Machines
would need to provide data or code to guide the desugaring, replacing
their code that rummages through global configuration such as
nd_table[].  Sounds like an improvement to me.

Reply via email to