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:
David Gibson
2020-12-15 14:27:57 +11:00
parent 87c5823c4b
commit 32b40f5fe4
13 changed files with 87 additions and 68 deletions

View File

@@ -9,6 +9,7 @@ import (
"fmt"
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types"
)
// Endpoint represents a physical or virtual network interface.
@@ -17,11 +18,11 @@ type Endpoint interface {
Name() string
HardwareAddr() string
Type() EndpointType
PciAddr() string
PciPath() vcTypes.PciPath
NetworkPair() *NetworkInterfacePair
SetProperties(NetworkInfo)
SetPciAddr(string)
SetPciPath(vcTypes.PciPath)
Attach(*Sandbox) error
Detach(netNsCreated bool, netNsPath string) error
HotAttach(h hypervisor) error