mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 12:29:49 +00:00
runtime/network: Use PciPath type through network handling
The "PCI address" returned by Endpoint::PciPath() isn't actually a PCI
address (DDDD:BB:DD.F), but rather a PCI path. Rename and use the
PciPath type to clean this up and the various parts of the network
code connected to it.
Forward port of
3e589713cf
fixes #1040
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
|
||||
vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types"
|
||||
)
|
||||
|
||||
// IPVlanEndpoint represents a ipvlan endpoint that is bridged to the VM
|
||||
@@ -17,7 +18,7 @@ type IPVlanEndpoint struct {
|
||||
NetPair NetworkInterfacePair
|
||||
EndpointProperties NetworkInfo
|
||||
EndpointType EndpointType
|
||||
PCIAddr string
|
||||
PCIPath vcTypes.PciPath
|
||||
RxRateLimiter bool
|
||||
TxRateLimiter bool
|
||||
}
|
||||
@@ -72,14 +73,14 @@ func (endpoint *IPVlanEndpoint) SetProperties(properties NetworkInfo) {
|
||||
endpoint.EndpointProperties = properties
|
||||
}
|
||||
|
||||
// PciAddr returns the PCI address of the endpoint.
|
||||
func (endpoint *IPVlanEndpoint) PciAddr() string {
|
||||
return endpoint.PCIAddr
|
||||
// PciPath returns the PCI path of the endpoint.
|
||||
func (endpoint *IPVlanEndpoint) PciPath() vcTypes.PciPath {
|
||||
return endpoint.PCIPath
|
||||
}
|
||||
|
||||
// SetPciAddr sets the PCI address of the endpoint.
|
||||
func (endpoint *IPVlanEndpoint) SetPciAddr(pciAddr string) {
|
||||
endpoint.PCIAddr = pciAddr
|
||||
// SetPciPath sets the PCI path of the endpoint.
|
||||
func (endpoint *IPVlanEndpoint) SetPciPath(pciPath vcTypes.PciPath) {
|
||||
endpoint.PCIPath = pciPath
|
||||
}
|
||||
|
||||
// NetworkPair returns the network pair of the endpoint.
|
||||
|
Reference in New Issue
Block a user