From: Tim Deegan Subject: Re: [PATCH 05/14] Nested Virtualization: core Date: Mon, 9 Aug 2010 13:38:48 +0100 Message-ID: <20100809123848.GY13291@whitby.uk.xensource.com> References: <201008051701.36033.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: <201008051701.36033.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi, > +int > +nestedhvm_vcpu_destroy(struct vcpu *v) > +{ > + int ret = 0; > + > + if (!nestedhvm_enabled(v->domain)) > + return 0; > + > + if (nestedhvm_vcpu_in_guestmode(v)) { > + nestedhvm_vcpu_exit_guestmode(v); > + ret = -EBUSY; > + } This still bothers me, since we go on to complete the teardown anyway, and this function's only caller does nothing interesting with the result. > + /* Enable interrupts or the guest won't see any interrupts > + * after nested guest exited. > + */ > + nestedsvm_vcpu_stgi(v); > + > + hvm_nestedhvm_vcpu_destroy(v); While I'm complaining about unchecked return values, I should point out that your implementation of this returns an integer (which in turn is always 0). > + return ret; > +} Cheers, Tim. -- Tim Deegan Principal Software Engineer, XenServer Engineering Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)