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

@@ -7,6 +7,7 @@
package persistapi
import (
vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types"
"github.com/vishvananda/netlink"
)
@@ -48,7 +49,7 @@ type PhysicalEndpoint struct {
type MacvtapEndpoint struct {
// This is for showing information.
// Remove this field won't impact anything.
PCIAddr string
PCIPath vcTypes.PciPath
}
type TapEndpoint struct {
@@ -75,7 +76,7 @@ type VhostUserEndpoint struct {
// This is for showing information.
// Remove these fields won't impact anything.
IfaceName string
PCIAddr string
PCIPath vcTypes.PciPath
}
// NetworkEndpoint contains network interface information