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
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,
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);
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
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;
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.