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

[Xen-devel] [PATCH Remus v1 5/8] tools/libxc: defer the setting of HVM_PARAM_IDENT_PT



Set the hvm param HVM_PARAM_IDENT_PT second time will fail.
So defer the setting of HVM_PARAM_IDENT_PT.

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
---
 tools/libxc/xc_sr_common.h          |  3 +++
 tools/libxc/xc_sr_restore_x86_hvm.c | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h
index 6f099b8..f85eb41 100644
--- a/tools/libxc/xc_sr_common.h
+++ b/tools/libxc/xc_sr_common.h
@@ -280,6 +280,9 @@ struct xc_sr_context
                     void *context;
                     size_t contextsz;
 
+                    /* HVM_PARAM_IDENT_PT */
+                    xen_pfn_t ident_pt;
+
 #ifdef XG_LIBXL_HVM_COMPAT
                     uint32_t qlen;
                     void *qbuf;
diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c 
b/tools/libxc/xc_sr_restore_x86_hvm.c
index 6f5af0e..929bee8 100644
--- a/tools/libxc/xc_sr_restore_x86_hvm.c
+++ b/tools/libxc/xc_sr_restore_x86_hvm.c
@@ -76,6 +76,14 @@ static int handle_hvm_params(struct xc_sr_context *ctx,
             ctx->restore.xenstore_gfn = entry->value;
             xc_clear_domain_page(xch, ctx->domid, entry->value);
             break;
+        case HVM_PARAM_IDENT_PT:
+            /*
+             * With Remus, we need to buffer this param because this
+             * can not be set multiple times, we will set this param
+             * at x86_hvm_stream_complete()
+             */
+            ctx->x86_hvm.restore.ident_pt = entry->value;
+            continue;
         case HVM_PARAM_IOREQ_PFN:
         case HVM_PARAM_BUFIOREQ_PFN:
             xc_clear_domain_page(xch, ctx->domid, entry->value);
@@ -278,6 +286,14 @@ static int x86_hvm_stream_complete(struct xc_sr_context 
*ctx)
     xc_interface *xch = ctx->xch;
     int rc;
 
+    rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_IDENT_PT,
+                          ctx->x86_hvm.restore.ident_pt);
+    if ( rc )
+    {
+        PERROR("Failed to set HVM_PARAM_IDENT_PT");
+        return rc;
+    }
+
     rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_STORE_EVTCHN,
                           ctx->restore.xenstore_evtchn);
     if ( rc )
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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