-
Notifications
You must be signed in to change notification settings - Fork 85
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
handle system storage events #311
Merged
Merged
Conversation
This file contains 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
Looks good to me otherwise. |
88d5b2b
to
1e36521
Compare
Changes from last version:
|
Oh -- I also fixed all the stuff @vpodzime flagged in his review. |
Looks good to me now. |
udev generates ("synthesizes") a change event whenever a read/write file descriptor to a block device is closed, so there is no reason we should have to notify the kernel ourselves after writing to a block device.
update_size is the place to go get the current size.
That includes any actions related by way of containers, too.
This is intended to be used under a very limited set of circumstances, such as resize of inactive LVs from outside of blivet.
libparted's clobber does not remove a protective MBR, which makes it useless for our purposes.
There are several such mechanisms being employed elsewhere in blivet and even in the lvm tools themselves. This should not be needed anymore.
With this flag the method will recursively clear a device without removing it. This is the same behavior it has always had for disks.
When we're removing partitions to account for changes made to disklabels outside of blivet we'll need to be able to skip the remove_hook.
Waiting for the udev queue to settle doesn't make sense as part of handling uevents.
The primary purpose of this is to be called from an event handler for "change" uevents.
Callers can register a callback which blivet can use to report exceptions that occur in event handling threads. If they do not register such a callback, the following will happen: 1) The exception and traceback will be logged using the ERROR facility. 2) The next time a method that has been wrapped using the SynchronizedMeta metaclass is called in the main thread, the exception will be re-raised.
Each event is handled in a separate thread, so we use thread-local data to store an ordered list of the changes made while handling each event.
1e36521
to
0a74878
Compare
Closed
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.
These patches add support to blivet for updating the
DeviceTree
to reflect changes made to system storage from outside of blivet.This is functionally complete, but needs some more refinement. The remaining improvements that occur to me now are:
udev.settle
DiskLabelFormatPopulator.update
toDiskLabel.partedDisk
or similarProbably the most important thing is that I need to build up good test coverage. Manually dinking around running commands on a shell in a vm while watching the output of
examples/uevents.py
is not a good long-term plan.