From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [Qemu-devel] [RFC PATCH 2/6] ram_blocks: Convert to a QLIST Date: Wed, 09 Jun 2010 14:55:29 -0600 Message-ID: <1276116929.3079.81.camel@x201> References: <20100608191447.4451.47795.stgit@localhost.localdomain> <20100608191535.4451.48702.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws, chrisw@redhat.com, kvm@vger.kernel.org, quintela@redhat.com To: Cam Macdonell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40197 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932112Ab0FIUzh (ORCPT ); Wed, 9 Jun 2010 16:55:37 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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