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

timesync: Fix automatic vsock device creation #191

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

cfergeau
Copy link
Collaborator

@cfergeau cfergeau commented Sep 6, 2024

Timesync uses a vsock port for guest/host time synchronization.
When timesync is in use, if the VM has no vsock device, a new one is
automatically added.
However this got broken in commit a5db53d as we were generating the
hypervisor configuration before adding this device.

This means timesync only worked if you had another vsock device
configured.

@anjannath
Copy link
Member

so the vsock config should be part of virtualMachineConfig before calling cfg.SetSocketDevicesVirtualMachineConfiguration(cfg.socketDevicesConfiguration)

@cfergeau
Copy link
Collaborator Author

so the vsock config should be part of virtualMachineConfig before calling cfg.SetSocketDevicesVirtualMachineConfiguration(cfg.socketDevicesConfiguration)

I've added this to the commit log to make it clearer.

@praveenkumar
Copy link
Member

Since we are thinking about using crc-org/crc#4341 (comment) way for timesync should we try that and drop it completely from this repo?

@cfergeau
Copy link
Collaborator Author

Since we are thinking about using crc-org/crc#4341 (comment) way for timesync should we try that and drop it completely from this repo?

After we add makestep ... to the bundle and it works fine, we can consider dropping this timesync code. We are not there yet, so better to keep it working, especially as the fix is not complicated.

@anjannath
Copy link
Member

@cfergeau commit log has some file listings, that i guess got pasted while amending commit, could you please remove that

Timesync uses a vsock port for guest/host time synchronization.
When timesync is in use, if the VM has no vsock device, a new one is
automatically added.

However this got broken in commit a5db53d as we are generating the
hypervisor configuration before adding this device.
The vsock device must be part of `virtualMachineConfig` before calling
`cfg.SetSocketDevicesVirtualMachineConfiguration(cfg.socketDevicesConfiguration)`,
and after this commit, the vsock device is only added to
`virtualMachineConfig` afterwards.

This means the timesync only worked if you had another vsock device
configured.

This fixes crc-org#190

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
@cfergeau
Copy link
Collaborator Author

@cfergeau commit log has some file listings, that i guess got pasted while amending commit, could you please remove that

hrm yes, happens more often than not because of some broken process on my end. Fixed now.

@openshift-ci openshift-ci bot added the lgtm label Sep 24, 2024
Copy link

openshift-ci bot commented Sep 24, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anjannath
Once this PR has been reviewed and has the lgtm label, please ask for approval from cfergeau. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@anjannath anjannath merged commit c005665 into crc-org:main Sep 24, 2024
6 of 7 checks passed
@anjannath anjannath assigned cfergeau and unassigned anjannath Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants