diff --git a/common/lib/kernel/vfio_container.cpp b/common/lib/kernel/vfio_container.cpp index 6131cc414..e0c36421b 100644 --- a/common/lib/kernel/vfio_container.cpp +++ b/common/lib/kernel/vfio_container.cpp @@ -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) 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 diff --git a/common/lib/kernel/vfio_group.cpp b/common/lib/kernel/vfio_group.cpp index 7f1240f9b..bac909768 100644 --- a/common/lib/kernel/vfio_group.cpp +++ b/common/lib/kernel/vfio_group.cpp @@ -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; }