From patchwork Mon Nov 28 13:53:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9449559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C0406071E for ; Mon, 28 Nov 2016 13:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E48E725D9E for ; Mon, 28 Nov 2016 13:56:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9474277D9; Mon, 28 Nov 2016 13:56:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D93D825D9E for ; Mon, 28 Nov 2016 13:56:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBMNi-0006ZP-Hw; Mon, 28 Nov 2016 13:54:06 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBMNh-0006ZJ-PU for xen-devel@lists.xen.org; Mon, 28 Nov 2016 13:54:05 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id D1/A7-31715-CF63C385; Mon, 28 Nov 2016 13:54:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsVyuP0uq+4fM5s Ig8WT5CyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oym9qNMBfO5K3p2X2BrYGzk7GLk4hASWMIo cezuXPYuRk4ONgF7ia4/R5lAbBEBaYlrny8zghQxC7QzSny4t40VJCEsECoxc/9sMJtFQFVi7 vv1YM28AuYSRxdtBotLCMhLLDx/hAkiLihxcuYTli5GDqBB6hLr5wmBhJmBSpq3zmaewMg9C0 nVLISqWUiqFjAyr2LUKE4tKkst0jUy1EsqykzPKMlNzMzRNTQw1stNLS5OTE/NSUwq1kvOz93 ECAySegYGxh2MPXv9DjFKcjApifKGaNlECPEl5adUZiQWZ8QXleakFh9ilOHgUJLgPWAKlBMs Sk1PrUjLzAGGK0xagoNHSYT3MEiat7ggMbc4Mx0idYpRUUqcdypIQgAkkVGaB9cGi5FLjLJSw ryMDAwMQjwFqUW5mSWo8q8YxTkYlYR5V4NM4cnMK4Gb/gpoMRPQ4revrUEWlyQipKQaGOOTFL ieu4u4/0tm82c8embqkvtvZ5oo3UmfV7fn9v2mRLdFZZWXbTbFC2hs/+RwlP1CRHiXYIfB6v+ 3v78L1tT9qvh1YeCSA70NFn62UWtdrYV3c3oZamSsfFi9+Ylxg6FlnuOdaOEXUq11161zl+c/ Wz55x+Y5805xR+kXrD52M1Auv62NVYmlOCPRUIu5qDgRAE+RPT+MAgAA X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1480341244!17821321!1 X-Originating-IP: [195.135.221.5] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48317 invoked from network); 28 Nov 2016 13:54:04 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-9.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Nov 2016 13:54:04 -0000 Received: from laptop.vms (mhy71-2-88-167-63-197.fbx.proxad.net [88.167.63.197]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 28 Nov 2016 14:54:03 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Mon, 28 Nov 2016 14:53:57 +0100 Message-Id: <20161128135357.5543-1-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Subject: [Xen-devel] [PATCH] libxl: invert xc and domain model resume calls in xc_domain_resume() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Resume is sometimes silently failing for HVM guests. Getting the xc_domain_resume() and libxl__domain_resume_device_model() in the reverse order than what is in the suspend code fixes the problem. Signed-off-by: Cédric Bosdonnat --- tools/libxl/libxl_dom_suspend.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c index 0648919..3e29c01 100644 --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -456,12 +456,6 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel) { int rc = 0; - if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) { - LOGE(ERROR, "xc_domain_resume failed for domain %u", domid); - rc = ERROR_FAIL; - goto out; - } - libxl_domain_type type = libxl__domain_type(gc, domid); if (type == LIBXL_DOMAIN_TYPE_INVALID) { rc = ERROR_FAIL; @@ -477,6 +471,12 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel) } } + if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) { + LOGE(ERROR, "xc_domain_resume failed for domain %u", domid); + rc = ERROR_FAIL; + goto out; + } + if (!xs_resume_domain(CTX->xsh, domid)) { LOGE(ERROR, "xs_resume_domain failed for domain %u", domid); rc = ERROR_FAIL;