virtcontainers: clean up useless code

Fixes: #2275

Signed-off-by: Yujia Qiao <rapiz3142@gmail.com>
This commit is contained in:
Yujia Qiao 2021-08-24 16:04:34 +08:00
parent cfd539dc6c
commit 814cea9601
2 changed files with 0 additions and 8 deletions

View File

@ -28,9 +28,6 @@ var maxUInt uint64 = 1<<32 - 1
func Ioctl(fd uintptr, request, data uintptr) error {
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, fd, request, data); errno != 0 {
//uintptr(request)
//uintptr(unsafe.Pointer(&arg1)),
//); errno != 0 {
return os.NewSyscallError("ioctl", fmt.Errorf("%d", int(errno)))
}
@ -77,7 +74,6 @@ func FindContextID() (*os.File, uint64, error) {
}
}
ioctlVhostVsockSetGuestCid := getIoctlVhostVsockGuestCid()
// Last chance to get a free context ID.
for cid := contextID - 1; cid >= firstContextID; cid-- {
if err = ioctlFunc(vsockFd.Fd(), ioctlVhostVsockSetGuestCid, uintptr(unsafe.Pointer(&cid))); err == nil {

View File

@ -10,7 +10,3 @@ package utils
// from <linux/vhost.h>
// VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64)
const ioctlVhostVsockSetGuestCid = 0x4008AF60
func getIoctlVhostVsockGuestCid() uintptr {
return ioctlVhostVsockSetGuestCid
}