提交 f988128c 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 0dfc7c60
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册