recv: don't complain about 'no-op' -x options.

When a recursive send is performed that contains volumes (to backup
a system that has VMs run from the main zpool, for example), the
destination receive run with '-x mountpoint' will complain with
Warning: backup/path/to/volume: property 'mountpoint' does not
apply to datasets of this type.

This change disables these warnings for mis-matched (could not be in
send stream) options.
This commit is contained in:
Eric A. Borisch 2023-07-11 22:39:58 -05:00
parent ba92d00cc7
commit 95f7107d15
1 changed files with 8 additions and 10 deletions

View File

@ -4218,16 +4218,14 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
*/
if (!zfs_prop_valid_for_type(prop, type, B_FALSE) &&
!zfs_prop_user(name)) {
if (type == ZFS_TYPE_VOLUME &&
strncmp("mountpoint", name, 10) == 0) {
// Don't complain about '-x mountpoint'
// applied to a volume.
continue;
}
(void) fprintf(stderr, dgettext(TEXT_DOMAIN,
"Warning: %s: property '%s' does not "
"apply to datasets of this type\n"),
fsname, name);
/*
* These are non-user properties that are not
* supported for this particular type of
* destination. These could not have been set
* on the source, so there is no reason to
* complain about eliding them (-x) during the
* receive.
*/
continue;
}
/*