diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-05-03 08:44:48 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-05-03 15:57:46 +0000 |
| commit | 610f2a54d02f8cf4f2454c03bf679b602e6e59b6 (patch) | |
| tree | dd1768a4e516fe9fb6945613ebf009eda82317f6 /vm | |
| parent | 3a81775029176dd4c693542e6715b985fa7ade4d (diff) | |
pkg/rpctype: prepare for not using for target communication
Remove things that are only needed for target VM communication:
conditional compression, timeout scaling, traffic stats.
To minimize diffs when we switch target VM communication to flatrpc.
Diffstat (limited to 'vm')
| -rw-r--r-- | vm/adb/adb.go | 2 | ||||
| -rw-r--r-- | vm/bhyve/bhyve.go | 2 | ||||
| -rw-r--r-- | vm/cuttlefish/cuttlefish.go | 2 | ||||
| -rw-r--r-- | vm/gce/gce.go | 2 | ||||
| -rw-r--r-- | vm/gvisor/gvisor.go | 2 | ||||
| -rwxr-xr-x | vm/isolated/isolated.go | 2 | ||||
| -rw-r--r-- | vm/proxyapp/init.go | 2 | ||||
| -rw-r--r-- | vm/qemu/qemu.go | 2 | ||||
| -rw-r--r-- | vm/starnix/starnix.go | 2 | ||||
| -rw-r--r-- | vm/vm.go | 6 | ||||
| -rw-r--r-- | vm/vm_test.go | 2 | ||||
| -rw-r--r-- | vm/vmimpl/vmimpl.go | 12 | ||||
| -rw-r--r-- | vm/vmm/vmm.go | 2 | ||||
| -rw-r--r-- | vm/vmware/vmware.go | 2 |
14 files changed, 17 insertions, 25 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go index de1bcd2dd..bd986346c 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -26,7 +26,7 @@ import ( ) func init() { - vmimpl.Register("adb", ctor, false, true) + vmimpl.Register("adb", ctor, false) } type Device struct { diff --git a/vm/bhyve/bhyve.go b/vm/bhyve/bhyve.go index 3e82cbc2d..c3b53e053 100644 --- a/vm/bhyve/bhyve.go +++ b/vm/bhyve/bhyve.go @@ -21,7 +21,7 @@ import ( ) func init() { - vmimpl.Register("bhyve", ctor, true, false) + vmimpl.Register("bhyve", ctor, true) } type Config struct { diff --git a/vm/cuttlefish/cuttlefish.go b/vm/cuttlefish/cuttlefish.go index d17bd78f2..94610ed4e 100644 --- a/vm/cuttlefish/cuttlefish.go +++ b/vm/cuttlefish/cuttlefish.go @@ -28,7 +28,7 @@ const ( ) func init() { - vmimpl.Register("cuttlefish", ctor, true, true) + vmimpl.Register("cuttlefish", ctor, true) } type Pool struct { diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 6a292d4f6..16f3f996f 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -35,7 +35,7 @@ import ( ) func init() { - vmimpl.Register("gce", ctor, true, true) + vmimpl.Register("gce", ctor, true) } type Config struct { diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go index f8194ab56..45c076b23 100644 --- a/vm/gvisor/gvisor.go +++ b/vm/gvisor/gvisor.go @@ -25,7 +25,7 @@ import ( ) func init() { - vmimpl.Register("gvisor", ctor, true, false) + vmimpl.Register("gvisor", ctor, true) } type Config struct { diff --git a/vm/isolated/isolated.go b/vm/isolated/isolated.go index 3383e91fa..51a995b72 100755 --- a/vm/isolated/isolated.go +++ b/vm/isolated/isolated.go @@ -23,7 +23,7 @@ import ( const pstoreConsoleFile = "/sys/fs/pstore/console-ramoops-0" func init() { - vmimpl.Register("isolated", ctor, false, true) + vmimpl.Register("isolated", ctor, false) } type Config struct { diff --git a/vm/proxyapp/init.go b/vm/proxyapp/init.go index 9c96e4855..467187f46 100644 --- a/vm/proxyapp/init.go +++ b/vm/proxyapp/init.go @@ -32,7 +32,7 @@ func init() { func(env *vmimpl.Env) (vmimpl.Pool, error) { return ctor(makeDefaultParams(), env) }, - false, true) + false) } // Package configuration VARs are mostly needed for tests. diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 2dd016a2b..6f5cb4f56 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -27,7 +27,7 @@ import ( func init() { var _ vmimpl.Infoer = (*instance)(nil) - vmimpl.Register("qemu", ctor, true, false) + vmimpl.Register("qemu", ctor, true) } type Config struct { diff --git a/vm/starnix/starnix.go b/vm/starnix/starnix.go index 2f5a087d3..51f2f670f 100644 --- a/vm/starnix/starnix.go +++ b/vm/starnix/starnix.go @@ -22,7 +22,7 @@ import ( func init() { var _ vmimpl.Infoer = (*instance)(nil) - vmimpl.Register("starnix", ctor, true, false) + vmimpl.Register("starnix", ctor, true) } type Config struct { @@ -92,12 +92,6 @@ func AllowsOvercommit(typ string) bool { return vmimpl.Types[vmType(typ)].Overcommit } -// UseNetCompression says if it's beneficial to use network compression for this VM type. -// Local VMs (qemu) generally don't benefit from compression, while remote machines may benefit. -func UseNetCompression(typ string) bool { - return vmimpl.Types[vmType(typ)].NetCompression -} - // Create creates a VM pool that can be used to create individual VMs. func Create(cfg *mgrconfig.Config, debug bool) (*Pool, error) { typ, ok := vmimpl.Types[vmType(cfg.Type)] diff --git a/vm/vm_test.go b/vm/vm_test.go index 6acc00351..184f6137f 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -80,7 +80,7 @@ func init() { ctor := func(env *vmimpl.Env) (vmimpl.Pool, error) { return &testPool{}, nil } - vmimpl.Register("test", ctor, false, false) + vmimpl.Register("test", ctor, false) } type Test struct { diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go index bd565c8aa..a9afdc1f1 100644 --- a/vm/vmimpl/vmimpl.go +++ b/vm/vmimpl/vmimpl.go @@ -129,18 +129,16 @@ func (err InfraError) InfraError() (string, []byte) { } // Register registers a new VM type within the package. -func Register(typ string, ctor ctorFunc, allowsOvercommit, netCompression bool) { +func Register(typ string, ctor ctorFunc, allowsOvercommit bool) { Types[typ] = Type{ - Ctor: ctor, - Overcommit: allowsOvercommit, - NetCompression: netCompression, + Ctor: ctor, + Overcommit: allowsOvercommit, } } type Type struct { - Ctor ctorFunc - Overcommit bool - NetCompression bool + Ctor ctorFunc + Overcommit bool } type ctorFunc func(env *Env) (Pool, error) diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go index 67f12f4c7..71dfd39b4 100644 --- a/vm/vmm/vmm.go +++ b/vm/vmm/vmm.go @@ -25,7 +25,7 @@ import ( var vmctlStatusRegex = regexp.MustCompile(`^\s+([0-9]+)\b.*\brunning`) func init() { - vmimpl.Register("vmm", ctor, true, false) + vmimpl.Register("vmm", ctor, true) } type Config struct { diff --git a/vm/vmware/vmware.go b/vm/vmware/vmware.go index 6bccbaa6e..4c05bac12 100644 --- a/vm/vmware/vmware.go +++ b/vm/vmware/vmware.go @@ -22,7 +22,7 @@ import ( ) func init() { - vmimpl.Register("vmware", ctor, false, false) + vmimpl.Register("vmware", ctor, false) } type Config struct { |
