aboutsummaryrefslogtreecommitdiff
path: root/lib/libbe
Commit message (Collapse)AuthorAgeFilesLines
...
* libbe(3): Fix be_import to delete temp snapshotKyle Evans2018-08-132-10/+20
| | | | | | | | | | | | Deleting the temp snapshot isn't immediately possible because it's the origin of the newly imported boot environment. However, this is trivially solved by opening the new boot environment and promoting it. The roles are now reversed and the temp snapshot/dataset may be completely destroyed. Remove the BUGS from libbe(3) and bectl(8). Notes: svn path=/head/; revision=337697
* libbe(3): Document the import bug...Kyle Evans2018-08-112-9/+10
| | | | Notes: svn path=/projects/bectl/; revision=337605
* libbe(3): Brain dump...Kyle Evans2018-08-111-55/+326
| | | | Notes: svn path=/projects/bectl/; revision=337601
* libbe(3)/bectl(8): Make igor and mandoc -Tlint a little happierKyle Evans2018-08-111-38/+43
| | | | Notes: svn path=/projects/bectl/; revision=337598
* libbe(3): Bring man page back into realityKyle Evans2018-08-111-39/+8
| | | | Notes: svn path=/projects/bectl/; revision=337597
* libbe(3)/bectl(8): Kill off the 'add' functionality for nowKyle Evans2018-08-112-3/+11
| | | | | | | | | | | | The mostly-undocumented 'add' functionality, from initial read-through, is intended for construction of deep ("bdrewery style") boot environments. However, it's mostly broken at this point. `#if SOON` it out on both sides so that we're not exposing a broken API/feature. Work will resume on it in due time. Notes: svn path=/projects/bectl/; revision=337596
* libbe(3): More error handling bitsKyle Evans2018-08-103-63/+119
| | | | | | | | | | | | be_add_child functionality gets split out into separate places as a bonus. A lot of places here we'll gloss over libzfs errors, because they shouldn't be happening given the conditions that we're operating under. "Unknown error" is what I'm intending to use for the moment to indicate an exceptional circumstance- exceptional enough that we can't tell the consumer did because we're not so certain that they did anything. Notes: svn path=/projects/bectl/; revision=337592
* libbe(3): Plug some holes, do some more proper error returnsKyle Evans2018-08-101-34/+29
| | | | | | | For those returning just -1 before, have them set ERR_UNKNOWN for now. Notes: svn path=/projects/bectl/; revision=337564
* libbe(3): more small cleanup, const'ify and light style(9)Kyle Evans2018-08-102-25/+23
| | | | Notes: svn path=/projects/bectl/; revision=337563
* libbe(3): Some more light error handling...Kyle Evans2018-08-081-16/+26
| | | | Notes: svn path=/projects/bectl/; revision=337446
* libbe(3): Clarify some errorsKyle Evans2018-08-083-15/+19
| | | | | | | | While here, fix a bug with 'rename' that checked the wrong name for being the active BE. Notes: svn path=/projects/bectl/; revision=337445
* Catch up on BE_ERR messagesKyle Evans2018-08-081-0/+9
| | | | Notes: svn path=/projects/bectl/; revision=337444
* libbe(3)/bectl(8): Standardize $FreeBSD$ IDsKyle Evans2018-08-076-0/+16
| | | | Notes: svn path=/projects/bectl/; revision=337416
* libbe(3)/bectl(8): Standardize copyright headersKyle Evans2018-08-077-12/+16
| | | | | | | | | | | | - File names don't necessarily need to be repeated - Add SPDX tags - Add a missing copyright for Kyle Kneitinger in bectl.8, originally written by him in GSoC 2017; his standard copyright notice has been copied from other files within the same directory to remain consistent with how he clearly wished to portray it Notes: svn path=/projects/bectl/; revision=337414
* libbe(3): Destroy all children of a BE dataset, tooKyle Evans2018-08-071-7/+19
| | | | | | | | This fixes destruction of a deep BE returning an EBUSY because child datasets still exist. Notes: svn path=/projects/bectl/; revision=337409
* libbe(3): Document that we'll clobber previous errors set by set_errorKyle Evans2018-08-072-1/+1
| | | | Notes: svn path=/projects/bectl/; revision=337408
* libbe(3): Return some more proper error codesKyle Evans2018-08-073-14/+44
| | | | Notes: svn path=/projects/bectl/; revision=337407
* libbe(3): Check that dataset is to be mounted at / for be_existsKyle Evans2018-08-071-7/+30
| | | | | | | | | | | | | | | | This makes the be_exists behavior match the comments that assert that we've already checked that the dataset derived from the BE name is set to mount at /. Other changes of note: - bectl_list sees another change; changing mountpoint based on mount status turns out to be a bad idea, so instead make the mounted property of the returned nvlist the path that it's mounted at - Always return the "mountpoint" property in "mountpoint" if it's ste Notes: svn path=/projects/bectl/; revision=337406
* libbe(3): Rename prop_list_builder and snapshot_prop_list_builderKyle Evans2018-08-072-8/+6
| | | | Notes: svn path=/projects/bectl/; revision=337404
* This snippet is no longer from zfsbootcfgKyle Evans2018-08-071-4/+0
| | | | Notes: svn path=/projects/bectl/; revision=337403
* libbe(3): Rewrite activate temp bits to rely less on loaderKyle Evans2018-08-071-18/+39
| | | | | | | | | | | | Loader is still relied upon at the beginning of libbe to specify the be root, but we can derive from that the primary zpool and any vdevs that we need to set nextboot bits on. This lets me successfully `bectl activate -t test`, but UEFI loader doesn't quite yet understand so it's effectively defunct. Notes: svn path=/projects/bectl/; revision=337402
* bectl(8): Implement `bectl list -s`Kyle Evans2018-08-053-0/+32
| | | | | | | | | | be_get_dataset_snapshots has been added to libbe(3), effectively returning the same information as be_get_bootenv_props but for snapshots of the given dataset. The assumption is that one will have the BE dataset name before wanting to grab snapshots. Notes: svn path=/projects/bectl/; revision=337358
* bectl: Implement -D ("space if origin datasets were deleted")Kyle Evans2018-08-054-4/+17
| | | | | | | | | | | | This also accomplishes the following: - Proxy through zfs_nicenum as be_nicenum, because it looks better than humanize_number and would presumably be useful to other libbe consumers. - Rename be_get_snapshot_props to be_get_dataset_props, make it more useful Notes: svn path=/projects/bectl/; revision=337343
* bectl(8): Take origin snapshot into account when calculating used spaceKyle Evans2018-08-035-2/+31
| | | | | | | | This more closely matches the behavior for beadm. The associated libbe(3) API is still getting worked out a little bit. Notes: svn path=/projects/bectl/; revision=337228
* libbe(3): Fix checking of zfs_prop_get's return valueKyle Evans2018-08-031-7/+7
| | | | | | | Rather than a boolean_t, it returns an int != 0 for error or 0 for OK. Notes: svn path=/projects/bectl/; revision=337224
* libbe(3): Add be_mounted_at to check a mount pointKyle Evans2018-07-265-11/+77
| | | | | | | | | | | At a bare minimum, this function will return 0 if a BE is mounted at the given path or non-zero otherwise. If the optional 'details' nvlist is supplied, it is filled with an nvpair containing just the information about the BE mounted at the path. This nvpair is structured just as it is for be_get_bootenv_props, except limited to just the single mount point. Notes: svn path=/projects/bectl/; revision=336729
* libbe(3)/bectl(8): Provide and use proper alloc/free for property listsKyle Evans2018-07-253-0/+16
| | | | Notes: svn path=/projects/bectl/; revision=336715
* libbe(3): Use zfs_is_mounted to check mounted and mountpointKyle Evans2018-07-251-8/+4
| | | | Notes: svn path=/projects/bectl/; revision=336713
* libbe(3)/be(8): Drop WARNS overrides, fix all falloutKyle Evans2018-07-256-54/+52
| | | | | | | | | | | | Based on the idea that we shouldn't have all-new library and utility going into base that need WARNS=1... - Decent amount of constification - Lots of parentheses - Minor other nits Notes: svn path=/projects/bectl/; revision=336710
* libbe(3): Add nextboot flag to returned BE informationKyle Evans2018-07-253-1/+28
| | | | Notes: svn path=/projects/bectl/; revision=336709
* bectl(8): Start dumping out BE information with `bectl list`Kyle Evans2018-07-252-12/+8
| | | | | | | | | For the moment, this is a primitive nvlist dump of what we get back from be_get_bootenv_props as a proof-of-concept and to make sure that we're getting back the kind of information we want to see from list. Notes: svn path=/projects/bectl/; revision=336708
* libbe(3): make style consistent with what I'll use going forwardKyle Evans2018-07-254-259/+179
| | | | Notes: svn path=/projects/bectl/; revision=336701
* libbe(3): Find rootfs instead by enumerating child datasets of BE rootKyle Evans2018-07-251-6/+30
| | | | | | | | | | This makes us more resilient to a rename of the bootfs, but still wouldn't withstand pool renames or guid renames. More importantly, this allows `bectl create <foo>` work out of the box to create a boot environment based on the currently booted one. Notes: svn path=/projects/bectl/; revision=336699
* libbe(3): Disambiguate 'active' a little bit, add 'bootfs'Kyle Evans2018-07-253-52/+64
| | | | | | | | | | | | | | | - Rename 'active' to 'rootfs', which is used in other places to describe the currently booted (or about to be booted) BE. - Add 'bootfs', which indicates the next boot environment to be booted. This is pulled from the BOOTFS zpool property. - Go ahead and keep an open handle to the active zpool. We might need to enumerate datasets, get properties, and set properties (e.g. bootfs) throughout other libbe bits, and a single handle isn't overly expensive. Notes: svn path=/projects/bectl/; revision=336696
* libbe(3): Add to cddl build, adjust src.libnames.mk as neededKyle Evans2018-07-241-53/+0
| | | | Notes: svn path=/projects/bectl/; revision=336673
* Import libbe(3)/be(1) from socsvn/soc2017/kneitinger/libbe-headKyle Evans2018-07-248-0/+1785
Notes: svn path=/projects/bectl/; revision=336668