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:
Richard W.M. Jones
2007-06-25 15:56:18 +00:00
parent 83471f1ec5
commit aa053ba2c5
6 changed files with 75 additions and 2 deletions

View File

@@ -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

View File

@@ -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;