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

Remove Inventory mechanism #639

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

pfmooney
Copy link
Collaborator

@pfmooney pfmooney commented Feb 6, 2024

The Inventory abstraction in propolis-lib has outlived its necessity. Created initially to keep devices in scope after VM initialization, it was somewhat cumbersome to deal with, and was providing more friction that value when it came to accessing the contained Entity bits. With its removal, the Instance abstraction can go as well, since it was simply holding the Machine and the Inventory together. In this new world, propolis-lib consumers are left to hold Lifecycle (formerly Entity) trait objects in whatever way seems appropriate to them.

With the Inventory gone, the parent-child relationships possible through the former Entity trait are also on the chopping block. The 440FX/PIIX4 chipset devices have been rearranged to more accurately reflect what is present in "real" devices.

@pfmooney pfmooney requested a review from gjcolombo February 6, 2024 21:12
@hawkw hawkw self-requested a review February 7, 2024 22:38
@hawkw
Copy link
Member

hawkw commented Feb 12, 2024

Hmm, it looks like the "migration from base" PHD tests have actually caught an incompatibility!

@pfmooney
Copy link
Collaborator Author

Hmm, it looks like the "migration from base" PHD tests have actually caught an incompatibility!

Indeed they have! That failure is expected, given the device shuffling.

@hawkw
Copy link
Member

hawkw commented Feb 12, 2024

Hmm, it looks like the "migration from base" PHD tests have actually caught an incompatibility!

Indeed they have! That failure is expected, given the device shuffling.

Ah, okay. It's good to know the tests are working, in any case. :)

Copy link
Contributor

@gjcolombo gjcolombo left a comment

Choose a reason for hiding this comment

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

I think this direction makes sense and like the new arrangement of the chipset devices. Couple of little things but otherwise LGTM.

spec: &'a InstanceSpecV0,
producer_registry: Option<ProducerRegistry>,
pub(crate) log: slog::Logger,
pub(crate) machine: &'a Machine,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessary for this PR, just a forward-looking question: how challenging do you think it'd be to have a fake Machine? I'm thinking about what it'd take to write unit tests of the form "I added this initializer function and expect that when I call it with spec X the appropriate things will show up in maps A, B, and C."

Copy link
Collaborator Author

@pfmooney pfmooney Feb 14, 2024

Choose a reason for hiding this comment

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

I think that as the core abstractions become more polished, such a thing will become easier. Machine is obviously doing much less (as of this change) than Instance -- mostly just holding references to top-level items. It seems likely that with a bit more clean-up (particularly around memory maps, and mediating access to the VmmHdl) that Machine could be discarded as well.

The Inventory abstraction in propolis-lib has outlived its necessity.
Created initially to keep devices in scope after VM initialization, it
was somewhat cumbersome to deal with, and was providing more friction
that value when it came to accessing the contained Entity bits.  With
its removal, the Instance abstraction can go as well, since it was
simply holding the Machine and the Inventory together.  In this new
world, propolis-lib consumers are left to hold Lifecycle (formerly
Entity) trait objects in whatever way seems appropriate to them.

With the Inventory gone, the parent-child relationships possible through
the former Entity trait are also on the chopping block.  The 440FX/PIIX4
chipset devices have been rearranged to more accurately reflect what is
present in "real" devices.
@pfmooney pfmooney merged commit 760039e into oxidecomputer:master Feb 27, 2024
9 of 10 checks passed
@pfmooney pfmooney deleted the inv-clean branch February 27, 2024 21:52
pfmooney added a commit that referenced this pull request Feb 28, 2024
After the integration of #639, the CI tests report lingering VMM
resources after conclusion of the run.
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