/*
* Make adjustments to the CPUID settings for a domain.
*
+ * This path is used in two cases. First, for fresh boots of the domain, and
+ * secondly for migrate-in/restore of pre-4.14 guests (where CPUID data was
+ * missing from the stream). The @restore parameter distinguishes these
+ * cases, and the generated policy must be compatible with a 4.13.
+ *
* Either pass a full new @featureset (and @nr_features), or adjust individual
* features (@pae).
*
* Then (optionally) apply legacy XEND overrides (@xend) to the result.
*/
int xc_cpuid_apply_policy(xc_interface *xch,
- uint32_t domid,
+ uint32_t domid, bool restore,
const uint32_t *featureset,
unsigned int nr_features, bool pae,
const struct xc_xend_cpuid *xend);
return rc;
}
-int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
+int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
const uint32_t *featureset, unsigned int nr_features,
bool pae,
const struct xc_xend_cpuid *xend)
return 0;
}
-void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,
+void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
libxl_domain_build_info *info)
{
bool pae = true;
if (info->type == LIBXL_DOMAIN_TYPE_HVM)
pae = libxl_defbool_val(info->u.hvm.pae);
- xc_cpuid_apply_policy(ctx->xch, domid, NULL, 0, pae, info->cpuid);
+ xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0, pae, info->cpuid);
}
static const char *input_names[2] = { "leaf", "subleaf" };
* stream doesn't contain any CPUID data.
*/
if (missing & XGR_SDD_MISSING_CPUID)
- libxl__cpuid_legacy(ctx, dcs->guest_domid, info);
+ libxl__cpuid_legacy(ctx, dcs->guest_domid, true, info);
return 0;
}
* being migrated-in/restored have CPUID handled during the
* static_data_done() callback. */
if (!state->restore)
- libxl__cpuid_legacy(ctx, domid, info);
+ libxl__cpuid_legacy(ctx, domid, false, info);
return rc;
}
_hidden char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
libxl__gen_json_callback gen, void *p);
-_hidden void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,
+_hidden void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool retore,
libxl_domain_build_info *info);
/* Calls poll() again - useful to check whether a signaled condition
return 0;
}
-void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,
+void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
libxl_domain_build_info *info)
{
}