Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Support_vsock: only need to check whether device 'vhost_vsock' exists
Browse files Browse the repository at this point in the history
QEMU opens /dev/vhost-vsock and this causes vhost_vsock.ko to be
automatically loaded.
So, checking the existence of /dev/vhost-vsock is enough.

Fixes: #1512

Signed-off-by: Penny Zheng <[email protected]>
(cherry picked from commit f21d5a3)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
  • Loading branch information
Pennyzct authored and Ganesh Maharaj Mahalingam committed May 14, 2019
1 parent 77d5fe2 commit 40a33b2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions virtcontainers/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const MibToBytesShift = 20
// See unix(7).
const MaxSocketPathLen = 107

// VSockDevicePath path to vsock device
var VSockDevicePath = "/dev/vsock"

// VHostVSockDevicePath path to vhost-vsock device
var VHostVSockDevicePath = "/dev/vhost-vsock"

Expand Down Expand Up @@ -234,10 +231,6 @@ func BuildSocketPath(elements ...string) (string, error) {

// SupportsVsocks returns true if vsocks are supported, otherwise false
func SupportsVsocks() bool {
if _, err := os.Stat(VSockDevicePath); err != nil {
return false
}

if _, err := os.Stat(VHostVSockDevicePath); err != nil {
return false
}
Expand Down

0 comments on commit 40a33b2

Please sign in to comment.