Create subvolume `name` in `dest`.

    Return True if the subvolume is created, False is the subvolume is
    already there.

    name
         Name of the new subvolume

    dest
         If not given, the subvolume will be created in the current
         directory, if given will be in /dest/name

    qgroupids
         Add the newly created subcolume to a qgroup. This parameter
         is a list

    CLI Example:

    .. code-block:: bash

        salt '*' btrfs.subvolume_create var
        salt '*' btrfs.subvolume_create var dest=/mnt
        salt '*' btrfs.subvolume_create var qgroupids='[200]'

def subvolume_create(name, dest=None, qgroupids=None):
    '''
    Create subvolume `name` in `dest`.

    Return True if the subvolume is created, False is the subvolume is
    already there.

    name
         Name of the new subvolume

    dest
         If not given, the subvolume will be created in the current
         directory, if given will be in /dest/name

    qgroupids
         Add the newly created subcolume to a qgroup. This parameter
         is a list

    CLI Example:

    .. code-block:: bash

        salt '*' btrfs.subvolume_create var
        salt '*' btrfs.subvolume_create var dest=/mnt
        salt '*' btrfs.subvolume_create var qgroupids='[200]'

    '''
    if qgroupids and type(qgroupids) is not list:
        raise CommandExecutionError('Qgroupids parameter must be a list')

    if dest:
        name = os.path.join(dest, name)

    # If the subvolume is there, we are done
    if subvolume_exists(name):
        return False

    cmd = ['btrfs', 'subvolume', 'create']
    if type(qgroupids) is list:
        cmd.append('-i')
        cmd.extend(qgroupids)
    cmd.append(name)

    res = __salt__['cmd.run_all'](cmd)
    salt.utils.fsutils._verify_run(res)
    return True