> > > The reason that the fw_cfg device lives under ebus on sun4u is because the > > > ebus device is effectively a PCI-ISA bridge, and the fw_cfg port is mapped > > > into I/O address space along with other ISA devices. I'm not sure that > > > setting the parent to the machine is the right thing to do here. > > > > Thanks Philippe and Mark, IIUC, ebus doesn't have the hotplug use case, > > so it lives long enough like the sun4u/v machine, therefore replacing > > the parent object "ebus" with machine is safe. > > It's safe, but it still doesn't make sense for sun4u/v because there is no > machine-level I/O address space as per x86. It really does exist as a > separate legacy bus under a PCI bridge.
I tend to agree with Philippe's perspective - since it's per-Guest, setting the parent as machine seems appropriate. > That's correct, ebus does not support hotplug. > > > Adding a "parent" argument to the generic interface fw_cfg_init_io_nodma() > > doesn't seem necessary at the moment, since using the default machine as > > parent seems enough to meet all current needs in QEMU. > > > > What do you think? > > My preference would be add to add the parent argument as it's easy to do, > and doesn't attempt to enforce x86-type constraints on other architectures. I think it's not a x86-specific issue. The parent parameter's role is lifecycle management - if we allowed custom parents, we'd have to account for various complications that could result from early parent destruction, so it's not much easy IMO. Thanks, Zhao
