qubesadmin package

Subpackages

Submodules

qubesadmin.app module

Main Qubes() class and related classes.

class qubesadmin.app.QubesBase[source]

Bases: qubesadmin.base.PropertyHolder

Main Qubes application.

This is a base abstract class, don’t use it directly. Use specialized class in py:class:qubesadmin.Qubes instead, which points at QubesLocal or QubesRemote.

add_new_vm(cls, name, label, template=None, pool=None, pools=None)[source]

Create new Virtual Machine

Example usage with custom storage pools:

>>> app = qubesadmin.Qubes()
>>> pools = {'private': 'external'}
>>> vm = app.add_new_vm('AppVM', 'my-new-vm', 'red',
>>>    'my-template', pools=pools)
>>> vm.netvm = app.domains['sys-whonix']
Parameters:
  • cls (str) – name of VM class (AppVM, TemplateVM etc)
  • name (str) – name of VM
  • label (str) – label color for new VM
  • template (str) – template to use (if apply for given VM class), can be also VM object; use None for default value
  • pool (str) – storage pool to use instead of default one
  • pools (dict) – storage pool for specific volumes

:return new VM object

add_pool(name, driver, **kwargs)[source]

Add a storage pool to config

Parameters:
  • name – name of storage pool to create
  • driver – driver to use, see pool_drivers() for available drivers
  • kwargs – configuration parameters for storage pool, see pool_driver_parameters() for a list
blind_mode = False

do not check for object (VM, label etc) existence before really needed

clone_vm(src_vm, new_name, new_cls=None, pool=None, pools=None, ignore_errors=False, ignore_volumes=None)[source]

Clone Virtual Machine

Example usage with custom storage pools:

>>> app = qubesadmin.Qubes()
>>> pools = {'private': 'external'}
>>> src_vm = app.domains['personal']
>>> vm = app.clone_vm(src_vm, 'my-new-vm', pools=pools)
>>> vm.label = app.labels['green']
Parameters:
  • or str src_vm (QubesVM) – source VM
  • new_name (str) – name of new VM
  • new_cls (str) – name of VM class (AppVM, TemplateVM etc) - use None to copy it from src_vm
  • pool (str) – storage pool to use instead of default one
  • pools (dict) – storage pool for specific volumes
  • ignore_errors (bool) – should errors on meta-data setting be only logged, or abort the whole operation?
  • ignore_volumes (list) – do not clone volumes on this list, like ‘private’ or ‘root’

:return new VM object

domains = None

domains (VMs) collection

get_label(label)[source]

Get label as identified by index or name

Throws KeyError:
 when label is not found
static get_vm_class(clsname)[source]

Find the class for a domain.

Compatibility function, client tools use str to identify domain classes.

Parameters:clsname (str) – name of the class
Return str:class
labels = None

labels collection

log = None

logger

pool_driver_parameters(driver)[source]

Parameters to initialize storage pool using given driver

pool_drivers

Available storage pool drivers

pools = None

storage pools

qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]

Execute Admin API method.

Only one of payload and payload_stream can be specified.

Parameters:
  • dest – Destination VM name
  • method – Full API method name (‘admin…’)
  • arg – Method argument (if any)
  • payload – Payload send to the method
  • payload_stream – file-like object to read payload from
Returns:

Data returned by qubesd (string)

Warning

payload_stream will get closed by this function

qubesd_connection_type = None

type of qubesd connection: either ‘socket’ or ‘qrexec’

remove_pool(name)[source]

Remove a storage pool

run_service(dest, service, filter_esc=False, user=None, localcmd=None, wait=True, **kwargs)[source]

Run qrexec service in a given destination

kwargs are passed verbatim to subprocess.Popen().

Parameters:
  • dest (str) – Destination - may be a VM name or empty string for default (for a given service)
  • service (str) – service name
  • filter_esc (bool) – filter escape sequences to protect terminal emulator
  • user (str) – username to run service as
  • localcmd (str) – Command to connect stdin/stdout to
Return type:

subprocess.Popen

class qubesadmin.app.QubesLocal[source]

