hypervisor: Minimal exports of generic hypervisor internal fields

Export commonly used hypervisor fields and utility functions.
These need to be exposed to allow the hypervisor to be consumed
externally.

Note: This does not change the hypervisor interface definition.
Those changes will be separate commits.

Signed-off-by: Manohar Castelino <mcastelino@apple.com>
This commit is contained in:
Manohar Castelino
2021-09-20 08:27:23 -07:00
committed by Eric Ernst
parent 03877f3479
commit 6baf2586ee
21 changed files with 216 additions and 216 deletions

View File

@@ -82,7 +82,7 @@ func (endpoint *TuntapEndpoint) Attach(ctx context.Context, s *Sandbox) error {
return err
}
return h.addDevice(ctx, endpoint, netDev)
return h.addDevice(ctx, endpoint, NetDev)
}
// Detach for the tun/tap endpoint tears down the tap
@@ -112,7 +112,7 @@ func (endpoint *TuntapEndpoint) HotAttach(ctx context.Context, h hypervisor) err
return err
}
if _, err := h.hotplugAddDevice(ctx, endpoint, netDev); err != nil {
if _, err := h.hotplugAddDevice(ctx, endpoint, NetDev); err != nil {
networkLogger().WithError(err).Error("Error attach tun/tap ep")
return err
}
@@ -132,7 +132,7 @@ func (endpoint *TuntapEndpoint) HotDetach(ctx context.Context, h hypervisor, net
networkLogger().WithError(err).Warn("Error un-bridging tun/tap ep")
}
if _, err := h.hotplugRemoveDevice(ctx, endpoint, netDev); err != nil {
if _, err := h.hotplugRemoveDevice(ctx, endpoint, NetDev); err != nil {
networkLogger().WithError(err).Error("Error detach tun/tap ep")
return err
}