From patchwork Tue Aug 22 09:49:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 9914627 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 C53B3603FF for ; Tue, 22 Aug 2017 09:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D686C28856 for ; Tue, 22 Aug 2017 09:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA8D628860; Tue, 22 Aug 2017 09:51:38 +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 61A4128862 for ; Tue, 22 Aug 2017 09:51:38 +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 1dk5p0-00067j-CX; Tue, 22 Aug 2017 09:50: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 1dk5oz-0005vu-0Z for xen-devel@lists.xenproject.org; Tue, 22 Aug 2017 09:50:05 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id E2/92-02177-C4EFB995; Tue, 22 Aug 2017 09:50:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHRDpK73v9m RBrcPqVl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmLPq9lKpglVXH/w0fmBsbvIl2MnBwSAv4S K1q2MIPYbAI6Ehfn7mTrYuTgEBFQkbi916CLkYuDWWANo8T5OX/YQeLCAi4S7XPTQcpZBFQlV p9eCdbKK2Al8f7BQiaIkXoSbye+YASxOYHih/c+AbOFBCwlNn78yQpRLyhxcuYTFhCbWUBTon X7b3YIW16ieetsZoh6RYn+eQ/YJjDyzULSMgtJyywkLQsYmVcxahSnFpWlFukaG+glFWWmZ5T kJmbm6BoaGOvlphYXJ6an5iQmFesl5+duYgSGWj0DA+MOxs4TfocYJTmYlER5J3+fHSnEl5Sf UpmRWJwRX1Sak1p8iFGGg0NJgpftL1BOsCg1PbUiLTMHGPQwaQkOHiUR3sd/gNK8xQWJucWZ6 RCpU4yKUuK8P0ASAiCJjNI8uDZYpF1ilJUS5mVkYGAQ4ilILcrNLEGVf8UozsGoJMz7AmQKT2 ZeCdz0V0CLmYAWG7ZOA1lckoiQkmpgDBCZxx80cfvjaUasNd8buT4ea3boCz/cyH5k1bbE+XP vfj9uETXdPlSvfwvHXNv9Tr81XqpdNNOcX/b9ZkeOtAA7l3TJ8Wenm6UuyK859qO3eNXebfu+ TOmembTuY5OezvbG+RPnsqhYqEfM2+F84Kuzqddsse0fUoQWyKz+/dr4IJuvO8u6x0osxRmJh lrMRcWJAE93OVuvAgAA X-Env-Sender: prvs=400f1e73e=roger.pau@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1503395402!111036246!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 62485 invoked from network); 22 Aug 2017 09:50:03 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 22 Aug 2017 09:50:03 -0000 X-IronPort-AV: E=Sophos;i="5.41,411,1498521600"; d="scan'208";a="436366308" From: Roger Pau Monne To: Date: Tue, 22 Aug 2017 10:49:12 +0100 Message-ID: <20170822094920.70151-12-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170822094920.70151-1-roger.pau@citrix.com> References: <20170822094920.70151-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Wei Liu , boris.ostrovsky@oracle.com, Roger Pau Monne , Ian Jackson Subject: [Xen-devel] [PATCH 11/19] libxl: add PVH support to domain save/suspend 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 And remove the device model "none" support. Signed-off-by: Roger Pau Monné --- Cc: Ian Jackson Cc: Wei Liu --- tools/libxl/libxl_dom_save.c | 9 ++++++--- tools/libxl/libxl_dom_suspend.c | 8 +++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/libxl/libxl_dom_save.c b/tools/libxl/libxl_dom_save.c index 77fe30e9c0..194bbdbc5d 100644 --- a/tools/libxl/libxl_dom_save.c +++ b/tools/libxl/libxl_dom_save.c @@ -158,6 +158,11 @@ void libxl__domain_suspend_common_switch_qemu_logdirty /* Convenience aliases. */ libxl__logdirty_switch *const lds = &dss->logdirty; + if (dss->type == LIBXL_DOMAIN_TYPE_PVH) { + domain_suspend_switch_qemu_logdirty_done(egc, lds, 0); + return; + } + lds->callback = domain_suspend_switch_qemu_logdirty_done; libxl__domain_common_switch_qemu_logdirty(egc, domid, enable, lds); } @@ -176,9 +181,6 @@ void libxl__domain_common_switch_qemu_logdirty(libxl__egc *egc, case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: domain_suspend_switch_qemu_xen_logdirty(egc, domid, enable, lds); break; - case LIBXL_DEVICE_MODEL_VERSION_NONE: - lds->callback(egc, lds, 0); - break; default: LOGD(ERROR, domid, "logdirty switch failed" ", no valid device model version found, abandoning suspend"); @@ -363,6 +365,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss) if (rc) goto out; switch (type) { + case LIBXL_DOMAIN_TYPE_PVH: case LIBXL_DOMAIN_TYPE_HVM: { dss->hvm = 1; break; diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c index 6314a001d1..ca41107412 100644 --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -90,8 +90,6 @@ int libxl__domain_suspend_device_model(libxl__gc *gc, if (ret) unlink(filename); break; - case LIBXL_DEVICE_MODEL_VERSION_NONE: - break; default: return ERROR_INVAL; } @@ -148,14 +146,14 @@ static void domain_suspend_callback_common(libxl__egc *egc, /* Convenience aliases */ const uint32_t domid = dsps->domid; - if (dsps->type == LIBXL_DOMAIN_TYPE_HVM) { + if (dsps->type != LIBXL_DOMAIN_TYPE_PV) { xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv); xc_hvm_param_get(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state); } if ((hvm_s_state == 0) && (dsps->guest_evtchn.port >= 0)) { LOGD(DEBUG, domid, "issuing %s suspend request via event channel", - dsps->type == LIBXL_DOMAIN_TYPE_HVM ? "PVHVM" : "PV"); + dsps->type != LIBXL_DOMAIN_TYPE_PV ? "PVH/HVM" : "PV"); ret = xenevtchn_notify(CTX->xce, dsps->guest_evtchn.port); if (ret < 0) { LOGD(ERROR, domid, "xenevtchn_notify failed ret=%d", ret); @@ -190,7 +188,7 @@ static void domain_suspend_callback_common(libxl__egc *egc, } LOGD(DEBUG, domid, "issuing %s suspend request via XenBus control node", - dsps->type == LIBXL_DOMAIN_TYPE_HVM ? "PVHVM" : "PV"); + dsps->type != LIBXL_DOMAIN_TYPE_PV ? "PVH/HVM" : "PV"); libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, "suspend");