Bases: qubesadmin.app.QubesBase

Application object communicating through local socket.

Used when running in dom0.

qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]

Execute Admin API method.

Only one of payload and payload_stream can be specified.

Parameters:
  • dest – Destination VM name
  • method – Full API method name (‘admin…’)
  • arg – Method argument (if any)
  • payload – Payload send to the method
  • payload_stream – file-like object to read payload from
Returns:

Data returned by qubesd (string)

Warning

payload_stream will get closed by this function

qubesd_connection_type = 'socket'
run_service(dest, service, filter_esc=False, user=None, localcmd=None, wait=True, **kwargs)[source]

Run qrexec service in a given destination

Parameters:
  • dest (str) – Destination - may be a VM name or empty string for default (for a given service)
  • service (str) – service name
  • filter_esc (bool) – filter escape sequences to protect terminal emulator
  • user (str) – username to run service as
  • localcmd (str) – Command to connect stdin/stdout to
  • wait (bool) – wait for remote process to finish
  • connect_timeout (int) – qrexec client connection timeout
Return type:

subprocess.Popen

class qubesadmin.app.QubesRemote[source]

Bases: qubesadmin.app.QubesBase

Application object communicating through qrexec services.

Used when running in VM.

qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]

Execute Admin API method.

Only one of payload and payload_stream can be specified.

Parameters:
  • dest – Destination VM name
  • method – Full API method name (‘admin…’)
  • arg – Method argument (if any)
  • payload – Payload send to the method
  • payload_stream – file-like object to read payload from
Returns:

Data returned by qubesd (string)

Warning

payload_stream will get closed by this function

qubesd_connection_type = 'qrexec'
run_service(dest, service, filter_esc=False, user=None, localcmd=None, wait=True, **kwargs)[source]

Run qrexec service in a given destination

Parameters:
  • dest (str) – Destination - may be a VM name or empty string for default (for a given service)
  • service (str) – service name
  • filter_esc (bool) – filter escape sequences to protect terminal emulator
  • user (str) – username to run service as
  • localcmd (str) – Command to connect stdin/stdout to
  • wait (bool) – wait for process to finish
Return type:

subprocess.Popen

class qubesadmin.app.VMCollection(app)[source]

Bases: object

Collection of VMs objects

clear_cache()[source]

Clear cached list of VMs

get_blind(item)[source]

Get a vm without downloading the list and checking if exists

keys()[source]

Get list of VM names.

refresh_cache(force=False)[source]

Refresh cached list of VMs

values()[source]

Get list of VM objects.

qubesadmin.base module

Base classes for managed objects

class qubesadmin.base.PropertyHolder(app, method_prefix, method_dest)[source]

Bases: object

A base class for object having properties retrievable using mgmt API.

Warning: each (non-private) local attribute needs to be defined at class level, even if initialized in __init__; otherwise will be treated as property retrievable using mgmt call.

app = None
clone_properties(src, proplist=None)[source]

Clone properties from other object.

Parameters:
  • src (PropertyHolder) – source object
  • proplist (list) – list of properties (None or omit for all properties)
property_get_default(item)[source]

Get default property value, regardless of the current value

Parameters:item (str) – name of property
Returns:default value
property_help(name)[source]

Get description of a property.

Returns:property help text
property_is_default(item)[source]

Check if given property have default value

Parameters:item (str) – name of property
Returns:bool
property_list()[source]

List available properties (their names).

Returns:list of strings
qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]

Call into qubesd using appropriate mechanism. This method should be defined by a subclass.

Only one of payload and payload_stream can be specified.

Parameters:
  • dest – Destination VM name
  • method – Full API method name (‘admin…’)
  • arg – Method argument (if any)
  • payload – Payload send to the method
  • payload_stream – file-like object to read payload from
Returns:

Data returned by qubesd (string)

class qubesadmin.base.WrapperObjectsCollection(app, list_method, object_class)[source]

Bases: object

Collection of simple named objects

clear_cache()[source]

Clear cached list of names

get_blind(item)[source]

Get a property without downloading the list and checking if it’s present

items()[source]

