'Create a QCOW2 file backed by another file.
:param snapshot: snapshot reference
:param backing_filename: filename of file that will back the
new qcow2 file
:param new_snap_path: filename of new qcow2 file'

def _do_create_snapshot(self, snapshot, backing_filename, new_snap_path):

    backing_path_full_path = os.path.join(self._local_volume_dir(snapshot.volume), backing_filename)
    info = self._qemu_img_info(backing_path_full_path, snapshot.volume.name)
    backing_fmt = info.file_format
    command = ['qemu-img', 'create', '-f', 'qcow2', '-o', ('backing_file=%s,backing_fmt=%s' % (backing_path_full_path, backing_fmt)), new_snap_path, ('%dG' % snapshot.volume.size)]
    self._execute(run_as_root=self._execute_as_root, *command)
    command = ['qemu-img', 'rebase', '-u', '-b', backing_filename, '-F', backing_fmt, new_snap_path]
    self._execute(run_as_root=self._execute_as_root, *command)
    self._set_rw_permissions(new_snap_path)
    if self.secure_file_operations_enabled():
        ref_file = backing_path_full_path
        log_msg = ('Setting    permissions:    %(file)s    ->    %(user)s:%(group)s' % {'file': ref_file, 'user': os.stat(ref_file).st_uid, 'group': os.stat(ref_file).st_gid})
        LOG.debug(log_msg)
        command = ['chown', ('--reference=%s' % ref_file), new_snap_path]
        self._execute(run_as_root=self._execute_as_root, *command)
