]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
Revert "tools/dombuilder: Prevent failures of xc_dom_gnttab_init()"
authorWei Liu <wei.liu2@citrix.com>
Fri, 3 Nov 2017 14:14:46 +0000 (14:14 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 3 Nov 2017 14:14:46 +0000 (14:14 +0000)
This reverts commit 9ff6dbfa7576cc1c5d6f9a3c59c69a8503e36f11, which
breaks hvm save/restore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/include/xc_dom.h
tools/libxc/xc_dom_boot.c
tools/libxc/xc_dom_core.c
tools/libxl/libxl_dom.c

index 5292424ff17e299de18f34a8ae244f0a84ff0584..a1c3de2fb962dc99f765248181d954a34bda8f25 100644 (file)
@@ -116,10 +116,6 @@ struct xc_dom_image {
     uint32_t console_domid;
     uint32_t xenstore_domid;
 
-    /* Grant limit configuration; mandatory if calling xc_dom_gnttab_init(). */
-    unsigned int max_grant_frames;
-    unsigned int max_maptrack_frames;
-
     /*
      * initrd parameters as specified in start_info page
      * Depending on capabilities of the booted kernel this may be a virtual
index 7c21feae27e8432f638c71877ad04346fd15e85c..75836bd8fe67ff8482428d5a3e3820441bc9fb9a 100644 (file)
@@ -420,22 +420,6 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, uint32_t domid,
 
 int xc_dom_gnttab_init(struct xc_dom_image *dom)
 {
-    int rc;
-
-    if ( dom->max_grant_frames == -1 || dom->max_maptrack_frames == -1 )
-    {
-        xc_dom_panic(dom->xch, XC_INVALID_PARAM,
-                     "%s: Caller didn't set grant limit information", __func__);
-        errno = EINVAL;
-
-        return -1;
-    }
-
-    if ( (rc = xc_domain_set_gnttab_limits(dom->xch, dom->guest_domid,
-                                           dom->max_grant_frames,
-                                           dom->max_maptrack_frames)) != 0 )
-        return rc;
-
     if ( xc_dom_translated(dom) ) {
         return xc_dom_gnttab_hvm_seed(dom->xch, dom->guest_domid,
                                       dom->console_gfn, dom->xenstore_gfn,
index d66065115471cde24018c486c061e68bfcad7749..7087c5098f088afdf0ce515db8992a2e320d1b9d 100644 (file)
@@ -784,9 +784,6 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     dom->console_domid = INVALID_DOMID;
     dom->xenstore_domid = INVALID_DOMID;
 
-    dom->max_grant_frames = -1;
-    dom->max_maptrack_frames = -1;
-
     dom->flags = SIF_VIRT_P2M_4TOOLS;
 
     dom->alloc_malloc += sizeof(*dom);
index fa5319db36ec5794ea5b8b55d6f69f34768f9868..fcdeef07adad80d9c66d76608b2934dc097d851a 100644 (file)
@@ -358,6 +358,12 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
         return ERROR_FAIL;
     }
 
+    if (xc_domain_set_gnttab_limits(ctx->xch, domid, info->max_grant_frames,
+                                    info->max_maptrack_frames) != 0) {
+        LOG(ERROR, "Couldn't set grant table limits");
+        return ERROR_FAIL;
+    }
+
     /*
      * Check if the domain has any CPU or node affinity already. If not, try
      * to build up the latter via automatic NUMA placement. In fact, in case
@@ -809,9 +815,6 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->xenstore_domid = state->store_domid;
     dom->claim_enabled = libxl_defbool_val(info->claim_mode);
 
-    dom->max_grant_frames    = info->max_grant_frames;
-    dom->max_maptrack_frames = info->max_maptrack_frames;
-
     if (info->num_vnuma_nodes != 0) {
         unsigned int i;
 
@@ -1148,9 +1151,6 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
 
-    dom->max_grant_frames    = info->max_grant_frames;
-    dom->max_maptrack_frames = info->max_maptrack_frames;
-
     /* The params from the configuration file are in Mb, which are then
      * multiplied by 1 Kb. This was then divided off when calling
      * the old xc_hvm_build_target_mem() which then turned them to bytes.