diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-07 22:54:05 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-07 22:54:05 +0000 |
commit | d1e0fe9593fd26167e7cce670a063c4ad561ac3e (patch) | |
tree | ec5edbdc0a3ecc4dfb7512f9c932f14c1932aa2b /pkg | |
parent | e17919f623c6b58ae0f01033e5939df042012d46 (diff) | |
parent | 710e51372dc822501769d700531ec6f0f81221e6 (diff) |
Merge release-20210927.0-47-g710e51372 (automated)
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/platform/kvm/kvm.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/platform/kvm/kvm.go b/pkg/sentry/platform/kvm/kvm.go index aac0fdffe..ad6863646 100644 --- a/pkg/sentry/platform/kvm/kvm.go +++ b/pkg/sentry/platform/kvm/kvm.go @@ -77,7 +77,11 @@ var ( // OpenDevice opens the KVM device at /dev/kvm and returns the File. func OpenDevice() (*os.File, error) { - f, err := os.OpenFile("/dev/kvm", unix.O_RDWR, 0) + dev, ok := os.LookupEnv("GVISOR_KVM_DEV") + if !ok { + dev = "/dev/kvm" + } + f, err := os.OpenFile(dev, unix.O_RDWR, 0) if err != nil { return nil, fmt.Errorf("error opening /dev/kvm: %v", err) } |