Skip to content

VBoxTpG: derive the VTG object UUID from the script - #827

Open
bmwiedemann wants to merge 1 commit into
VirtualBox:mainfrom
bmwiedemann:uuid
Open

VBoxTpG: derive the VTG object UUID from the script#827
bmwiedemann wants to merge 1 commit into
VirtualBox:mainfrom
bmwiedemann:uuid

Conversation

@bmwiedemann

Copy link
Copy Markdown

The UUID identifies the tracepoint data of a module, so it has to differ between modules, but there is no need for it to be random: a fresh one on every run makes VBoxDD.so, VBoxRT.so, VBoxVMM.so, VBoxSVC etc differ between two builds of the same sources.

Hash the script name and its content into a name-based (RFC-4122 version 3) UUID instead, which keeps it unique per module and stable across rebuilds.

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Aug 20, 2026
The UUID identifies the tracepoint data of a module, but there is no need
for it to be random: a fresh one on every run makes VBoxDD.so, VBoxRT.so,
VBoxVMM.so, VBoxSVC etc differ between two builds of the same sources.

Hash a fixed namespace UUID, the script name, the code generation options
and the script content into a name-based (RFC-4122 version 3) UUID
instead, which keeps the tracepoint data of different modules apart and is
stable across rebuilds.  Neither the script path nor the output and
temporary file names are hashed, as those depend on where the tree is
being built.

Modules generated from the same script with the same options do end up
with the same UUID now.  That is what VTGOBJHDR::Uuid is there for -
supdrvVtgFindObjectCopy() uses it to share a single ring-0 copy of the
data, comparing the rest of the header before doing so.

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.

Signed-off-by: Bernhard M. Wiedemann <oraclebmw@lsmod.de>
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement Bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant