conf: qemu: Taint VMs using custom device tree blob

Using a custom device tree image may cause unexpected behavior in
architectures that use this approach to detect platform devices. Since
usually the device tree is generated by qemu and thus it's not normally
used let's taint VMs using it to make it obvious as a possible source of
problems.
This commit is contained in:
Peter Krempa 2015-06-26 10:59:33 +02:00
parent 91081979dd
commit 4b48ba4af5
3 changed files with 6 additions and 1 deletions

View File

@ -102,7 +102,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
"external-launch",
"host-cpu",
"hook-script",
"cdrom-passthrough");
"cdrom-passthrough",
"custom-dtb");
VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
"qemu",

View File

@ -2305,6 +2305,7 @@ typedef enum {
VIR_DOMAIN_TAINT_HOST_CPU, /* Host CPU passthrough in use */
VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */
VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */
VIR_DOMAIN_TAINT_CUSTOM_DTB, /* Custom device tree blob was specifed */
VIR_DOMAIN_TAINT_LAST
} virDomainTaintFlags;

View File

@ -2117,6 +2117,9 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver,
for (i = 0; i < obj->def->nnets; i++)
qemuDomainObjCheckNetTaint(driver, obj, obj->def->nets[i], logFD);
if (obj->def->os.dtb)
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_DTB, logFD);
virObjectUnref(cfg);
}