On Wed, May 23, 2012 at 01:44:45PM +0100, Peter Maydell wrote: > 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... > So you do it usual way. Have "struct Machine" and put pointer to fw_cfg there. Current code already saves global pointer to fw_cfg, the patch just makes it official.
-- Gleb.