mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Mon Jun 25 16:55:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* include/libvirt/libvirt.h.in, src/libvirt.c, src/libvirt_sym.version, python/generator.py: Added virDomainGetConnect and virNetworkGetConnect to allow us to get the "hidden" connection associated with each domain or network.
This commit is contained in:
@@ -545,6 +545,26 @@ virConnectNumOfDomains(virConnectPtr conn)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* virDomainGetConnect:
|
||||
* @dom: pointer to a domain
|
||||
*
|
||||
* Returns the connection pointer associated with a domain. The
|
||||
* reference counter on the connection is not increased by this
|
||||
* call.
|
||||
*
|
||||
* Returns the virConnectPtr or NULL in case of failure.
|
||||
*/
|
||||
virConnectPtr
|
||||
virDomainGetConnect (virDomainPtr dom)
|
||||
{
|
||||
if (!VIR_IS_DOMAIN (dom)) {
|
||||
virLibDomainError (dom, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
return dom->conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* virDomainCreateLinux:
|
||||
* @conn: pointer to the hypervisor connection
|
||||
@@ -2036,6 +2056,26 @@ virDomainDetachDevice(virDomainPtr domain, char *xml)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* virNetworkGetConnect:
|
||||
* @net: pointer to a network
|
||||
*
|
||||
* Returns the connection pointer associated with a network. The
|
||||
* reference counter on the connection is not increased by this
|
||||
* call.
|
||||
*
|
||||
* Returns the virConnectPtr or NULL in case of failure.
|
||||
*/
|
||||
virConnectPtr
|
||||
virNetworkGetConnect (virNetworkPtr net)
|
||||
{
|
||||
if (!VIR_IS_NETWORK (net)) {
|
||||
virLibNetworkError (net, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
return net->conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* virConnectNumOfNetworks:
|
||||
* @conn: pointer to the hypervisor connection
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
global:
|
||||
virInitialize;
|
||||
virConnectOpen;
|
||||
virConnectOpenReadOnly;
|
||||
virConnectClose;
|
||||
virConnectGetType;
|
||||
virConnectGetVersion;
|
||||
virDomainGetConnect;
|
||||
virConnectListDomains;
|
||||
virConnectNumOfDomains;
|
||||
virConnectOpen;
|
||||
virConnectOpenReadOnly;
|
||||
virDomainCreate;
|
||||
virDomainCreateLinux;
|
||||
virDomainDefineXML;
|
||||
@@ -66,6 +67,7 @@
|
||||
virDomainAttachDevice;
|
||||
virDomainDetachDevice;
|
||||
|
||||
virNetworkGetConnect;
|
||||
virConnectNumOfNetworks;
|
||||
virConnectListNetworks;
|
||||
virConnectNumOfDefinedNetworks;
|
||||
|
||||
Reference in New Issue
Block a user