From: Wei Liu Subject: Re: [RFC PATCH COLO v5 07/29] support to resume uncooperative HVM guests Date: Wed, 8 Apr 2015 19:12:49 +0100 Message-ID: <20150408181249.GV30811@zion.uk.xensource.com> References: <1427870525-18686-1-git-send-email-yanghy@cn.fujitsu.com> <1427870525-18686-8-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1427870525-18686-8-git-send-email-yanghy@cn.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Yang Hongyang Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, eddie.dong@intel.com, yunhong.jiang@intel.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On Wed, Apr 01, 2015 at 02:41:43PM +0800, Yang Hongyang wrote: > From: Wen Congyang > > For PVHVM, the hypercall return code is 0, and it can be resumed > in a new domain context. > > For HVM, do nothing. > > Signed-off-by: Wen Congyang > --- > tools/libxc/xc_resume.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c > index e67bebd..b862ce3 100644 > --- a/tools/libxc/xc_resume.c > +++ b/tools/libxc/xc_resume.c > @@ -109,6 +109,21 @@ static int xc_domain_resume_cooperative(xc_interface *xch, uint32_t domid) > return do_domctl(xch, &domctl); > } > > +static int xc_domain_resume_hvm(xc_interface *xch, uint32_t domid) > +{ > + DECLARE_DOMCTL; > + > + /* > + * If it is PVHVM, the hypercall return code is 0, and resume > + * it in a new domain context. > + * > + * If it is a HVM, do nothing. > + */ > + domctl.cmd = XEN_DOMCTL_resumedomain; > + domctl.domain = domid; > + return do_domctl(xch, &domctl); > +} > + > static int xc_domain_resume_any(xc_interface *xch, uint32_t domid) > { > DECLARE_DOMCTL; > @@ -138,10 +153,7 @@ static int xc_domain_resume_any(xc_interface *xch, uint32_t domid) > */ > #if defined(__i386__) || defined(__x86_64__) > if ( info.hvm ) > - { > - ERROR("Cannot resume uncooperative HVM guests"); > - return rc; > - } > + return xc_domain_resume_hvm(xch, domid); > You're going to skip the rest of the function. I don't think this is right. Wei. > if ( xc_domain_get_guest_width(xch, domid, &dinfo->guest_width) != 0 ) > { > -- > 1.9.1 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel