[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v15 11/14] x86/domctl: Use hvm_save_vcpu_handler


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Date: Fri, 3 Aug 2018 16:53:48 +0300
  • Cc: wei.liu2@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, ian.jackson@xxxxxxxxxxxxx, paul.durrant@xxxxxxxxxx, jbeulich@xxxxxxxx, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Fri, 03 Aug 2018 13:54:30 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=Wk7/7UKPjW9w19eaEWdpXprKAxEOSk5ArRVorff0uIcGOxYKMZuSb/np+aEihtxmw/DNZCvCcvG52WSDi4GT/AVtULJeS4LBscpe3W5cdU3azEX8mMgqFo6D62KqSVO2AicsS/11kHSCt8BAWIf2HkYe/mX6kbHtF0nWTyjtcYbZ469JIxKT/wJSgB4tqzj22ORZYt/HgKyY1NuHJQ+Yto7UwXXwd1gMRgX8Bn6mXMAASYQg/uw11mbYNg+5wkHraW6pExkB0kg1bN0EqwbVpmh0O+NRTgOLUorzk3pi/MiyRHkrLSjQH8L6PAfErji7zahegB7NcQv6syG+0dIW3Q==; h=Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References;
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This patch is aimed on using the new save_one fuctions in the hvm_save

Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>

---
Changes since V14:
        - Removed the modification from the hvm_save_one
        - Removed vcpu init
        - Declared rc as int
        - Add vcpu id to the log print.
---
 xen/arch/x86/hvm/save.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 1106b96..61565fe 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -196,7 +196,10 @@ int hvm_save(struct domain *d, hvm_domain_context_t *h)
     struct hvm_save_header hdr;
     struct hvm_save_end end;
     hvm_save_handler handler;
+    hvm_save_vcpu_handler save_one_handler;
     unsigned int i;
+    int rc;
+    struct vcpu *v;
 
     if ( d->is_dying )
         return -EINVAL;
@@ -224,11 +227,32 @@ int hvm_save(struct domain *d, hvm_domain_context_t *h)
     for ( i = 0; i <= HVM_SAVE_CODE_MAX; i++ )
     {
         handler = hvm_sr_handlers[i].save;
-        if ( handler != NULL )
+        save_one_handler = hvm_sr_handlers[i].save_one;
+        if ( save_one_handler != NULL )
+        {
+            for_each_vcpu ( d, v )
+            {
+                printk(XENLOG_G_INFO "HVM %pv save: %s\n",
+                       v, hvm_sr_handlers[i].name);
+                rc = save_one_handler(v, h);
+
+                if( rc != 0 )
+                {
+                    printk(XENLOG_G_ERR
+                           "HVM %pv save: failed to save type %"PRIu16"\n",
+                           v, i);
+                    return -EFAULT;
+                }
+            }
+        }
+        else if ( handler != NULL )
         {
             printk(XENLOG_G_INFO "HVM%d save: %s\n",
                    d->domain_id, hvm_sr_handlers[i].name);
-            if ( handler(d, h) != 0 )
+
+            rc = handler(d, h);
+
+            if( rc != 0 )
             {
                 printk(XENLOG_G_ERR
                        "HVM%d save: failed to save type %"PRIu16"\n",
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.