提交 2cb86fc2 编写于 作者: P Peter Krempa

qemu: Implement support for 'capability_filters' config option

Filter out the given capabilities and set domain taint if we've done so.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 30ce8f31
......@@ -8339,7 +8339,8 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver,
custom_hypervisor_feat = true;
}
if (custom_hypervisor_feat) {
if (custom_hypervisor_feat ||
(cfg->capabilityfilters && *cfg->capabilityfilters)) {
qemuDomainObjTaint(driver, obj,
VIR_DOMAIN_TAINT_CUSTOM_HYPERVISOR_FEATURE, logCtxt);
}
......
......@@ -5452,10 +5452,25 @@ static int
qemuProcessStartUpdateCustomCaps(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(priv->driver);
qemuDomainXmlNsDefPtr nsdef = vm->def->namespaceData;
char **next;
int tmp;
size_t i;
if (cfg->capabilityfilters) {
for (next = cfg->capabilityfilters; *next; next++) {
if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid capability_filters capability '%s'"),
*next);
return -1;
}
virQEMUCapsClear(priv->qemuCaps, tmp);
}
}
if (nsdef) {
for (i = 0; i < nsdef->ncapsadd; i++) {
if ((tmp = virQEMUCapsTypeFromString(nsdef->capsadd[i])) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册