Repository navigation
Conversation
Both of these had versions of `compatible_sled_cpu_families()`, and one was right, while the other was stale, resulting in #11668. Now and for the future an instance's CPU platform, if explicitly chosen, is represented by exactly one VMM CPU platform. Because of that, we can convert the instance's CPU platform to the VMM CPU platform for it and have a single authoritative `compatible_sled_cpu_families()`.
hawkw
approved these changes
Nov 4, 2026
Comment on lines
+63
to
+73
| // An InstanceCpuPlatform is an instance's request for how it wants vCPUs to | ||
| // look, whereas a VmmCpuPlatform is the actual chosen platform at the point | ||
| // that instance was incarnated. A critical difference is that VmmCpuPlatform | ||
| // has an escape hatch in the form of `SledDefault` if an instance is to be run | ||
| // on a kind of hardware the control plane does not yet know about - this is | ||
| // only a possible value if both the instance did not have an explicit CPU | ||
| // platform *and* it was placed on a sled whose family we don't know. | ||
| // | ||
| // While this means we can convert between Instance and VMM CPU platforms, in | ||
| // practice Instance->VMM is the only useful direction. Since that is expected | ||
| // to be injective, `From` suffices. |
Member
There was a problem hiding this comment.
thank you for this note, this is great. as a very tiny note, it turns out you can put doc comments on impls, so this could be
Suggested change
| // An InstanceCpuPlatform is an instance's request for how it wants vCPUs to | |
| // look, whereas a VmmCpuPlatform is the actual chosen platform at the point | |
| // that instance was incarnated. A critical difference is that VmmCpuPlatform | |
| // has an escape hatch in the form of `SledDefault` if an instance is to be run | |
| // on a kind of hardware the control plane does not yet know about - this is | |
| // only a possible value if both the instance did not have an explicit CPU | |
| // platform *and* it was placed on a sled whose family we don't know. | |
| // | |
| // While this means we can convert between Instance and VMM CPU platforms, in | |
| // practice Instance->VMM is the only useful direction. Since that is expected | |
| // to be injective, `From` suffices. | |
| /// An InstanceCpuPlatform is an instance's request for how it wants vCPUs to | |
| /// look, whereas a VmmCpuPlatform is the actual chosen platform at the point | |
| /// that instance was incarnated. A critical difference is that VmmCpuPlatform | |
| /// has an escape hatch in the form of `SledDefault` if an instance is to be run | |
| /// on a kind of hardware the control plane does not yet know about - this is | |
| /// only a possible value if both the instance did not have an explicit CPU | |
| /// platform *and* it was placed on a sled whose family we don't know. | |
| /// | |
| /// While this means we can convert between Instance and VMM CPU platforms, in | |
| /// practice Instance->VMM is the only useful direction. Since that is expected | |
| /// to be injective, `From` suffices. |
if you want it to be...
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both of these had versions of
compatible_sled_cpu_families(), and one was right, while the other was stale, resulting in #11668. Now and for the future an instance's CPU platform, if explicitly chosen, is represented by exactly one VMM CPU platform. Because of that, we can convert the instance's CPU platform to the VMM CPU platform for it and have a single authoritativecompatible_sled_cpu_families().#11668 was "there is clearly a bug, make it stop existing", and this is "after having thought about how the bug happened, can we make the code less bug-prone", so.. delightfully, it deletes the same code that 11668 fixed this morning.