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

Shutdown relay device should mirror guest connectivity #144

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Brian-Perkins
Copy link
Contributor

Mirror guest vmbus connection status with shutdown device. This allows the host to determine if there is a shutdown device connected.
Rescind guest shutdown device on stop in case VM is moving to a version that does not support shutdown relay (e.g. moving to an older version). If the VM resumes without support for the shutdown relay device, the host device will be enumerated as a new device to the guest and will be used directly. If the resume occurs with support, it will just be setup again. This does mean the guest will see device removal/arrival around operations like servicing.
The logic for dealing with the shutdown relay has gotten hefty enough that it has been moved into its own file.

@Brian-Perkins Brian-Perkins requested review from a team as code owners October 18, 2024 16:41
@jstarks
Copy link
Member

jstarks commented Oct 25, 2024

This does mean the guest will see device removal/arrival around operations like servicing.

Can we avoid this in the case where we're not rolling back to an old version?

If we do roll back and the channel was previously offered, nothing will be there to restore it, and so it will get automatically revoked at that time. Or at least, that's what's supposed to happen.

Brian Perkins added 3 commits November 14, 2024 11:13
Rescind guest shutdown device on stop in case VM is moving to a version that does not support shutdown relay.
Move majority of shutdown relay logic to new ShutdownRelayDevice object.
…annel to a running device.

When the shutdown device is closed, the notificiation channel is also closed.
When the device starts up again, a new notification channel is provided.
@Brian-Perkins
Copy link
Contributor Author

This does mean the guest will see device removal/arrival around operations like servicing.

Can we avoid this in the case where we're not rolling back to an old version?

If we do roll back and the channel was previously offered, nothing will be there to restore it, and so it will get automatically revoked at that time. Or at least, that's what's supposed to happen.

John and I had an offline discussion about this. There is an issue with the save state, in that if save state exists for a device that is not present, it is considered an error. There is potential future work here to either support optional save state (ignored when unused), or a more extreme "no save state" option that actually removes all references.

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