From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 2/6] xen/hvm kexec: unregister shutdown+sysrq watches during reboot Date: Thu, 28 Jul 2011 21:50:29 +0200 Message-ID: <20110728195029.GA18283@aepfle.de> References: <20110728140710.GA28817@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" , Ian Campbell , Jan Beulich List-Id: xen-devel@lists.xenproject.org On Thu, Jul 28, Keir Fraser wrote: > On 28/07/2011 15:07, "Olaf Hering" wrote: > > > On Thu, Jul 28, Ian Campbell wrote: > > > >>> Are you suggesting that there have to be ways for a domU to query the > >>> state of its registered watches and shut them all down during very early > >>> boot? > >> > >> Perhaps the xenstore protocol could be enhanced with a mechanism to > >> clear all existing watches? A kernel could call that at start of day. > > > > I poked around in the xenstore sources, there is appearently nothing > > that can be used to shutdown all. Or would calling XS_RELEASE do the trick? > > XS_INTRODUCE Unfortunately do_introduce() is not preprared for that. On enter, conn->id contains the domain_id, so it errors out early. Later it compares domain->conn != conn and does not enter the correct path. If I remove both checks the kexec appears to work ok. Is it save to remove both checks? The only issue I havent figured out: How to get the domid from within the kernel? Olaf diff -r 42edf1481c57 tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -326,7 +326,7 @@ void do_introduce(struct connection *con return; } - if (conn->id != 0 || !conn->can_write) { + if (!conn->can_write) { send_error(conn, EACCES); return; } @@ -365,7 +365,7 @@ void do_introduce(struct connection *con talloc_steal(domain->conn, domain); fire_watches(NULL, "@introduceDomain", false); - } else if ((domain->mfn == mfn) && (domain->conn != conn)) { + } else if (domain->mfn == mfn) { /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port) xc_evtchn_unbind(xce_handle, domain->port);