]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
tools: set grant limits for xenstore stubdom
authorJuergen Gross <jgross@suse.com>
Thu, 28 Sep 2017 09:06:57 +0000 (11:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Sep 2017 09:06:57 +0000 (11:06 +0200)
When creating a Xenstore stubdom set the grant limits: the stubdom
will need to setup a very limited amount of grants only, so 4 grant
frames are enough. For being able to support up to 32768 domains it
will need 128 maptrack frames (1 mapping per domain, 256 maptrack
entries per maptrack frame).

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/helpers/init-xenstore-domain.c

index 8a41ee7d3a0b1003736cdc9526d4ccfe2fea5620..047ad0cb1df3941582a3f4b9dac632991d8c1596 100644 (file)
@@ -105,6 +105,17 @@ static int build(xc_interface *xch)
         fprintf(stderr, "xc_domain_setmaxmem failed\n");
         goto err;
     }
+    /*
+     * 1 grant frame is enough: we don't need many grants.
+     * Mini-OS doesn't like less than 4, though, so use 4.
+     * 128 maptrack frames: 256 entries per frame, enough for 32768 domains.
+     */
+    rv = xc_domain_set_gnttab_limits(xch, domid, 4, 128);
+    if ( rv )
+    {
+        fprintf(stderr, "xc_domain_set_gnttab_limits failed\n");
+        goto err;
+    }
     rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
     if ( rv )
     {