[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 5/6] Taint domains configured with cpu mode=host-passthrough



---
 src/conf/domain_conf.c |    3 ++-
 src/conf/domain_conf.h |    1 +
 src/qemu/qemu_domain.c |    3 +++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ae007b1..dce2f5a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -75,7 +75,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
               "high-privileges",
               "shell-scripts",
               "disk-probing",
-              "external-launch");
+              "external-launch",
+              "host-cpu");
 
 VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
               "qemu",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cd882bb..eba277b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1513,6 +1513,7 @@ enum virDomainTaintFlags {
     VIR_DOMAIN_TAINT_SHELL_SCRIPTS,    /* Network configuration using opaque shell scripts */
     VIR_DOMAIN_TAINT_DISK_PROBING,     /* Relying on potentially unsafe disk format probing */
     VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH,  /* Externally launched guest domain */
+    VIR_DOMAIN_TAINT_HOST_CPU,         /* Host CPU passthrough in use */
 
     VIR_DOMAIN_TAINT_LAST
 };
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0bbc276..0b76bed 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1143,6 +1143,9 @@ void qemuDomainObjCheckTaint(struct qemud_driver *driver,
             qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_ARGV, logFD);
     }
 
+    if (obj->def->cpu && obj->def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
+        qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HOST_CPU, logFD);
+
     for (i = 0 ; i < obj->def->ndisks ; i++)
         qemuDomainObjCheckDiskTaint(driver, obj, obj->def->disks[i], logFD);
 
-- 
1.7.8.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]