Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
bridge: Store the bridge address to state
Browse files Browse the repository at this point in the history
We need to store the bridge address to state to use it
for assigning addresses to devices attached to teh bridge.
So we need to make sure that the bridge pointer is assigned
the address.

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed May 3, 2018
1 parent 718dbd2 commit 85865f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions virtcontainers/qemu_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (q *qemuAmd64) appendBridges(devices []govmmQemu.Device, bridges []Bridge)
t = govmmQemu.PCIEBridge
}

b.Addr = bridgePCIStartAddr + idx
bridges[idx].Addr = bridgePCIStartAddr + idx

devices = append(devices,
govmmQemu.BridgeDevice{
Expand All @@ -215,7 +215,7 @@ func (q *qemuAmd64) appendBridges(devices []govmmQemu.Device, bridges []Bridge)
// Each bridge is required to be assigned a unique chassis id > 0
Chassis: (idx + 1),
SHPC: true,
Addr: strconv.FormatInt(int64(b.Addr), 10),
Addr: strconv.FormatInt(int64(bridges[idx].Addr), 10),
},
)
}
Expand Down
4 changes: 2 additions & 2 deletions virtcontainers/qemu_arch_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (q *qemuArchBase) appendBridges(devices []govmmQemu.Device, bridges []Bridg
t = govmmQemu.PCIEBridge
}

b.Addr = bridgePCIStartAddr + idx
bridges[idx].Addr = bridgePCIStartAddr + idx

devices = append(devices,
govmmQemu.BridgeDevice{
Expand All @@ -338,7 +338,7 @@ func (q *qemuArchBase) appendBridges(devices []govmmQemu.Device, bridges []Bridg
// Each bridge is required to be assigned a unique chassis id > 0
Chassis: (idx + 1),
SHPC: true,
Addr: strconv.FormatInt(int64(b.Addr), 10),
Addr: strconv.FormatInt(int64(bridges[idx].Addr), 10),
},
)
}
Expand Down

0 comments on commit 85865f1

Please sign in to comment.