Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

sysroot: Add from_assume_locked #526

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

cgwalters
Copy link
Member

There's a mess with SysrootLock because in practice, way, way too many APIs just take the plain old C Sysroot object.

In this project, we added a new API that requires a SysrootLock, which works well when everything is using ostree-ext from the start, as it is in bootc.

However in rpm-ostree we acquire the lock from C code, but want to call remove_undeployed_images which wants SysrootLock. The only practical way out of this is to add an API which asserts that the sysroot is locked and returns this wrapper.

What would actually work better here is to drive this locking logic down into the C library.

There's a mess with `SysrootLock` because in practice,
way, way too many APIs just take the plain old C `Sysroot` object.

In this project, we added a new API that requires a `SysrootLock`,
which works well when everything is using ostree-ext from the start,
as it is in bootc.

However in rpm-ostree we acquire the lock from C code, but want
to call `remove_undeployed_images` which wants `SysrootLock`.  The
only practical way out of this is to add an API which asserts
that the sysroot is locked and returns this wrapper.

What would actually work better here is to drive this locking
logic down into the C library.
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@jmarrero jmarrero merged commit a45512a into ostreedev:main Aug 31, 2023
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants