From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47657 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMSJG-0008T0-C0 for qemu-devel@nongnu.org; Wed, 09 Jun 2010 16:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMSJF-0001cd-BA for qemu-devel@nongnu.org; Wed, 09 Jun 2010 16:55:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63502) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMSJF-0001cP-3w for qemu-devel@nongnu.org; Wed, 09 Jun 2010 16:55:37 -0400 Subject: Re: [Qemu-devel] [RFC PATCH 2/6] ram_blocks: Convert to a QLIST From: Alex Williamson In-Reply-To: References: <20100608191447.4451.47795.stgit@localhost.localdomain> <20100608191535.4451.48702.stgit@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Wed, 09 Jun 2010 14:55:29 -0600 Message-ID: <1276116929.3079.81.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cam Macdonell Cc: chrisw@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org On Wed, 2010-06-09 at 14:11 -0600, Cam Macdonell wrote: > On Tue, Jun 8, 2010 at 1:15 PM, Alex Williamson > > diff --git a/cpu-all.h b/cpu-all.h > > index 77eaf85..458cb4b 100644 > > --- a/cpu-all.h > > +++ b/cpu-all.h > > @@ -859,9 +859,21 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr); > > /* memory API */ > > > > extern int phys_ram_fd; > > -extern uint8_t *phys_ram_dirty; > > extern ram_addr_t ram_size; > > -extern ram_addr_t last_ram_offset; > > + > > +typedef struct RAMBlock { > > + uint8_t *host; > > + ram_addr_t offset; > > + ram_addr_t length; > > + QLIST_ENTRY(RAMBlock) next; > > +} RAMBlock; > > For my shared memory device I need a way to mark device memory as not > to be migrated. Can a flag to be added to this struct to accomplish > this? Yep, it should be easy to skip blocks during migration based on a flag here. I guess that probably means you'd also want a flag when you alloc the block, so maybe it should be: qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size, int flags) Best to make that change now, then we can add it to the RAMBlock as we need. Alex