1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

vfio: fix group not being set as attached

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2022-12-02 12:04:18 +01:00 committed by Steffen Vogel
parent b135a4c027
commit bd1a7d7538
2 changed files with 4 additions and 3 deletions

View file

@ -46,8 +46,6 @@ Container::Container() :
groups(),
log(logging.get("kernel:vfio::Container"))
{
spdlog::set_level(spdlog::level::debug);
static constexpr const char* requiredKernelModules[] = {
"vfio", "vfio_pci", "vfio_iommu_type1"
};
@ -127,6 +125,9 @@ void Container::attachGroup(std::shared_ptr<Group> group)
log->error("Failed to set IOMMU type of container: {}", ret);
throw RuntimeError("Failed to set IOMMU type of container");
}
group->setAttachedToContainer();
if (!group->checkStatus())
throw RuntimeError("bad VFIO group status for group {}.", group->getIndex());
else

View file

@ -83,7 +83,7 @@ bool Group::checkStatus()
{
int ret;
if (!attachedToContainer) {
log->debug("Group {} is not attached to a container", index);
log->error("Group {} is not attached to a container", index);
return false;
}