Get list of (key, value) pairs

keys()[source]

Get list of names.

refresh_cache(force=False)[source]

Refresh cached list of names

values()[source]

Get list of objects

qubesadmin.config module

Configuration variables/constants

qubesadmin.config.QUBESD_SOCKET = '/var/run/qubesd.sock'

path to qubesd socket

qubesadmin.devices module

API for various types of devices.

Main concept is that some domain main expose (potentially multiple) devices, which can be attached to other domains. Devices can be of different classes (like ‘pci’, ‘usb’, etc). Each device class is implemented by an extension.

Devices are identified by pair of (backend domain, ident), where ident is str.

class qubesadmin.devices.DeviceAssignment(backend_domain, ident, options=None, persistent=False, frontend_domain=None, devclass=None)[source]

Bases: object

Maps a device to a frontend_domain.

clone()[source]

Clone object instance

device

Get DeviceInfo object corresponding to this DeviceAssignment

class qubesadmin.devices.DeviceCollection(vm, class_)[source]

Bases: object

Bag for devices.

Used as default value for DeviceManager.__missing__() factory.

Parameters:
  • vm – VM for which we manage devices
  • class – device class
assignments(persistent=None)[source]
List assignments for devices which are (or may be) attached to the
vm.

Devices may be attached persistently (so they are included in qubes.xml) or not. Device can also be in qubes.xml, but be temporarily detached.

Parameters:persistent (bool) – only include devices which are or are not attached persistently.
attach(device_assignment)[source]

Attach (add) device to domain.

Parameters:device_assignment (DeviceAssignment) – device object
attached()[source]

List devices which are (or may be) attached to this vm

available()[source]

List devices exposed by this vm

clear_cache()[source]

Clear cache of available devices

detach(device_assignment)[source]

Detach (remove) device from domain.

Parameters:device_assignment (DeviceAssignment) – device to detach (obtained from assignments())
persistent()[source]

Devices persistently attached and safe to access before libvirt bootstrap.

update_persistent(device, persistent)[source]

Update persistent flag of already attached device.

Parameters:
  • device (DeviceInfo) – device for which change persistent flag
  • persistent (bool) – new persistent flag
class qubesadmin.devices.DeviceInfo(backend_domain, devclass, ident, description=None, **kwargs)[source]

Bases: object

Holds all information about a device

backend_domain = None

domain providing this device

description = None

human readable description/name of the device

devclass = None

device class

ident = None

device identifier (unique for given domain and device type)

class qubesadmin.devices.DeviceManager(vm)[source]

Bases: dict

Device manager that hold all devices by their classess.

Parameters:vm – VM for which we manage devices
class qubesadmin.devices.UnknownDevice(backend_domain, devclass, ident, description=None, **kwargs)[source]

Bases: qubesadmin.devices.DeviceInfo

Unknown device - for example exposed by domain not running currently

qubesadmin.exc module

Exception hierarchy.

exception qubesadmin.exc.BackupCancelledError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException

Thrown at user when backup was manually cancelled

