'Common post-processing for attempts at creating new volumes from other
volumes.
In particular this includes error handling and ensuring read-only
and mountpoint properties are set correctly.
:param Deferred result: The result of the creation attempt.
:param Volume new_volume: Volume we\'re trying to create.'

def _created(self, result, new_volume):

    new_filesystem = self.get(new_volume)
    new_mount_path = new_filesystem.get_path().path
    def creation_failed(f):
        if f.check(CommandFailed):
            raise FilesystemAlreadyExists()
        return f
    result.addErrback(creation_failed)
    def exists(ignored):
        if new_volume.locally_owned():
            result = zfs_command(self._reactor, ['set', 'readonly=off', new_filesystem.name])
        else:
            result = zfs_command(self._reactor, ['inherit', 'readonly', new_filesystem.name])
        result.addCallback((lambda _: zfs_command(self._reactor, ['set', ('mountpoint=' + new_mount_path), new_filesystem.name])))
        return result
    result.addCallback(exists)
