mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-23 17:24:18 +01:00
virtcontainers: support vhost and physical endpoints in AddInterface
Support to hotplug vhost and physical endpoints by AddInterface API Fixes #758 Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
This commit is contained in:
@@ -1105,10 +1105,11 @@ func (s *Sandbox) AddInterface(inf *grpc.Interface) (*grpc.Interface, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
endpoint, err := createVirtualNetworkEndpoint(len(s.networkNS.Endpoints), inf.Name, s.config.NetworkConfig.InterworkingModel)
|
||||
endpoint, err := createEndpoint(netInfo, len(s.networkNS.Endpoints), s.config.NetworkConfig.InterworkingModel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
endpoint.SetProperties(netInfo)
|
||||
if err := doNetNS(s.networkNS.NetNsPath, func(_ ns.NetNS) error {
|
||||
return endpoint.HotAttach(s.hypervisor)
|
||||
@@ -1123,7 +1124,7 @@ func (s *Sandbox) AddInterface(inf *grpc.Interface) (*grpc.Interface, error) {
|
||||
}
|
||||
|
||||
// Add network for vm
|
||||
inf.PciAddr = endpoint.PCIAddr
|
||||
inf.PciAddr = endpoint.PciAddr()
|
||||
return s.agent.updateInterface(inf)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user