-
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
Move StaticHeader into its own file #1792
Move StaticHeader into its own file #1792
Conversation
Test with Jenkins? |
2 similar comments
Test with Jenkins? |
Test with Jenkins? |
ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for coming back! Generally it looks good; I found a few things I noted. Please also move the test method test_ownership
into the static header test methods as it has become a pure StaticHeader test.
sizes::{BDAExtendedSize, BlockdevSize, MDADataSize}, | ||
static_header::{device_identifiers, disown_device, StaticHeader}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't export StaticHeader...I think we may have to export eventually, but for now we get along great with just exporting device_identifiers
and disown_device
.
#[derive(Debug)] | ||
pub struct BDA { | ||
header: StaticHeader, | ||
regions: mda::MDARegions, | ||
} | ||
|
||
#[derive(Clone, Copy, Debug, Eq, PartialEq)] | ||
enum MetadataLocation { | ||
pub enum MetadataLocation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the definition of this type into the static_header
module and import it into the bda module. It defines the API of some static_header
methods which some bda methods call, so that is the best place to put it.
c01491a
to
4ab9836
Compare
Updated! |
4ab9836
to
bbfa466
Compare
The Jenkins test failure duplicates the ones in Travis, just an unused import:
|
bbfa466
to
40dee0c
Compare
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the requested changes to the use
directives, this all looks good to me! Please make the changes and squash into one commit and I'll put it up for final review.
|
||
use devicemapper::{Bytes, Sectors, IEC}; | ||
|
||
use super::super::sizes::{static_header_size, MDADataSize}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use absolute name, should be crate::engine::strat_engine::metadata::sizes::{static_header_size, MDADataSize};
|
||
use super::super::sizes::static_header_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use crate name and merge the imports, as:
use crate::engine::strat_engine::metadata::{sizes::static_header_size, static_header::{tests::random_static_header, tests::static_header_strategy}}
But always leave the use super::*;
separate in tests, which is the only place we use it.
40dee0c
to
ef01735
Compare
Updated. |
Whoops! It's not |
ef01735
to
ed56589
Compare
Arf, I didn't double-check, my bad! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, correct import strat_engine::backstory::metadata
still missing in one file. Also, please make sure to rebase to pull in latest Travis updates.
88b658f
to
398a285
Compare
2161a98
to
ae18dae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more thing about the imports...otherwise it's ready to go.
|
||
use devicemapper::{Bytes, Sectors, IEC}; | ||
|
||
use super::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reverse the order here as well.
ae18dae
to
cccccdd
Compare
Done as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuillaumeGomez Could you grab this commit 390eb43 and squash it onto your work? Then it should be entirely done, and we can move it into final review. Thanks!
cccccdd
to
545d94b
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Please add license header to newly created file.
545d94b
to
faaa502
Compare
Updated. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok!
Part of #1573.
cc @mulkieran