From: Yang Hongyang Subject: [RFC PATCH COLO v5 07/29] support to resume uncooperative HVM guests Date: Wed, 1 Apr 2015 14:41:43 +0800 Message-ID: <1427870525-18686-8-git-send-email-yanghy@cn.fujitsu.com> References: <1427870525-18686-1-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427870525-18686-1-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: xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, ian.jackson@eu.citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, rshriram@cs.ubc.ca, yanghy@cn.fujitsu.com List-Id: xen-devel@lists.xenproject.org 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); if ( xc_domain_get_guest_width(xch, domid, &dinfo->guest_width) != 0 ) { -- 1.9.1