LibvirtGObject.Connection¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The connection handle |
||
r/w/co |
The connection URI |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class LibvirtGObject.Connection(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- close()¶
- create_domain(conf)¶
- Parameters:
conf (
LibvirtGConfig.Domain
) – the configuration for the new domain- Raises:
- Returns:
the newly created domain, or
None
if an error occurred. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
Create the configuration file for a new persistent domain. The returned domain will initially be in the shutoff state.
- create_storage_pool(conf, flags)¶
- Parameters:
conf (
LibvirtGConfig.StoragePool
) – the configuration for the new storage poolflags (
int
) – the flags
- Raises:
- Returns:
the newly created storage pool, or
None
if an error occurred. The returned list should be freed with g_list_free(), after its elements have been unreffed withGObject.Object.unref
().- Return type:
- fetch_domains(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation object- Raises:
- Return type:
Use this method to fetch all domains managed by connection self. Use e.g.
LibvirtGObject.Connection.find_domain_by_id
orLibvirtGObject.Connection.get_domain
afterwards to query the fetched domains.
- fetch_domains_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- fetch_domains_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- fetch_interfaces(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation object- Raises:
- Returns:
- Return type:
Use this method to fetch information on all network interfaces managed by connection self on host machine. Use
LibvirtGObject.Connection.get_interfaces
orLibvirtGObject.Connection.get_interface
afterwards to query the fetched interfaces.
- fetch_interfaces_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- fetch_interfaces_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- fetch_networks(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation object- Raises:
- Return type:
Use this method to fetch all networks managed by connection self. Use e.g.
LibvirtGObject.Connection.find_network_by_name
orLibvirtGObject.Connection.get_networks
afterwards to query the fetched domains.
- fetch_networks_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- fetch_networks_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- fetch_storage_pools(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation object- Raises:
- Return type:
Use this method to fetch all storage pools managed by connection self. Use e.g.
LibvirtGObject.Connection.find_storage_pool_by_name
orLibvirtGObject.Connection.get_storage_pools
afterwards to query the fetched pools.
- fetch_storage_pools_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- fetch_storage_pools_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- find_domain_by_id(id)¶
- Parameters:
id (
int
) – id of the requested domain- Returns:
the
LibvirtGObject.Domain
, orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- find_domain_by_name(name)¶
- Parameters:
name (
str
) – name of the requested domain- Returns:
the
LibvirtGObject.Domain
, orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- find_interface_by_mac(macaddr)¶
- Parameters:
macaddr (
str
) – MAC address to lookup- Returns:
A new reference to a
LibvirtGObject.Interface
, orNone
if no interface exists with MAC address mac. The returned object must be unreffed usingGObject.Object.unref
() once used.- Return type:
Get a particular interface which has MAC address mac.
- find_network_by_name(name)¶
- Parameters:
name (
str
) – name of the network to search for- Returns:
A new reference to a
LibvirtGObject.Network
, orNone
if no network exists with name name. The returned object must be unreffed usingGObject.Object.unref
() once used.- Return type:
Get a particular network which has name name.
- find_storage_pool_by_name(name)¶
- Parameters:
name (
str
) – name of the requested storage pool- Returns:
the
LibvirtGObject.StoragePool
, orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_capabilities()¶
- Raises:
- Returns:
a
LibvirtGConfig.Capabilities
orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_capabilities_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- get_capabilities_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Returns:
a
LibvirtGConfig.Capabilities
orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_domain(uuid)¶
- Parameters:
uuid (
str
) – uuid string of the requested domain- Returns:
the
LibvirtGObject.Domain
, orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_domain_capabilities(emulatorbin, arch, machine, virttype, flags)¶
- Parameters:
- Raises:
- Returns:
a
LibvirtGConfig.DomainCapabilities
orNone
. The return object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_domain_capabilities_async(emulatorbin, arch, machine, virttype, flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
int
) – extra flags; not used yet, so callers should always pass 0cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- get_domain_capabilities_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Returns:
a
LibvirtGConfig.DomainCapabilities
orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_domains()¶
- Returns:
List of
LibvirtGObject.Domain
. The returned list should be freed with g_list_free(), after its elements have been unreffed withGObject.Object.unref
().- Return type:
Gets a list of the domains available through self.
- get_hypervisor_name()¶
- Raises:
- Returns:
new string that should be freed when no longer needed, or
None
upon error.- Return type:
Get name of current hypervisor used.
- get_interface(name)¶
- Parameters:
name (
str
) – interface name to lookup- Returns:
A new reference to a
LibvirtGObject.Interface
, orNone
if no interface exists with name name. The returned object must be unreffed usingGObject.Object.unref
() once used.- Return type:
Get a particular interface which has name name.
- get_interfaces()¶
- Returns:
List of
LibvirtGObject.Interface
. The returned list should be freed with g_list_free(), after its elements have been unreffed withGObject.Object.unref
().- Return type:
Get a list of all the network interfaces managed by connection self on host machine.
- get_network(uuid)¶
- Parameters:
uuid (
str
) – UUID of the network to lookup- Returns:
A new reference to a
LibvirtGObject.Network
, orNone
if no network exists with UUID uuid. The returned object must be unreffed usingGObject.Object.unref
() once used.- Return type:
Get a particular network which has UUID uuid.
- get_networks()¶
- Returns:
List of
LibvirtGObject.Network
. The returned list should be freed with g_list_free(), after its elements have been unreffed withGObject.Object.unref
().- Return type:
Get a list of all the network networks available through self.
- get_node_info()¶
- Raises:
- Returns:
the info, or
None
if an error occurred. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_storage_pool(uuid)¶
- Parameters:
uuid (
str
) – uuid string of the requested storage pool- Returns:
the
LibvirtGObject.StoragePool
, orNone
. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_storage_pools()¶
- Returns:
List of
LibvirtGObject.StoragePool
. The returned list should be freed with g_list_free(), after its elements have been unreffed withGObject.Object.unref
().- Return type:
Gets a list of the storage pools available through self.
- get_stream(flags)¶
- Parameters:
flags (
int
) – flags to use for the stream- Returns:
a
LibvirtGObject.Stream
stream, or None.The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
- get_version()¶
- Raises:
- Returns:
version on success, 0 otherwise and err set.
- Return type:
Get version of current hypervisor used.
- open(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation object- Raises:
- Return type:
- open_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- open_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- open_read_only(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) –- Raises:
- Return type:
- open_read_only_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
- open_read_only_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Return type:
- restore_domain_from_file(filename, custom_conf, flags)¶
- Parameters:
filename (
str
) – path to input filecustom_conf (
LibvirtGConfig.Domain
orNone
) – configuration for domain orNone
flags (
int
) – the flags
- Raises:
- Returns:
- Return type:
Restores the domain saved with
LibvirtGObject.Domain.save_to_file
- restore_domain_from_file_async(filename, custom_conf, flags, cancellable, callback, *user_data)¶
- Parameters:
filename (
str
) – path to input filecustom_conf (
LibvirtGConfig.Domain
orNone
) – configuration for domainflags (
int
) – the flagscancellable (
Gio.Cancellable
orNone
) – cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – completion callback
Asynchronous variant of
LibvirtGObject.Connection.restore_domain_from_file
- restore_domain_from_file_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – async method result- Raises:
- Returns:
- Return type:
Finishes the operation started by #gvir_restore_domain_from_file_async.
- start_domain(conf, flags)¶
- Parameters:
conf (
LibvirtGConfig.Domain
) – the configuration for the new domainflags (
int
) –
- Raises:
- Returns:
the newly created domain, or
None
if an error occurred. The returned object should be unreffed withGObject.Object.unref
() when no longer needed.- Return type:
Start a new transient domain without persistent configuration. The returned domain will initially be running.
- do_connection_closed() virtual¶
- do_connection_opened() virtual¶
- do_domain_added(dom) virtual¶
- Parameters:
dom (
LibvirtGObject.Domain
) –
- do_domain_removed(dom) virtual¶
- Parameters:
dom (
LibvirtGObject.Domain
) –
Signal Details¶
- LibvirtGObject.Connection.signals.connection_closed(connection)¶
- Signal Name:
connection-closed
- Flags:
- Parameters:
connection (
LibvirtGObject.Connection
) – The object which received the signal
- LibvirtGObject.Connection.signals.connection_opened(connection)¶
- Signal Name:
connection-opened
- Flags:
- Parameters:
connection (
LibvirtGObject.Connection
) – The object which received the signal
- LibvirtGObject.Connection.signals.domain_added(connection, object)¶
- Signal Name:
domain-added
- Flags:
- Parameters:
connection (
LibvirtGObject.Connection
) – The object which received the signalobject (
LibvirtGObject.Domain
) –
- LibvirtGObject.Connection.signals.domain_removed(connection, object)¶
- Signal Name:
domain-removed
- Flags:
- Parameters:
connection (
LibvirtGObject.Connection
) – The object which received the signalobject (
LibvirtGObject.Domain
) –
Property Details¶
- LibvirtGObject.Connection.props.handle¶
- Name:
handle
- Type:
- Default Value:
- Flags:
The connection handle