-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
instance/driver_qemu: properly calculate VHOST_VSOCK_SET_GUEST_CID #13519
Conversation
…GUEST_CID We can't hardcode VHOST_VSOCK_SET_GUEST_CID ioctl() number, because it may be different depending on the platform. Signed-off-by: Alexander Mikhalitsyn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -8093,8 +8105,7 @@ func (d *qemu) acquireVsockID(vsockID uint32) (*os.File, error) { | |||
// The vsock Context ID cannot be supplied as type uint32. | |||
vsockIDInt := uint64(vsockID) | |||
|
|||
// 0x4008AF60 = VHOST_VSOCK_SET_GUEST_CID = _IOW(VHOST_VIRTIO, 0x60, __u64) | |||
_, _, errno := unix.Syscall(unix.SYS_IOCTL, vsockF.Fd(), 0x4008AF60, uintptr(unsafe.Pointer(&vsockIDInt))) | |||
_, _, errno := unix.Syscall(unix.SYS_IOCTL, vsockF.Fd(), C.VHOST_VSOCK_SET_GUEST_CID, uintptr(unsafe.Pointer(&vsockIDInt))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihalicyn Nice to know! If I remember correctly I have copied the comment from https://github.com/canonical/lxd/blob/main/lxd/storage/drivers/driver_btrfs_utils.go#L64 back then.
So I guess we should update this line in the Btrfs driver too to get the right platform agnostic number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it is a good point, thanks, Julian! I think I need to fix this too.
cc @simondeziel Simon, do we have any options to test LXD on ppc64le?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihalicyn, ssh [email protected]
ubuntu@P10d-LPAR03:~$ ssh-import-id lp:mihalicyn
2024-05-31 15:55:25,758 INFO Authorized key ['4096', 'SHA256:bwq1dun/CdBl0nXIvP5g+XoRtgj1DekD/0jBH3x6EsM', 'amikhalitsyn', '(RSA)']
2024-05-31 15:55:25,759 INFO [1] SSH keys [Authorized]
Courtesy of Sergio from the server team. We'll need to return it once done with it.
…GUEST_CID
We can't hardcode VHOST_VSOCK_SET_GUEST_CID ioctl() number, because it may be different depending on the platform.