Skip to content
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

mdconfig: Print options when listing devices #1210

Merged
merged 1 commit into from
May 10, 2024

Conversation

ricardobranco777
Copy link
Contributor

@ricardobranco777 ricardobranco777 commented Apr 27, 2024

Currently, we have no way of seeing options set to md(4) devices.

Also fix usage string (missing async option).

Example:

# mdconfig -a -f /root/backup.iso -o readonly -o verify

Before:

# mdconfig -l -v
md0	vnode	 1536K	/root/backup.iso

After:

# mdconfig -l -v
md0	vnode	 1536K	/root/backup.iso	-	readonly,verify

Fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278624

fprintf(stderr, "\t\t verify}\n");
fprintf(stderr, "\t\toption = {async, cache, cluster, compress,\n");
fprintf(stderr, "\t\t force, mustdealloc, readonly, ro,\n");
fprintf(stderr, "\t\t reserve, verify}\n");
fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n");
fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB), \n");
Copy link
Member

Choose a reason for hiding this comment

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

Should delete this space after the , and before the \n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should delete this space after the , and before the \n

Fixed, thanks!

@bsdimp
Copy link
Member

bsdimp commented Apr 29, 2024

Otherwise, I like this.

PR: 278624
Reviewed by: imp
Pull Request: freebsd#1210
@bsdimp
Copy link
Member

bsdimp commented May 10, 2024

Thanks for this! Please close the Bugzilla PR now that this is in.

@freebsd-git freebsd-git merged commit b01988d into freebsd:main May 10, 2024
7 of 9 checks passed
@asomers
Copy link
Member

asomers commented May 31, 2024

@ricardobranco777 what is the purpose of the \0 separator? Should that initially be ''? Currently, there is always an actual \0 character printed at the beginning of the option list.

@ricardobranco777
Copy link
Contributor Author

ricardobranco777 commented May 31, 2024

@ricardobranco777 what is the purpose of the \0 separator? Should that initially be ''? Currently, there is always an actual \0 character printed at the beginning of the option list.

You're right. It must be ''. My bad. Will submit a PR tomorrow.

@bsdimp
Copy link
Member

bsdimp commented May 31, 2024

@ricardobranco777 what is the purpose of the \0 separator? Should that initially be ''? Currently, there is always an actual \0 character printed at the beginning of the option list.

You're right. It must be ''. My bad. Will submit a PR tomorrow.

Doh! Looks like I missed seeing that. Thanks for fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants