mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00: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:
parent
83471f1ec5
commit
aa053ba2c5
@ -1,3 +1,10 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
Mon Jun 25 14:30:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
Mon Jun 25 14:30:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
||||||
|
|
||||||
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in,
|
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in,
|
||||||
|
@ -295,6 +295,11 @@ int virConnectListDomains (virConnectPtr conn,
|
|||||||
int virConnectNumOfDomains (virConnectPtr conn);
|
int virConnectNumOfDomains (virConnectPtr conn);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get connection from domain.
|
||||||
|
*/
|
||||||
|
virConnectPtr virDomainGetConnect (virDomainPtr domain);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Domain creation and destruction
|
* Domain creation and destruction
|
||||||
*/
|
*/
|
||||||
@ -523,6 +528,11 @@ typedef struct _virNetwork virNetwork;
|
|||||||
*/
|
*/
|
||||||
typedef virNetwork *virNetworkPtr;
|
typedef virNetwork *virNetworkPtr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get connection from network.
|
||||||
|
*/
|
||||||
|
virConnectPtr virNetworkGetConnect (virNetworkPtr network);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List active networks
|
* List active networks
|
||||||
*/
|
*/
|
||||||
|
@ -295,6 +295,11 @@ int virConnectListDomains (virConnectPtr conn,
|
|||||||
int virConnectNumOfDomains (virConnectPtr conn);
|
int virConnectNumOfDomains (virConnectPtr conn);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get connection from domain.
|
||||||
|
*/
|
||||||
|
virConnectPtr virDomainGetConnect (virDomainPtr domain);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Domain creation and destruction
|
* Domain creation and destruction
|
||||||
*/
|
*/
|
||||||
@ -523,6 +528,11 @@ typedef struct _virNetwork virNetwork;
|
|||||||
*/
|
*/
|
||||||
typedef virNetwork *virNetworkPtr;
|
typedef virNetwork *virNetworkPtr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get connection from network.
|
||||||
|
*/
|
||||||
|
virConnectPtr virNetworkGetConnect (virNetworkPtr network);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List active networks
|
* List active networks
|
||||||
*/
|
*/
|
||||||
|
@ -870,6 +870,10 @@ def buildWrappers():
|
|||||||
txt.write("Class %s()\n" % (classname))
|
txt.write("Class %s()\n" % (classname))
|
||||||
classes.write("class %s:\n" % (classname))
|
classes.write("class %s:\n" % (classname))
|
||||||
if classname == "virDomain" or classname == "virNetwork":
|
if classname == "virDomain" or classname == "virNetwork":
|
||||||
|
# NB: Earlier versions of libvirt did not provide
|
||||||
|
# vir{Domain,Network}GetConnect, so we had to explicitly
|
||||||
|
# store the connection object in _conn. In future
|
||||||
|
# we won't need to do this.
|
||||||
classes.write(" def __init__(self, conn, _obj=None):\n")
|
classes.write(" def __init__(self, conn, _obj=None):\n")
|
||||||
else:
|
else:
|
||||||
classes.write(" def __init__(self, _obj=None):\n")
|
classes.write(" def __init__(self, _obj=None):\n")
|
||||||
|
@ -545,6 +545,26 @@ virConnectNumOfDomains(virConnectPtr conn)
|
|||||||
return -1;
|
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:
|
* virDomainCreateLinux:
|
||||||
* @conn: pointer to the hypervisor connection
|
* @conn: pointer to the hypervisor connection
|
||||||
@ -2036,6 +2056,26 @@ virDomainDetachDevice(virDomainPtr domain, char *xml)
|
|||||||
return -1;
|
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:
|
* virConnectNumOfNetworks:
|
||||||
* @conn: pointer to the hypervisor connection
|
* @conn: pointer to the hypervisor connection
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
global:
|
global:
|
||||||
virInitialize;
|
virInitialize;
|
||||||
|
virConnectOpen;
|
||||||
|
virConnectOpenReadOnly;
|
||||||
virConnectClose;
|
virConnectClose;
|
||||||
virConnectGetType;
|
virConnectGetType;
|
||||||
virConnectGetVersion;
|
virConnectGetVersion;
|
||||||
|
virDomainGetConnect;
|
||||||
virConnectListDomains;
|
virConnectListDomains;
|
||||||
virConnectNumOfDomains;
|
virConnectNumOfDomains;
|
||||||
virConnectOpen;
|
|
||||||
virConnectOpenReadOnly;
|
|
||||||
virDomainCreate;
|
virDomainCreate;
|
||||||
virDomainCreateLinux;
|
virDomainCreateLinux;
|
||||||
virDomainDefineXML;
|
virDomainDefineXML;
|
||||||
@ -66,6 +67,7 @@
|
|||||||
virDomainAttachDevice;
|
virDomainAttachDevice;
|
||||||
virDomainDetachDevice;
|
virDomainDetachDevice;
|
||||||
|
|
||||||
|
virNetworkGetConnect;
|
||||||
virConnectNumOfNetworks;
|
virConnectNumOfNetworks;
|
||||||
virConnectListNetworks;
|
virConnectListNetworks;
|
||||||
virConnectNumOfDefinedNetworks;
|
virConnectNumOfDefinedNetworks;
|
||||||
|
Loading…
Reference in New Issue
Block a user