MFV r308222: 6051 lzc_receive: allow the caller to read the begin record
authoravg <avg@FreeBSD.org>
Thu, 3 Nov 2016 09:24:27 +0000 (09:24 +0000)
committeravg <avg@FreeBSD.org>
Thu, 3 Nov 2016 09:24:27 +0000 (09:24 +0000)
commitd0dec3458f24ecd37763794bb308665124233a19
tree8032c2446b49e0bd374006563a6237e6a680bd69
parentb08d2f2f2068f266008c621009164f7e65cc50b5
MFV r308222: 6051 lzc_receive: allow the caller to read the begin record

illumos/illumos-gate@620f322510b2d6433f7f6af60fa52380c07756ad
https://github.com/illumos/illumos-gate/commit/620f322510b2d6433f7f6af60fa52380c07756ad

https://www.illumos.org/issues/6051
  Currently lzc_receive() requires that its snapname argument is a snapshot name
  (contains '@').
  zfs receive allows to specify just a dataset name and would try to deduce the
  snapshot name from the stream.
  I propose to allow lzc_receive() to do the same.
  That seems to be quite easy to implement, it requires only a small amount of
  logic, it does not require any additional system calls or any additional data
  from the stream.
  The benefit is that the new behavior would allow to keep the snapshot names the
  same between the sender and receiver at zero cost, without a need to pass the
  names out of band.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@icyb.net.ua>
MFC after: 2 weeks
cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h