mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactor
This commit is contained in:
parent
e73f536be1
commit
037e0f82be
1 changed files with 13 additions and 3 deletions
|
@ -55,9 +55,12 @@ void PlatformCard::connectVFIOtoIps(
|
|||
driver.attach(device);
|
||||
}
|
||||
|
||||
// VFIO Setup
|
||||
// VFIO Device Setup
|
||||
std::vector<std::pair<std::shared_ptr<ip::Core>,
|
||||
std::shared_ptr<kernel::vfio::Device>>>
|
||||
vfio_ip_pair;
|
||||
for (auto pair : device_ip_pair) {
|
||||
auto device = pair.second;
|
||||
auto [ip, device] = pair;
|
||||
|
||||
// Attach group to container
|
||||
const int iommu_group = device.iommu_group().value();
|
||||
|
@ -74,6 +77,14 @@ void PlatformCard::connectVFIOtoIps(
|
|||
// Add as member
|
||||
this->vfio_devices.push_back(vfio_device);
|
||||
|
||||
// Add return value
|
||||
vfio_ip_pair.push_back({ip, vfio_device});
|
||||
}
|
||||
|
||||
// Memory Graph
|
||||
for (auto pair : vfio_ip_pair) {
|
||||
auto [ip, vfio_device] = pair;
|
||||
|
||||
// Map vfio device memory to process
|
||||
const void *mapping = vfio_device->regionMap(0);
|
||||
if (mapping == MAP_FAILED) {
|
||||
|
@ -90,7 +101,6 @@ void PlatformCard::connectVFIOtoIps(
|
|||
"process to vfio", srcVertexId, targetVertexId);
|
||||
logger->debug("create edge from process to {}", vfio_device->getName());
|
||||
|
||||
auto ip = pair.first;
|
||||
// Connect vfio vertex to Reg vertex
|
||||
connect(vfio_device->getName(), ip);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue