diff --git a/src/runtime/virtcontainers/acrn.go b/src/runtime/virtcontainers/acrn.go index e186089629..51bee0aa71 100644 --- a/src/runtime/virtcontainers/acrn.go +++ b/src/runtime/virtcontainers/acrn.go @@ -811,3 +811,7 @@ func (a *Acrn) loadInfo() error { } return nil } + +func (a *Acrn) isRateLimiterBuiltin() bool { + return false +} diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index 8e0c8eec6f..578df8c913 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -1210,3 +1210,7 @@ func (clh *cloudHypervisor) vmInfo() (chclient.VmInfo, error) { return info, openAPIClientError(err) } + +func (clh *cloudHypervisor) isRateLimiterBuiltin() bool { + return false +} diff --git a/src/runtime/virtcontainers/fc.go b/src/runtime/virtcontainers/fc.go index e87d903a26..91885f49ba 100644 --- a/src/runtime/virtcontainers/fc.go +++ b/src/runtime/virtcontainers/fc.go @@ -25,12 +25,12 @@ import ( "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" + kataclient "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/client" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/firecracker/client" models "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/firecracker/client/models" ops "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/firecracker/client/operations" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" - kataclient "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/client" "github.com/blang/semver" "github.com/containerd/console" @@ -1212,3 +1212,7 @@ func (fc *firecracker) watchConsole() (*os.File, error) { return stdio, nil } + +func (fc *firecracker) isRateLimiterBuiltin() bool { + return true +} diff --git a/src/runtime/virtcontainers/hypervisor.go b/src/runtime/virtcontainers/hypervisor.go index b34f861faa..f640a8a702 100644 --- a/src/runtime/virtcontainers/hypervisor.go +++ b/src/runtime/virtcontainers/hypervisor.go @@ -802,4 +802,7 @@ type hypervisor interface { // generate the socket to communicate the host and guest generateSocket(id string, useVsock bool) (interface{}, error) + + // check if hypervisor supports built-in rate limiter. + isRateLimiterBuiltin() bool } diff --git a/src/runtime/virtcontainers/mock_hypervisor.go b/src/runtime/virtcontainers/mock_hypervisor.go index a25f853e04..d9fc35d111 100644 --- a/src/runtime/virtcontainers/mock_hypervisor.go +++ b/src/runtime/virtcontainers/mock_hypervisor.go @@ -128,3 +128,7 @@ func (m *mockHypervisor) check() error { func (m *mockHypervisor) generateSocket(id string, useVsock bool) (interface{}, error) { return types.Socket{HostPath: "/tmp/socket", Name: "socket"}, nil } + +func (m *mockHypervisor) isRateLimiterBuiltin() bool { + return false +} diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index fca0e57dee..5f5d99ace6 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -2266,3 +2266,7 @@ func (q *qemu) check() error { func (q *qemu) generateSocket(id string, useVsock bool) (interface{}, error) { return generateVMSocket(id, useVsock, q.store.RunVMStoragePath()) } + +func (q *qemu) isRateLimiterBuiltin() bool { + return false +}