[libvirt] [PATCH v2 29/39] qemu: Mark NVMe disks as 'need VFIO'

Michal Privoznik mprivozn at redhat.com
Thu Sep 26 16:12:25 UTC 2019


There are couple of places where a domain with a VFIO device gets
special treatment: in CGroups when enabling/disabling access to
/dev/vfio/vfio, and when creating/removing nodes in domain mount
namespace. Well, a NVMe disk is a VFIO device too. Fortunately,
we have this qemuDomainNeedsVFIO() function which is the only
place that needs adjustment.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9409d8de8d..e4e9d4e361 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12840,7 +12840,8 @@ bool
 qemuDomainNeedsVFIO(const virDomainDef *def)
 {
     return virDomainDefHasVFIOHostdev(def) ||
-        virDomainDefHasMdevHostdev(def);
+        virDomainDefHasMdevHostdev(def) ||
+        virDomainDefHasNVMeDisk(def);
 }
 
 
-- 
2.21.0




More information about the libvir-list mailing list