Skip to content
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

Merged
merged 1 commit into from
May 30, 2024

Conversation

mihalicyn
Copy link
Member

…GUEST_CID

We can't hardcode VHOST_VSOCK_SET_GUEST_CID ioctl() number, because it may be different depending on the platform.

…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 <aleksandr.mikhalitsyn@canonical.com>
@mihalicyn mihalicyn changed the title lxd/instance/drivers/driver_qemu: properly calculate VHOST_VSOCK_SET_… instance/driver_qemu: properly calculate VHOST_VSOCK_SET_GUEST_CID May 30, 2024
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomponline tomponline merged commit 52640b7 into canonical:main May 30, 2024
29 checks passed
@@ -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)))
Copy link
Contributor

@roosterfish roosterfish May 31, 2024

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?

Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihalicyn, ssh ubuntu@10.245.71.25

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants