Alistair Francis <alistair.fran...@xilinx.com> writes: > On Wed, Apr 9, 2014 at 11:28 AM, Peter Crosthwaite > <peter.crosthwa...@xilinx.com> wrote: >> On Wed, Mar 26, 2014 at 10:47 AM, Alistair Francis >> <alistair.fran...@xilinx.com> wrote: >>> This patch introduces a new command line argument that allows >>> sysbus devices to be attached via the command line. >>> >>> This allows devices to be added after the machine init but >>> before anything is booted >>> >>> The new argument is -sysbusdev >>> >>> A new argument is being used to avoid confusion and user >>> errors that would appear if the same command for hot-plugging >>> was used instead. This could be changed to use -device and >>> specify sysbus by using something like 'bus=sysbus' if that >>> is preferred >>> >> >> Can you be more specific about the confusion issue you are seeing? If >> you went for -device bus=root (meaning the default singleton root >> sysbus), where are the possible issues? >> > > Using -device would be possible (and easy to implement). The reason I > started with > a different argument name was just to avoid confusion and to make sure > I didn't interfere with hot-pluggable devices. I still feel that separating > hot-pluggable devices from bus devices is a good idea. They are initialised > in slightly different parts of the code (although this wouldn't > be hard to fix). The name 'sysbusdev' is confusing though, as it doesn't > have to connect to the sysbus.
-device / device_add already covers both hot plug and cold plug. In fact, only device_add can hot plug; all -device ever does is cold plug. Plugging in a device involves wiring it up. Hot plug additionally involves communication with guest software, but let's ignore that for now. -device uses generic wiring code, guided by configuration: property "bus". This suffices for straightforward cases like PCI and USB devices. It doesn't for sysbus devices, because these may require arbitrarily complex wirings. Therefore, sysbus devices are unavailable with -device; see commit 837d371. What we need is a way for configuration to guide more general wiring. Perhaps -device can be extended. If that turns out to be impractical, we need something more expressive that also covers everything -device does now, and can cover "everything" eventually. Andreas may have ideas here. What we don't need, in my opinion, is more special-case options :) [...]