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

[Hyper-V Extension] Change KVP names in Hyper-V Host-Guest communication. #2765

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

sshilov7
Copy link
Member

Summary of the pull request

Previous implementation of communication between host and guest Hyper-V machine using Hyper-V KVP integration service was not deleting KVPs correctly. KVPs created on host side must be delete from host. When they are only deleted from guest side (as registry keys) they are re-created after Hyper-V VM reboot.

In addition, Hyper-V KVP integration service has a limit (undocumented) on number of KVP and after exceeding that limit no new keys can be created. KVP service API doesn't allow reading We used GUID in the key names.

This fix changes KVP name format: instead of using GUID ("DevSetup{}") it's now a sequential number ("DevSetup{}") to make KVP names more predictable. In case we run into a situation where we have stale KVPs, some of them can be re-used (and then deleted), reducing chances of reaching max number of KVPs limit.
Under normal operation these KVPs deleted after communication with guest machine is complete or KvpSession object is disposed.

Added a new GetState request to get DevSetupAgent service state. For now, it returns a list of requests in queue. Host side won't send new requests if queue is not empty (this flow will need improvements in the future. We don't have UX for it yet)

Added a test for GetState request.

Updated current tests to use new format of KVP names.

Fixed copying of Microsoft.Windows.DevHome.DevSetupEngine.winmd into test projects output.

References and relevant issues

Validation steps performed

Ran tests and Hyper-V configuration flow.

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@sshilov7 sshilov7 merged commit a2bf59f into main Apr 30, 2024
4 checks passed
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.

3 participants