From: Vitaly Kuznetsov Subject: Re: [PATCH v10 06/11] xen: Introduce XEN_DOMCTL_soft_reset Date: Wed, 12 Aug 2015 11:19:35 +0200 Message-ID: <87r3n8q2xk.fsf@vitty.brq.redhat.com> References: <1438090096-8297-1-git-send-email-vkuznets@redhat.com> <1438090096-8297-7-git-send-email-vkuznets@redhat.com> <20150811195709.GB7765@l.oracle.com> <55CB22D10200007800099F96@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZPSCF-0005oi-OY for xen-devel@lists.xenproject.org; Wed, 12 Aug 2015 09:19:43 +0000 In-Reply-To: <55CB22D10200007800099F96@prv-mh.provo.novell.com> (Jan Beulich's message of "Wed, 12 Aug 2015 02:41:21 -0600") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Olaf Hering , Julien Grall , Wei Liu , Ian Campbell , Andrew Cooper , Stefano Stabellini , Ian Jackson , Andrew Jones , Tim Deegan , David Vrabel , xen-devel@lists.xenproject.org, Daniel De Graaf , Keir Fraser List-Id: xen-devel@lists.xenproject.org "Jan Beulich" writes: >>>> On 11.08.15 at 21:57, wrote: >> On Tue, Jul 28, 2015 at 03:28:11PM +0200, Vitaly Kuznetsov wrote: >>> @@ -1038,6 +1045,32 @@ void domain_unpause_except_self(struct domain *d) >>> domain_unpause(d); >>> } >>> >>> +int domain_soft_reset(struct domain *d) >>> +{ >>> + struct vcpu *v; >>> + int rc; >>> + >>> + spin_lock(&d->shutdown_lock); >>> + for_each_vcpu ( d, v ) >>> + if ( !v->paused_for_shutdown ) >>> + { >>> + spin_unlock(&d->shutdown_lock); >>> + return -EINVAL; >>> + } >>> + spin_unlock(&d->shutdown_lock); >>> + >>> + rc = evtchn_reset(d); >> >> You do ignore the 'rc' value? In which case why not just >> do: >> >> (void)evtchn_reset(d); >> >> Unless you want to return the 'rc' ? > > It clearly needs to be returned. Yes, as evtchn_reset() doesn't break somewhere in the middle (it can only return -EINVAL is !d->controller_pause_count in this case) I think we're OK with a simple if ( rc ) return rc; here, no domain destroy which we introduce with arch-specific hooks is required (we haven't done anything to the domain yet). Jan, does you Acked-by: stand with such change? -- Vitaly