diff --git a/common/lib/kernel/vfio_container.cpp b/common/lib/kernel/vfio_container.cpp index 224c92366..25ad9a143 100644 --- a/common/lib/kernel/vfio_container.cpp +++ b/common/lib/kernel/vfio_container.cpp @@ -203,9 +203,13 @@ std::shared_ptr Container::attachDevice(pci::Device &pdev) { try { pdev.rewriteBar(); } catch (std::exception &e) { + throw RuntimeError( - "BAR of device is in inconsistent state. Rewriting the BAR " - "failed. Please remove, rescan and reset the device and try again."); + e.what() + + std::string( + "\nBAR of device is in inconsistent state. Rewriting the BAR " + "failed. Please remove, rescan and reset the device and " + "try again.")); } // Get IOMMU group of device