exception qubesadmin.exc.DeviceAlreadyAttached(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, KeyError

Trying to attach already attached device

exception qubesadmin.exc.QubesDaemonCommunicationError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, OSError

Error while communicating with qubesd, may mean insufficient permissions as well

exception qubesadmin.exc.QubesDaemonNoResponseError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesDaemonCommunicationError

Got empty response from qubesd

exception qubesadmin.exc.QubesException(message_format, *args, **kwargs)[source]

Bases: Exception

Base exception for all Qubes-related errors.

exception qubesadmin.exc.QubesFeatureNotFoundError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, KeyError

Feature not set for a given domain

exception qubesadmin.exc.QubesMemoryError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, MemoryError

Cannot start domain, because not enough memory is available

exception qubesadmin.exc.QubesNoSuchPropertyError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, AttributeError

Requested property does not exist

exception qubesadmin.exc.QubesNoTemplateError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

Cannot start domain, because there is no template

exception qubesadmin.exc.QubesNotImplementedError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, NotImplementedError

Thrown at user when some feature is not implemented

exception qubesadmin.exc.QubesPropertyAccessError(prop)[source]

Bases: qubesadmin.exc.QubesException, AttributeError

Failed to read/write property value, cause is unknown (insufficient permissions, no such property, invalid value, other)

exception qubesadmin.exc.QubesPropertyValueError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesValueError

Cannot set value of qubes.property, because user-supplied value is wrong.

exception qubesadmin.exc.QubesTagNotFoundError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, KeyError

Tag not set for a given domain

exception qubesadmin.exc.QubesVMError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException

Some problem with domain state.

exception qubesadmin.exc.QubesVMInUseError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

VM is in use, cannot remove.

exception qubesadmin.exc.QubesVMNotFoundError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, KeyError

Domain cannot be found in the system

exception qubesadmin.exc.QubesVMNotHaltedError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

Domain is not halted.

This exception is thrown when machine should be halted, but is not (either running or paused).

exception qubesadmin.exc.QubesVMNotPausedError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMNotStartedError

Domain is not paused.

This exception is thrown when machine should be paused, but is not.

exception qubesadmin.exc.QubesVMNotRunningError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMNotStartedError

Domain is not running.

This exception is thrown when machine should be running but is either halted or paused.

exception qubesadmin.exc.QubesVMNotStartedError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

Domain is not started.

This exception is thrown when machine is halted, but should be started (that is, either running or paused).

exception qubesadmin.exc.QubesVMNotSuspendedError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

Domain is not suspended.

This exception is thrown when machine should be suspended but is either halted or running.

exception qubesadmin.exc.QubesVMShutdownTimeout(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesVMError

Domain shutdown haven’t completed in expected timeframe

exception qubesadmin.exc.QubesValueError(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException, ValueError

Cannot set some value, because it is invalid, out of bounds, etc.

exception qubesadmin.exc.StoragePoolException(message_format, *args, **kwargs)[source]

Bases: qubesadmin.exc.QubesException

A general storage exception

qubesadmin.features module

VM features interface

class qubesadmin.features.Features(vm)[source]

Bases: object

Manager of the features.

Features can have three distinct values: no value (not present in mapping, which is closest thing to None), empty string (which is interpreted as False) and non-empty string, which is True. Anything assigned to the mapping is coerced to strings, however if you assign instances of bool, they are converted as described above. Be aware that assigning the number 0 (which is considered false in Python) will result in string ‘0’, which is considered true.

check_with_template(feature, default=<object object>)[source]

Check if the vm’s template has the specified feature.

get(item, default=<object object>)[source]

Get a feature, return default value if missing.

items()[source]

Return iterable of pairs (feature, value)

keys()

qubesadmin.firewall module

Firewall configuration interface

class qubesadmin.firewall.Action(value)[source]

Bases: qubesadmin.firewall.RuleChoice

Rule action

accept = 'accept'
drop = 'drop'
rule

API representation of this rule element

class qubesadmin.firewall.Comment(value)[source]

Bases: qubesadmin.firewall.RuleOption

User comment

rule

API representation of this rule element

class qubesadmin.firewall.DstHost(value, prefixlen=None)[source]

Bases: qubesadmin.firewall.RuleOption

Represent host/network address: either IPv4, IPv6, or DNS name

rule

API representation of this rule element

class qubesadmin.firewall.DstPorts(value)[source]

Bases: qubesadmin.firewall.RuleOption

Destination port(s), for TCP/UDP only

rule

API representation of this rule element

class qubesadmin.firewall.Expire(value)[source]

Bases: qubesadmin.firewall.RuleOption

Rule expire time

expired

Has this rule expired already?

pretty_value

Human readable representation

rule

API representation of this rule element

class qubesadmin.firewall.Firewall(vm)[source]

Bases: object

Firewal manager for a VM

load_rules()[source]

Force (re-)loading firewall rules

policy

Default action to take if no rule matches

reload()[source]

Force reload the same firewall rules.

Can be used for example to force again names resolution.

rules

Firewall rules

You can either copy them, edit and then assign new rules list to this property, or edit in-place and call save_rules(). Once rules are loaded, they are cached. To reload rules, call load_rules().

save_rules(rules=None)[source]

Save firewall rules. Needs to be called after in-place editing rules.

class qubesadmin.firewall.IcmpType(value)[source]

Bases: qubesadmin.firewall.RuleOption

ICMP packet type

rule

API representation of this rule element

class qubesadmin.firewall.Proto(value)[source]

Bases: qubesadmin.firewall.RuleChoice

Protocol name

icmp = 'icmp'
rule

API representation of this rule element

tcp = 'tcp'
udp = 'udp'
class qubesadmin.firewall.Rule(rule, **kwargs)[source]

Bases: object

A single firewall rule

action

rule action

comment

User comment

dsthost

destination host/network

dstports

‘Destination port(s) (for ‘tcp’ and ‘udp’ protocol only)

expire

Timestamp (UNIX epoch) on which this rule expire

icmptype

ICMP packet type (for ‘icmp’ protocol only)

proto

protocol to match

rule

API representation of this rule

specialtarget

Special target, for now only ‘dns’ supported

class qubesadmin.firewall.RuleChoice(value)[source]

Bases: qubesadmin.firewall.RuleOption

Base class for multiple-choices rule elements

class qubesadmin.firewall.RuleOption(value)[source]

Bases: object

Base class for a single rule element

pretty_value

Human readable representation

rule

API representation of this rule element

class qubesadmin.firewall.SpecialTarget(value)[source]

Bases: qubesadmin.firewall.RuleChoice

Special destination

dns = 'dns'
rule

API representation of this rule element

qubesadmin.label module

VM Labels

class qubesadmin.label.Label(app, name)[source]

Bases: object

Label definition for virtual machines

Label specifies colour of the padlock displayed next to VM’s name.

Parameters:
  • color (str) – colour specification as in HTML (#abcdef)
  • name (str) – label’s name like “red” or “green”
color

color specification as in HTML (#abcdef)

icon

freedesktop icon name, suitable for use in PyQt4.QtGui.QIcon.fromTheme()

index

color specification as in HTML (#abcdef)

name

label’s name like “red” or “green”

qubesadmin.log module

Qubes logging routines

See also: qubes.vm.qubesvm.QubesVM.log

qubesadmin.log.enable()[source]

Enable global logging

Use logging module from standard library to log messages.

>>> import qubes.log
>>> qubes.log.enable()          
>>> import logging
>>> logging.warning('Foobar')   
qubesadmin.log.enable_debug()[source]

Enable debug logging

Enable more messages and additional info to message format.

qubesadmin.spinner module

Qubes CLI spinner

A novice asked the master: “In the east there is a great tree-structure that men call `Corporate Headquarters’. It is bloated out of shape with vice presidents and accountants. It issues a multitude of memos, each saying `Go, Hence!’ or `Go, Hither!’ and nobody knows what is meant. Every year new names are put onto the branches, but all to no avail. How can such an unnatural entity be?”

The master replied: “You perceive this immense structure and are disturbed that it has no rational purpose. Can you not take amusement from its endless gyrations? Do you not enjoy the untroubled ease of programming beneath its sheltering branches? Why are you bothered by its uselessness?”

(Geoffrey James, “The Tao of Programming”, 7.1)

class qubesadmin.spinner.AbstractSpinner(stream, charset='-\|/')[source]

Bases: object

The base class for all Spinners

Parameters:
  • stream – file-like object with .write() method
  • charset (str) – the sequence of characters to display
The spinner should be used as follows:
  1. exactly one call to show()
  2. zero or more calls to update()
  3. exactly one call to hide()
hide()[source]

Hide the spinner and the prompt

show(prompt)[source]

Show the spinner, with a prompt

Parameters:prompt (str) – prompt, like “please wait”
update()[source]

Show next spinner character

class qubesadmin.spinner.DummySpinner(stream, charset='-\|/')[source]

Bases: qubesadmin.spinner.AbstractSpinner

Dummy spinner, does not do anything

hide()[source]

Hide the spinner and the prompt

show(prompt)[source]

Show the spinner, with a prompt

Parameters:prompt (str) – prompt, like “please wait”
update()[source]

Show next spinner character

class qubesadmin.spinner.QubesSpinner(*args, **kwargs)[source]

Bases: qubesadmin.spinner.AbstractSpinner

Basic spinner

This spinner uses standard ASCII control characters

hide()[source]

Hide the spinner and the prompt

show(prompt)[source]

Show the spinner, with a prompt

Parameters:prompt (str) – prompt, like “please wait”
update()[source]

Show next spinner character

class qubesadmin.spinner.QubesSpinnerEnterpriseEdition(stream, charset=None)[source]

Bases: qubesadmin.spinner.QubesSpinner

Enterprise spinner

This is tty- and terminfo-aware spinner. Recommended.

hide()[source]

Hide the spinner and the prompt

qubesadmin.storage module

Storage subsystem.

class qubesadmin.storage.Pool(app, name=None)[source]

Bases: object

A Pool is used to manage different kind of volumes (File based/LVM/Btrfs/…).

config

Storage pool config

driver

Storage pool driver

revisions_to_keep

Number of revisions to keep around

size

Storage pool size, in bytes

usage

Space used in the pool, in bytes

volumes

Volumes managed by this pool

class qubesadmin.storage.Volume(app, pool=None, vid=None, vm=None, vm_name=None)[source]

Bases: object

Storage volume.

clone(source)[source]

Clone data from sane volume of another VM.

This function override existing volume content. This operation is implemented for VM volumes - those in vm.volumes collection (not pool.volumes).

Parameters:source – source volume object
import_data(stream)[source]

Import volume data from a given file-like object.

This function override existing volume content

Parameters:stream – file-like object, must support fileno()
is_outdated()[source]

Returns True if this snapshot of a source volume (for `snap_on_start`=True) is outdated.

name

per-VM volume name, if available

pool

Storage volume pool name.

resize(size)[source]

Resize volume.

Currently only extending is supported.

Parameters:size (int) – new size in bytes.
revert(revision)[source]

Revert volume to previous revision

Parameters:revision (str) – Revision identifier to revert to
revisions

Returns iterable containing revision identifiers

revisions_to_keep

Number of revisions to keep around

rw

True if volume is read-write.

save_on_stop

Commit changes to original volume on VM stop.

size

Size of volume, in bytes.

snap_on_start

Create a snapshot from source on VM start.

source

Volume ID of source volume (for snap_on_start).

If None, this volume itself will be used.

usage

Used volume space, in bytes.

vid

Storage volume id, unique within given pool.

qubesadmin.tags module

VM tags interface

class qubesadmin.tags.Tags(vm)[source]

Bases: object

Manager of the tags.

Tags are simple: tag either can be present on qube or not. Tag is a simple string consisting of ASCII alphanumeric characters, plus _ and -.

add(elem)[source]

Add a tag

discard(elem)[source]

Remove a tag if present

remove(elem)[source]

Remove a tag

update(*others)[source]

Add tags from iterable(s)

qubesadmin.utils module

Various utility functions.

qubesadmin.utils.bytes_to_kmg(size)[source]

Convert bytes to human readable format.

qubesadmin.utils.get_entry_point_one(group, name)[source]

Get a single entry point of given type, raise TypeError when there are multiple.

qubesadmin.utils.kbytes_to_kmg(size)[source]

Convert kbytes to human readable format.

qubesadmin.utils.mbytes_to_kmg(size)[source]

Convert mbytes to human readable format.

qubesadmin.utils.parse_size(size)[source]

Parse human readable size into bytes.

qubesadmin.utils.size_to_human(size)[source]

Humane readable size, with 1/10 precision

qubesadmin.utils.updates_vms_status(qvm_collection)[source]

Check whether all VMs have the same check-updates value; if yes, return it; otherwise, return None

qubesadmin.utils.vm_dependencies(app, reference_vm)[source]

Helper function that returns a list of all the places a given VM is used in. Output is a list of tuples (property_holder, property_name), with None as property_holder for global properties

Module contents

Qubes OS management client.