mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
runtime: Sandbox: Add addSwap and removeSwap
addSwap will create a swap file, hotplug it to hypervisor as a special block device and let agent to setup it in the guest kernel. removeSwap will remove the swap file. Just QEMU support addSwap. Fixes: #2201 Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
|
||||
pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc"
|
||||
vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types"
|
||||
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"golang.org/x/net/context"
|
||||
@@ -215,6 +216,11 @@ func (n *mockAgent) copyFile(ctx context.Context, src, dst string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// addSwap is the Noop agent setup swap. It does nothing.
|
||||
func (n *mockAgent) addSwap(ctx context.Context, PCIPath vcTypes.PciPath) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *mockAgent) markDead(ctx context.Context) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user