mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 12:44:39 +00:00
virtcontainers: clean up useless code
Fixes: #2275 Signed-off-by: Yujia Qiao <rapiz3142@gmail.com>
This commit is contained in:
parent
cfd539dc6c
commit
814cea9601
@ -28,9 +28,6 @@ var maxUInt uint64 = 1<<32 - 1
|
|||||||
|
|
||||||
func Ioctl(fd uintptr, request, data uintptr) error {
|
func Ioctl(fd uintptr, request, data uintptr) error {
|
||||||
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, fd, request, data); errno != 0 {
|
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)))
|
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.
|
// Last chance to get a free context ID.
|
||||||
for cid := contextID - 1; cid >= firstContextID; cid-- {
|
for cid := contextID - 1; cid >= firstContextID; cid-- {
|
||||||
if err = ioctlFunc(vsockFd.Fd(), ioctlVhostVsockSetGuestCid, uintptr(unsafe.Pointer(&cid))); err == nil {
|
if err = ioctlFunc(vsockFd.Fd(), ioctlVhostVsockSetGuestCid, uintptr(unsafe.Pointer(&cid))); err == nil {
|
||||||
|
@ -10,7 +10,3 @@ package utils
|
|||||||
// from <linux/vhost.h>
|
// from <linux/vhost.h>
|
||||||
// VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64)
|
// VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64)
|
||||||
const ioctlVhostVsockSetGuestCid = 0x4008AF60
|
const ioctlVhostVsockSetGuestCid = 0x4008AF60
|
||||||
|
|
||||||
func getIoctlVhostVsockGuestCid() uintptr {
|
|
||||||
return ioctlVhostVsockSetGuestCid
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user