diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-23 20:01:20 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-23 20:01:20 +0000 |
commit | f3828b1ca1caa2997ce0f1c258354001f6e12f4c (patch) | |
tree | 14597980bf216044e9f8f23e5381fdf8fc90dc2f /pkg/sentry/platform/kvm | |
parent | fea22abd11ca244146ccf9e615709d58bef24b62 (diff) | |
parent | 7a79715504e92be9fc9aebc12fbd65aa46049054 (diff) |
Merge release-20200115.0-81-g7a79715 (automated)
Diffstat (limited to 'pkg/sentry/platform/kvm')
-rw-r--r-- | pkg/sentry/platform/kvm/kvm.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pkg/sentry/platform/kvm/kvm.go b/pkg/sentry/platform/kvm/kvm.go index a7850faed..d337c5c7c 100644 --- a/pkg/sentry/platform/kvm/kvm.go +++ b/pkg/sentry/platform/kvm/kvm.go @@ -62,9 +62,19 @@ func New(deviceFile *os.File) (*KVM, error) { } // Create a new VM fd. - vm, _, errno := syscall.RawSyscall(syscall.SYS_IOCTL, fd, _KVM_CREATE_VM, 0) - if errno != 0 { - return nil, fmt.Errorf("creating VM: %v", errno) + var ( + vm uintptr + errno syscall.Errno + ) + for { + vm, _, errno = syscall.Syscall(syscall.SYS_IOCTL, fd, _KVM_CREATE_VM, 0) + if errno == syscall.EINTR { + continue + } + if errno != 0 { + return nil, fmt.Errorf("creating VM: %v", errno) + } + break } // We are done with the device file. deviceFile.Close() |