From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXAz2-0002t4-HQ for qemu-devel@nongnu.org; Wed, 23 May 2012 08:48:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXAyw-0005Lt-AM for qemu-devel@nongnu.org; Wed, 23 May 2012 08:48:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXAyw-0005La-2A for qemu-devel@nongnu.org; Wed, 23 May 2012 08:48:02 -0400 Date: Wed, 23 May 2012 15:47:57 +0300 From: Gleb Natapov Message-ID: <20120523124757.GG10209@redhat.com> References: <1337504561-20297-1-git-send-email-gleb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 1/2] Make pointer to fw_cfg device global. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Wed, May 23, 2012 at 01:44:45PM +0100, Peter Maydell wrote: > On 20 May 2012 10:02, Gleb Natapov 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.