From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 06/18] lib{xc, xl}: Seed grant tables with xenstore and console grants Date: Thu, 12 Jan 2012 16:12:10 +0000 Message-ID: <1326384730.17210.251.camel@zakaz.uk.xensource.com> References: <1326302490-19428-1-git-send-email-dgdegra@tycho.nsa.gov> <1326302490-19428-7-git-send-email-dgdegra@tycho.nsa.gov> <1326362398.17210.227.camel@zakaz.uk.xensource.com> <4F0EF816.6030206@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F0EF816.6030206@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel De Graaf Cc: Alex Zeffertt , "xen-devel@lists.xensource.com" , Diego Ongaro List-Id: xen-devel@lists.xenproject.org On Thu, 2012-01-12 at 15:11 +0000, Daniel De Graaf wrote: > On 01/12/2012 04:59 AM, Ian Campbell wrote: > > On Wed, 2012-01-11 at 17:21 +0000, Daniel De Graaf wrote: > >> From: Alex Zeffertt > >> > >> This patch claims one reserved grant entry for the console and another > >> for the xenstore. It modifies the builder to fill in the grant table > >> entries for the console and the xenstore. > >> > >> This has not been tested with any kind of migration. > >> > > [...] > >> diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c > >> index 3fda6f8..23619da 100644 > >> --- a/tools/libxc/xc_domain_restore.c > >> +++ b/tools/libxc/xc_domain_restore.c > >> @@ -2018,6 +2018,15 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, > >> memcpy(ctx->live_p2m, ctx->p2m, dinfo->p2m_size * sizeof(xen_pfn_t)); > >> munmap(ctx->live_p2m, P2M_FL_ENTRIES * PAGE_SIZE); > >> > >> +/* TODO don't hardcode zero here */ > >> + rc = xc_dom_gnttab_seed(xch, dom, > >> + *console_mfn, *store_mfn, 0, 0); > > > > Presumably this TODO is the source of the comment in the changelog WRT > > migration. > > > > Does it Just Work or is there a legitimate TODO item here? > > > > Ian. > > > > > > This causes migration to only work if xenstored/xenconsoled are both in > dom0, as the domain ID for both of them are hardcoded to zero. Determining > the correct values for these domain IDs is more difficult than the domain > build case, because they may not be the same as when the domain was built > (especially if we are migrating). > > The previous patch series used a domid file named similarly to a pid file > to identify the location of xenstored and xenconsoled; this method would > allow the TODO to be resolved. I think a better solution is to refer to the > xenstore/xenconsole domains by name instead of domid, and set the names in > a configuration file (/etc/xen/xl.conf?). This would also replace the > xenstore_dom/console_dom parameters in patch #5. That would work. You could also stash the necessary parameters in xenstore from the tool which starts the stub-xenstored such that the toolstack can look them up as needed. That avoids having to have an xl.conf variable. Ian.