From: Ian Campbell Subject: Re: [PATCH v4 5/7] tools, libxl: parse optional start gfn from the iomem config option Date: Tue, 25 Mar 2014 16:27:01 +0000 Message-ID: <1395764821.6294.56.camel@kazak.uk.xensource.com> References: <1395712976-19454-1-git-send-email-avanzini.arianna@gmail.com> <1395712976-19454-6-git-send-email-avanzini.arianna@gmail.com> <5331A344.9000801@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5331A344.9000801@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, tim@xen.org, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, JBeulich@suse.com, Arianna Avanzini , viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org On Tue, 2014-03-25 at 15:39 +0000, Julien Grall wrote: > > libxl_vga_interface_info = Struct("vga_interface_info", [ > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > > index 4fc46eb..99a0958 100644 > > --- a/tools/libxl/xl_cmdimpl.c > > +++ b/tools/libxl/xl_cmdimpl.c > > @@ -1208,13 +1208,20 @@ static void parse_config_data(const char *config_source, > > "xl: Unable to get element %d in iomem list\n", i); > > exit(1); > > } > > It's a bug on the current code. We have to init correctly iomem before > with libxl_iomem_range_init(&b_info->iomem); You need to do it for each element, so &b_info->iomem[i] > > + case 3: break; > > + case 2: > > + /* default to 1:1 mapping */ > > + b_info->iomem[i].gfn = b_info->iomem[i].start; > > + break; > > If the iomem_range is initialized with the default value. You can defer > this initialization in libxl. You will need to make sure that libxl__iomem_range_setdefaults will correctly set gfn to the 1:1 iff it is set to the sentinel value which means "default" (probably ~0?). And you will need to make sure that setdefaults is called when appropriate. Ian.