On 23 May 2012 15:41, Andreas Färber <afaer...@suse.de> wrote: > Am 23.05.2012 14:44, schrieb Peter Maydell: >> On 20 May 2012 10:02, Gleb Natapov <g...@redhat.com> wrote: >>> There can be only one fw_cfg device, so saving global reference to it >>> removes the need to pass its pointer around. >> >> This seems like a backwards step to me: one of the things that prevents >> us supporting "two separate machines in one emulation" is that we have >> various things that assume there's only one instance of themselves and >> use globals. I don't think we should be adding any more... > > While I concur with the design sentiment of avoiding globals where > possible, I can understand having multiple CPU types in one machine, but > multiple machines in one emulation? Do you have a specific example that > cannot easily be modeled as multiple socket-connected executables?
I mostly meant the "two different CPUs" case, but there's not a great deal of difference between them. You're just instantiating a set of QOM objects and wiring them up appropriately in either case: if you can support different CPUs then you can trivially support multiple machines, because that's just a special case of two separate CPUs which happen to not share any memory. We don't have any support for running QOM interface links over sockets anyway, so that seems like a red herring. -- PMM