mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu_hostdev: Introduce qemuHostdevNeedsVFIO()
There are two types of host devices that require /dev/vfio/vfio access: 1) PCI devices with VFIO backend 2) Mediated devices Introduce a simple helper that returns true if passed @hostdev falls in either of the categories. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
0dfc7c6059
commit
f988128cc1
@ -118,6 +118,15 @@ qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev)
|
||||
{
|
||||
return virHostdevIsVFIODevice(hostdev) ||
|
||||
virHostdevIsMdevDevice(hostdev);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuHostdevHostSupportsPassthroughVFIO(void)
|
||||
{
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "qemu_conf.h"
|
||||
#include "domain_conf.h"
|
||||
|
||||
bool qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev);
|
||||
|
||||
bool qemuHostdevHostSupportsPassthroughVFIO(void);
|
||||
|
||||
int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver,
|
||||
|
Loading…
Reference in New Issue
Block a user