]> xenbits.xensource.com Git - xen.git/commitdiff
xen/gnttab: Log when grant_table_init() fails
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 19 Jan 2021 11:08:17 +0000 (11:08 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 19 Jan 2021 18:05:20 +0000 (18:05 +0000)
... so debug builds can see what went wrong, rather than getting an
unqualified -EINVAL out of domain creation.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/grant_table.c

index b24bce0f9fdecca59541d9c6e4fbe36626e0e528..f6f5acd300a25fbc0defa737fe2eef9e011c07ef 100644 (file)
@@ -1920,7 +1920,11 @@ int grant_table_init(struct domain *d, int max_grant_frames,
     if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES ||
          max_grant_frames > opt_max_grant_frames ||
          max_maptrack_frames > opt_max_maptrack_frames )
+    {
+        dprintk(XENLOG_INFO, "Bad grant table sizes: grant %u, maptrack %u\n",
+                max_grant_frames, max_maptrack_frames);
         return -EINVAL;
+    }
 
     if ( (gt = xzalloc(struct grant_table)) == NULL )
         return -ENOMEM;