network: Fix network hotplug for ipvlan and macvlan endpoints.

Since moving from network coldplug to hotplug, the only case verified
was veth endpoints. Support for network hotplug for ipvlan and macvlan was
broken/not added. Fix it.

Fixes: #8391

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
(cherry picked from commit a6272733e7)
This commit is contained in:
Archana Shinde 2023-11-07 00:49:21 -08:00
parent 220a2a0300
commit 97845c93d8

View File

@ -1884,9 +1884,8 @@ func (q *qemu) hotplugNetDevice(ctx context.Context, endpoint Endpoint, op Opera
var tap TapInterface
switch endpoint.Type() {
case VethEndpointType:
drive := endpoint.(*VethEndpoint)
tap = drive.NetPair.TapInterface
case VethEndpointType, IPVlanEndpointType, MacvlanEndpointType, TuntapEndpointType:
tap = endpoint.NetworkPair().TapInterface
case TapEndpointType:
drive := endpoint.(*TapEndpoint)
tap = drive.TapInterface