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

allow to print flags of subvolumes #941

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Conversation

aschnell
Copy link
Contributor

Allow to print flags, so far only readonly, of subvolumes when using the 'btrfs subvolume list' command.

The use case is to avoid multiple calls to 'btrfs subvolume show' to get the information which snbk (snapper
backup tool) is doing right now.

@kdave kdave force-pushed the devel branch 2 times, most recently from 600c14b to b449783 Compare January 17, 2025 20:59
@kdave
Copy link
Owner

kdave commented Jan 28, 2025

The readonly is the only flag settable by the ioctl. For the list command update I considered also the received status, is-snapshot. If there's something more in the future sticking to the full words (readonly) in the output would become unfeasible. When it's used win the line output it's among the words, in the tabular output it misalignes the colums, but this is a minor problem.

263     1137755 256             -       @/boot/grub2/i386-pc
264     1720129 256             -       @/.snapshots
265     1720128 264             -       @/.snapshots/1/snapshot
18124   1713353 264             readonly        @/.snapshots/17866/snapshot
18125   1713355 264             readonly        @/.snapshots/17867/snapshot

As this is behind the option it's expected that the applications using it will understand the output, so this should be OK.

The question I still have is how to format it, this is for the original list command where I don't want to touch the output formatting, but this kind of minor extension is probably safe regarding compatibility. Moreover the new list command is not ready yet. I'll give it another thought and merge this PR eventually.

@aschnell
Copy link
Contributor Author

Yes, the alignment is broken. That is partly also the case for the some extra UUID options (e.g. -u) where the header is not aligned with the content. I would add a width entry in btrfs_list_columns to fix all that but I would fear breaking existing parsers.

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

Successfully merging this pull request may close these issues.

2 participants