mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 08:47:56 +00:00
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 <penny.zheng@arm.com>
This commit is contained in:
parent
9ab09f9c2d
commit
f21d5a37fe
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user