BlockDev.ExtraArg

Fields

Name

Type

Access

Description

opt

str

r/w

extra option (command line option for most functions that allow extra options to be passed, e.g. “-L” to call mkfs.xfs -L)

val

str

r/w

value for opt, can be an empty string or None for options without parameter

Methods

class

list_free (args)

class

new (opt, val)

copy ()

free ()

Details

class BlockDev.ExtraArg

See BlockDev.ExtraArg.new() for an example on how to construct the extra args.

classmethod list_free(args)
Parameters:

args ([BlockDev.ExtraArg] or None) – A list of BlockDev.ExtraArg to free

Frees args and all its elements.

classmethod new(opt, val)
Parameters:
  • opt (str) – extra option

  • val (str) – value for the extra option opt

Returns:

a new extra argument

Return type:

BlockDev.ExtraArg

Example of calling BlockDev.fs_xfs_mkfs() with an extra argument. This will result in calling mkfs.xfs with -L label.

BDExtraArg label_arg = {"-L", "label"};
const BDExtraArg *extra_args[2] = {&label_arg, NULL};

ret = bd_fs_xfs_mkfs ("/dev/sda", extra_args, error);
copy()
Return type:

BlockDev.ExtraArg

Creates a new copy of self.

free()

Frees self.