From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wen Congyang Subject: Re: [RFC PATCH COLO v5 07/29] support to resume uncooperative HVM guests Date: Thu, 23 Apr 2015 20:09:38 +0800 Message-ID: <5538E102.60209@cn.fujitsu.com> References: <1427870525-18686-1-git-send-email-yanghy@cn.fujitsu.com> <1427870525-18686-8-git-send-email-yanghy@cn.fujitsu.com> <20150408181249.GV30811@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150408181249.GV30811@zion.uk.xensource.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: Wei Liu , Yang Hongyang Cc: ian.campbell@citrix.com, ian.jackson@eu.citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On 04/09/2015 02:12 AM, Wei Liu wrote: > 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. No, just use xc_domain_resume_hvm() to replace ERROR()... Thanks Wen Congyang > > 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 > . >