'Read in zfs stream.'

@contextmanager
def writer(self):

    if self._exists():
        cmd = ['zfs', 'receive', '-F', self.name]
    else:
        cmd = ['zfs', 'receive', self.name]
    process = Popen(cmd, stdin=PIPE)
    succeeded = False
    try:
        (yield process.stdin)
    finally:
        process.stdin.close()
        succeeded = (not process.wait())
    if succeeded:
        check_call(['zfs', 'set', ('mountpoint=' + self._mountpoint.path), self.name])
