-
Notifications
You must be signed in to change notification settings - Fork 55
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
Unify device discovery on initial start up and event-driven paths #1767
Merged
mulkieran
merged 11 commits into
stratis-storage:develop
from
mulkieran:develop-block-evaluate
Jan 7, 2020
Merged
Unify device discovery on initial start up and event-driven paths #1767
mulkieran
merged 11 commits into
stratis-storage:develop
from
mulkieran:develop-block-evaluate
Jan 7, 2020
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
mulkieran
force-pushed
the
develop-block-evaluate
branch
4 times, most recently
from
January 6, 2020 17:37
d369fbd
to
f3de73a
Compare
mulkieran
changed the title
Develop block evaluate
Unify device discovery on initial start up and event-driven paths
Jan 6, 2020
mulkieran
force-pushed
the
develop-block-evaluate
branch
5 times, most recently
from
January 7, 2020 14:52
d016dbd
to
ff461bf
Compare
drckeefe
approved these changes
Jan 7, 2020
bgurney-rh
approved these changes
Jan 7, 2020
jbaublitz
approved these changes
Jan 7, 2020
Do this by making a new method, handle_event, which is part of the Engine API and making block_evaluate private. git is wierd, and rather than show the move of block_evaluate, it chooses instead to show a move of create_pool, which wasn't really the moved method. Signed-off-by: mulhern <[email protected]>
It's somewhat inappropriate, because block_device_ownership is especially designed to be only called if a udev event on the device has occurred and this is not what is occurring in the test. Signed-off-by: mulhern <[email protected]>
Signed-off-by: mulhern <[email protected]>
Signed-off-by: mulhern <[email protected]>
The device UUID is useful in some contexts soon to be introduced. Signed-off-by: mulhern <[email protected]>
mulkieran
force-pushed
the
develop-block-evaluate
branch
from
January 7, 2020 20:40
ff461bf
to
7a20f6b
Compare
rebased. |
Use it in block_evaluate and discard any newly introduced dead code. Have block_evaluate take a udev device as an argument. This makes the udev lookup constant time instead of linear in the number of block devices. Previously, the device node was discovered from the udev database entry, and then the entries for all block devices in the udev database were searched in order to locate a block device that had the specified device node in order to locate the relevant udev database entry. Simplify block_evaluate's return type. It never returns an error, logging any internal errors instead. Signed-off-by: mulhern <[email protected]>
Use it in all methods where this makes sense, according to the context. Fix a small bug in find_all_block_devices_with_stratis_signatures. Account for the somewhat slight possibility that udev has belatedly identified the device as a Stratis device. Signed-off-by: mulhern <[email protected]>
Rely solely on publicly exposed decide_ownership method. It allows for better encapsulation, it's a bit clearer and it makes the actions that occur for the stratis enumeration and for the block device enumeration more consistent. Signed-off-by: mulhern <[email protected]>
This allows moving an expect to a position directly after the change that makes it logically necessary, rather than in another method entirely. Signed-off-by: mulhern <[email protected]>
Use it in the body of find_all_block_devices_with_stratis_signatures. The context in which this method is called by block_evaluate is the same as is established by find_all_block_devices_with_stratis_signatures. Signed-off-by: mulhern <[email protected]>
This method has no public use yet, but is analogous to the identify_block_device method. Use this method in find_all_stratis_devices in the same way that identify_block_device is used in find_all_block_devices_with_stratis_signatures. Signed-off-by: mulhern <[email protected]>
mulkieran
force-pushed
the
develop-block-evaluate
branch
from
January 7, 2020 22:36
7a20f6b
to
257c4d5
Compare
There was a tiny clippy error that was in 1.40, but not in beta. I just fixed it since it was obviously correct. I filed a bug against clippy: |
This was referenced Jan 7, 2020
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.
The major contributions of this PR are:
more or less uniform.
Resolves: #1732.
Related: #1659.