From: Vitaly Kuznetsov Subject: [PATCH v6 06/10] libxc: support XENMEM_soft_reset operation Date: Wed, 13 May 2015 11:49:41 +0200 Message-ID: <1431510585-12544-7-git-send-email-vkuznets@redhat.com> References: <1431510585-12544-1-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YsTJD-0007V3-B6 for xen-devel@lists.xenproject.org; Wed, 13 May 2015 09:50:35 +0000 In-Reply-To: <1431510585-12544-1-git-send-email-vkuznets@redhat.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.xenproject.org Cc: Andrew Jones , Julien Grall , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , Wei Liu , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org Introduce xc_domain_memory_soft_reset() function supporting XENMEM_soft_reset. Signed-off-by: Vitaly Kuznetsov --- tools/libxc/include/xenctrl.h | 5 +++++ tools/libxc/xc_domain.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index a689caf..cb1bb15 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1381,6 +1381,11 @@ int xc_domain_claim_pages(xc_interface *xch, uint32_t domid, unsigned long nr_pages); +int xc_domain_memory_soft_reset(xc_interface *xch, + uint32_t source_domid, + uint32_t dest_domid, + uint64_t *nr_trans); + int xc_domain_memory_exchange_pages(xc_interface *xch, int domid, unsigned long nr_in_extents, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index a7079a1..be39987 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -976,6 +976,24 @@ int xc_domain_claim_pages(xc_interface *xch, return err; } +int xc_domain_memory_soft_reset(xc_interface *xch, + uint32_t source_domid, + uint32_t dest_domid, + uint64_t *nr_trans) +{ + int err; + struct xen_memory_soft_reset softr = { + .source_domid = source_domid, + .dest_domid = dest_domid, + .gmfn_start = 0, + .nr_transferred = 0 + }; + + err = do_memory_op(xch, XENMEM_soft_reset, &softr, sizeof(softr)); + *nr_trans = softr.nr_transferred; + return err; +} + int xc_domain_populate_physmap(xc_interface *xch, uint32_t domid, unsigned long nr_extents, -- 1.9.3