This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vsock: set VHOST_VSOCK_SET_GUEST_CID based based on arch
set VHOST_VSOCK_SET_GUEST_CID depending on the host architecture. Fixes: #1988 Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
- Loading branch information
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// +build amd64 arm64 s390x !ppc64le | ||
|
||
// Copyright (c) 2019 IBM | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
package utils | ||
|
||
// from <linux/vhost.h> | ||
// VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64) | ||
const ioctlVhostVsockSetGuestCid = 0x4008AF60 | ||
|
||
func getIoctlVhostVsockGuestCid() uintptr { | ||
return ioctlVhostVsockSetGuestCid | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2019 IBM | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
package utils | ||
|
||
// from <linux/vhost.h> | ||
// VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64) | ||
|
||
// _IOC_WRITE is 1 for arch generic and 4 for powerpc | ||
// Code reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/uapi/asm/ioctl.h | ||
// Explanation: https://github.com/kata-containers/runtime/pull/1989#issuecomment-525993135 | ||
const ioctlVhostVsockSetGuestCid = 0x8008AF60 | ||
|
||
func getIoctlVhostVsockGuestCid() uintptr { | ||
return ioctlVhostVsockSetGuestCid | ||
} |