From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8p13-000750-Cu for qemu-devel@nongnu.org; Mon, 12 Aug 2013 06:06:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8p0x-0004uJ-6J for qemu-devel@nongnu.org; Mon, 12 Aug 2013 06:06:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8p0w-0004uD-RU for qemu-devel@nongnu.org; Mon, 12 Aug 2013 06:06:15 -0400 Date: Mon, 12 Aug 2013 13:07:48 +0300 From: "Michael S. Tsirkin" Message-ID: <20130812100748.GA30400@redhat.com> References: <1376295742-28528-1-git-send-email-mst@redhat.com> <1376295742-28528-3-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH for-1.6 2/2] loader: put FW CFG ROM files into RAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: pbonzini@redhat.com, Anthony Liguori , Laszlo Ersek , qemu-devel@nongnu.org, Gerd Hoffmann On Mon, Aug 12, 2013 at 10:32:40AM +0100, Peter Maydell wrote: > On 12 August 2013 09:49, Michael S. Tsirkin wrote: > > +static void *rom_set_mr(Rom *rom, Object *owner, const char *name) > > +{ > > + /* > > + * Migration code expects that all RAM blocks are full target pages. > > + * Round MR size up to make this work. > > + */ > > + unsigned size = ROUND_UP(rom->datasize, qemu_target_page_size); > > + void *data = g_malloc0(size); > > If we don't really care where the data lives (ie we are just > allocating a block for it here) it would be better to get the > memory subsystem to do the allocation, because then the information > about the constraints on the size of the region would be confined > to the memory system. OK but that looks like a bigger patch. I'm looking for a small fix that we can make for 1.6. APIs are easy to tweak migration on-wire format is set in stone on release. OK > > + data = data; > > Huh? > > -- PMM I'll drop this in v2 but let's figure out what's acceptable. -- MST