From f21d5a37fe5a44a04a949a8a6854d5755b722954 Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Fri, 10 May 2019 14:51:28 +0800 Subject: [PATCH] Support_vsock: only need to check whether device 'vhost_vsock' exists 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 --- virtcontainers/utils/utils.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/virtcontainers/utils/utils.go b/virtcontainers/utils/utils.go index b257e49b6..29c4a1732 100644 --- a/virtcontainers/utils/utils.go +++ b/virtcontainers/utils/utils.go @@ -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" @@ -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 }