mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
vfio: convert container from singleton to normal class
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
eb96afc2ec
commit
ece14d74fe
3 changed files with 10 additions and 10 deletions
|
@ -25,19 +25,11 @@ namespace kernel {
|
|||
namespace vfio {
|
||||
|
||||
class Container {
|
||||
private:
|
||||
// This is a singleton: There can only be one container to rule them all.
|
||||
public:
|
||||
Container();
|
||||
|
||||
public:
|
||||
// The Container instance is lazily initialized and correctly destroyed.
|
||||
static Container* getInstance()
|
||||
{
|
||||
static Container instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
// No copying allowed
|
||||
// No copying allowed because we manage the vfio state in constructor and destructors
|
||||
Container(Container const&) = delete;
|
||||
void operator=(Container const&) = delete;
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@ public:
|
|||
Device(const std::string &name, int groupFileDescriptor, const kernel::pci::Device *pci_device = nullptr);
|
||||
~Device();
|
||||
|
||||
// No copying allowed because we manage the vfio state in constructor and destructors
|
||||
Device(Device const&) = delete;
|
||||
void operator=(Device const&) = delete;
|
||||
|
||||
bool reset();
|
||||
|
||||
// Map a device memory region to the application address space (e.g. PCI BARs)
|
||||
|
|
|
@ -30,6 +30,10 @@ public:
|
|||
Group(int index, bool iommuEnabled);
|
||||
~Group();
|
||||
|
||||
// No copying allowed because we manage the vfio state in constructor and destructors
|
||||
Group(Group const&) = delete;
|
||||
void operator=(Group const&) = delete;
|
||||
|
||||
void setAttachedToContainer()
|
||||
{
|
||||
attachedToContainer = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue