diff options
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | CONTRIBUTORS | 1 | ||||
| -rw-r--r-- | vm/gce/gce.go | 3 | ||||
| -rw-r--r-- | vm/gvisor/gvisor.go | 4 | ||||
| -rw-r--r-- | vm/isolated/isolated.go | 3 | ||||
| -rw-r--r-- | vm/kvm/kvm.go | 4 | ||||
| -rw-r--r-- | vm/qemu/qemu.go | 3 | ||||
| -rw-r--r-- | vm/vmm/vmm.go | 3 |
8 files changed, 16 insertions, 6 deletions
@@ -27,3 +27,4 @@ Chi Pham Anton Lindqvist Greg Steuck Shankara Pailoor +Michael Tuexen diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5b6c1879f..b73c62af9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -38,3 +38,4 @@ Joey Jiao Anton Lindqvist Tobin Harding Shankara Pailoor +Michael Tuexen diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 32f3e2947..44f9e5d08 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -74,7 +74,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.Count < 1 || cfg.Count > 1000 { return nil, fmt.Errorf("invalid config param count: %v, want [1, 1000]", cfg.Count) } - if env.Debug { + if env.Debug && cfg.Count > 1 { + log.Logf(0, "limiting number of VMs from %v to 1 in debug mode", cfg.Count) cfg.Count = 1 } if cfg.MachineType == "" { diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go index d339c5c4f..f55c75ba6 100644 --- a/vm/gvisor/gvisor.go +++ b/vm/gvisor/gvisor.go @@ -18,6 +18,7 @@ import ( "time" "github.com/google/syzkaller/pkg/config" + "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/vm/vmimpl" ) @@ -58,7 +59,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.Count < 1 || cfg.Count > 128 { return nil, fmt.Errorf("invalid config param count: %v, want [1, 128]", cfg.Count) } - if env.Debug { + if env.Debug && cfg.Count > 1 { + log.Logf(0, "limiting number of VMs from %v to 1 in debug mode", cfg.Count) cfg.Count = 1 } if !osutil.IsExist(env.Image) { diff --git a/vm/isolated/isolated.go b/vm/isolated/isolated.go index d55bced9f..801ca14aa 100644 --- a/vm/isolated/isolated.go +++ b/vm/isolated/isolated.go @@ -62,7 +62,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { return nil, fmt.Errorf("bad target %q: %v", target, err) } } - if env.Debug { + if env.Debug && len(cfg.Targets) > 1 { + log.Logf(0, "limiting number of targets from %v to 1 in debug mode", len(cfg.Targets)) cfg.Targets = cfg.Targets[:1] } pool := &Pool{ diff --git a/vm/kvm/kvm.go b/vm/kvm/kvm.go index 46a5c5e9b..a12db5bf8 100644 --- a/vm/kvm/kvm.go +++ b/vm/kvm/kvm.go @@ -16,6 +16,7 @@ import ( "time" "github.com/google/syzkaller/pkg/config" + "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/vm/vmimpl" ) @@ -67,7 +68,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.Count < 1 || cfg.Count > 128 { return nil, fmt.Errorf("invalid config param count: %v, want [1, 128]", cfg.Count) } - if env.Debug { + if env.Debug && cfg.Count > 1 { + log.Logf(0, "limiting number of VMs from %v to 1 in debug mode", cfg.Count) cfg.Count = 1 } if env.Image != "" { diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 504405c60..11052a417 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -180,7 +180,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.Count < 1 || cfg.Count > 128 { return nil, fmt.Errorf("invalid config param count: %v, want [1, 128]", cfg.Count) } - if env.Debug { + if env.Debug && cfg.Count > 1 { + log.Logf(0, "limiting number of VMs from %v to 1 in debug mode", cfg.Count) cfg.Count = 1 } if _, err := exec.LookPath(cfg.Qemu); err != nil { diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go index f29cd5098..72f47489c 100644 --- a/vm/vmm/vmm.go +++ b/vm/vmm/vmm.go @@ -69,7 +69,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.Count < 1 || cfg.Count > 128 { return nil, fmt.Errorf("invalid config param count: %v, want [1-128]", cfg.Count) } - if env.Debug { + if env.Debug && cfg.Count > 1 { + log.Logf(0, "limiting number of VMs from %v to 1 in debug mode", cfg.Count) cfg.Count = 1 } if cfg.Mem < 128 || cfg.Mem > 1048576 { |
