mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev)
|
||||||
|
{
|
||||||
|
return virHostdevIsVFIODevice(hostdev) ||
|
||||||
|
virHostdevIsMdevDevice(hostdev);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
qemuHostdevHostSupportsPassthroughVFIO(void)
|
qemuHostdevHostSupportsPassthroughVFIO(void)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "qemu_conf.h"
|
#include "qemu_conf.h"
|
||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
|
|
||||||
|
bool qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev);
|
||||||
|
|
||||||
bool qemuHostdevHostSupportsPassthroughVFIO(void);
|
bool qemuHostdevHostSupportsPassthroughVFIO(void);
|
||||||
|
|
||||||
int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver,
|
int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver,
|
||||||
|
Loading…
Reference in New Issue
Block a user