mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
Internal driver API for sVirt support (James Morris & Dan Walsh)
This commit is contained in:
parent
0b7860ecdd
commit
8d13558ae6
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
Tue Mar 3 09:12:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
Internal driver API for sVirt support (James Morris & Dan Walsh)
|
||||
* src/driver.h: Internal typedefs for virNodeGetSecurityModel()
|
||||
and virDomainGetSecurityLabel() driver entry points
|
||||
* src/libvirt.c: Implement entry point for new public APIs
|
||||
virNodeGetSecurityModel() and virDomainGetSecurityLabel()
|
||||
* src/lxc_driver.c, src/openvz_driver.c, src/qemu_driver.c,
|
||||
src/test.c, src/uml_driver.c: Update for new driver entry
|
||||
points
|
||||
* python/generator.py: temporarily blacklist non-generated
|
||||
virNodeGetSecurityModel() and virDomainGetSecurityLabel()
|
||||
|
||||
Tue Mar 3 09:10:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
Public API for sVirt support (James Morris & Dan Walsh)
|
||||
|
@ -342,6 +342,8 @@ skip_function = (
|
||||
'virCopyLastError', # Python API is called virGetLastError instead
|
||||
'virConnectOpenAuth', # Python C code is manually written
|
||||
'virDefaultErrorFunc', # Python virErrorFuncHandler impl calls this from C
|
||||
'virDomainGetSecurityLabel', # Needs investigation...
|
||||
'virNodeGetSecurityModel', # Needs investigation...
|
||||
'virConnectDomainEventRegister', # overridden in virConnect.py
|
||||
'virConnectDomainEventDeregister', # overridden in virConnect.py
|
||||
'virSaveLastError', # We have our own python error wrapper
|
||||
|
@ -180,6 +180,13 @@ typedef int
|
||||
int maplen);
|
||||
typedef int
|
||||
(*virDrvDomainGetMaxVcpus) (virDomainPtr domain);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainGetSecurityLabel) (virDomainPtr domain,
|
||||
virSecurityLabelPtr seclabel);
|
||||
typedef int
|
||||
(*virDrvNodeGetSecurityModel) (virConnectPtr conn,
|
||||
virSecurityModelPtr secmodel);
|
||||
typedef int
|
||||
(*virDrvDomainAttachDevice) (virDomainPtr domain,
|
||||
const char *xml);
|
||||
@ -371,6 +378,8 @@ struct _virDriver {
|
||||
virDrvDomainPinVcpu domainPinVcpu;
|
||||
virDrvDomainGetVcpus domainGetVcpus;
|
||||
virDrvDomainGetMaxVcpus domainGetMaxVcpus;
|
||||
virDrvDomainGetSecurityLabel domainGetSecurityLabel;
|
||||
virDrvNodeGetSecurityModel nodeGetSecurityModel;
|
||||
virDrvDomainDumpXML domainDumpXML;
|
||||
virDrvListDefinedDomains listDefinedDomains;
|
||||
virDrvNumOfDefinedDomains numOfDefinedDomains;
|
||||
|
@ -4174,6 +4174,70 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* virDomainGetSecurityLabel:
|
||||
* @domain: a domain object
|
||||
* @seclabel: pointer to a virSecurityLabel structure
|
||||
*
|
||||
* Extract security label of an active domain.
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of failure, and -2
|
||||
* if the operation is not supported (caller decides if that's
|
||||
* an error).
|
||||
*/
|
||||
int
|
||||
virDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel)
|
||||
{
|
||||
virConnectPtr conn;
|
||||
|
||||
if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
|
||||
virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (seclabel == NULL) {
|
||||
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
conn = domain->conn;
|
||||
|
||||
if (conn->driver->domainGetSecurityLabel)
|
||||
return conn->driver->domainGetSecurityLabel(domain, seclabel);
|
||||
|
||||
virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/**
|
||||
* virNodeGetSecurityModel:
|
||||
* @conn: a connection object
|
||||
* @secmodel: pointer to a virSecurityModel structure
|
||||
*
|
||||
* Extract the security model of a hypervisor.
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of failure, and -2 if the
|
||||
* operation is not supported (caller decides if that's an error).
|
||||
*/
|
||||
int
|
||||
virNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
|
||||
{
|
||||
if (!VIR_IS_CONNECT(conn)) {
|
||||
virLibConnError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (secmodel == NULL) {
|
||||
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (conn->driver->nodeGetSecurityModel)
|
||||
return conn->driver->nodeGetSecurityModel(conn, secmodel);
|
||||
|
||||
virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/**
|
||||
* virDomainAttachDevice:
|
||||
|
@ -1429,6 +1429,8 @@ static virDriver lxcDriver = {
|
||||
NULL, /* domainPinVcpu */
|
||||
NULL, /* domainGetVcpus */
|
||||
NULL, /* domainGetMaxVcpus */
|
||||
NULL, /* domainGetSecurityLabel */
|
||||
NULL, /* nodeGetSecurityModel */
|
||||
lxcDomainDumpXML, /* domainDumpXML */
|
||||
lxcListDefinedDomains, /* listDefinedDomains */
|
||||
lxcNumDefinedDomains, /* numOfDefinedDomains */
|
||||
|
@ -1299,6 +1299,8 @@ static virDriver openvzDriver = {
|
||||
NULL, /* domainPinVcpu */
|
||||
NULL, /* domainGetVcpus */
|
||||
openvzDomainGetMaxVcpus, /* domainGetMaxVcpus */
|
||||
NULL, /* domainGetSecurityLabel */
|
||||
NULL, /* nodeGetSecurityModel */
|
||||
openvzDomainDumpXML, /* domainDumpXML */
|
||||
openvzListDefinedDomains, /* listDomains */
|
||||
openvzNumDefinedDomains, /* numOfDomains */
|
||||
|
@ -4743,6 +4743,8 @@ static virDriver qemuDriver = {
|
||||
NULL, /* domainGetVcpus */
|
||||
#endif
|
||||
qemudDomainGetMaxVcpus, /* domainGetMaxVcpus */
|
||||
NULL, /* domainGetSecurityLabel */
|
||||
NULL, /* nodeGetSecurityModel */
|
||||
qemudDomainDumpXML, /* domainDumpXML */
|
||||
qemudListDefinedDomains, /* listDomains */
|
||||
qemudNumDefinedDomains, /* numOfDomains */
|
||||
|
@ -3501,6 +3501,8 @@ static virDriver testDriver = {
|
||||
NULL, /* domainPinVcpu */
|
||||
NULL, /* domainGetVcpus */
|
||||
NULL, /* domainGetMaxVcpus */
|
||||
NULL, /* domainGetSecurityLabel */
|
||||
NULL, /* nodeGetSecurityModel */
|
||||
testDomainDumpXML, /* domainDumpXML */
|
||||
testListDefinedDomains, /* listDefinedDomains */
|
||||
testNumOfDefinedDomains, /* numOfDefinedDomains */
|
||||
|
@ -1854,6 +1854,8 @@ static virDriver umlDriver = {
|
||||
NULL, /* domainPinVcpu */
|
||||
NULL, /* domainGetVcpus */
|
||||
NULL, /* domainGetMaxVcpus */
|
||||
NULL, /* domainGetSecurityLabel */
|
||||
NULL, /* nodeGetSecurityModel */
|
||||
umlDomainDumpXML, /* domainDumpXML */
|
||||
umlListDefinedDomains, /* listDomains */
|
||||
umlNumDefinedDomains, /* numOfDomains */
|
||||
|
Loading…
Reference in New Issue
Block a user