Skip to contentSkip to conversation

xen/gnttab: Log when grant_table_init() fails

PATCH In review Andrew Cooper 2 participants 2 messages Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/gnttab: Log when grant_table_init() fails

... so debug builds can see what went wrong, rather than getting an unqualified -EINVAL out domain creation.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>

---
 xen/common/grant_table.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/common/grant_table.c +4 -0
index b31d404579..cbdd6e2f4e 100644
@@ -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;
Signature · 1 line
2.11.0