mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 01:04:59 +00:00
Stub out internal driver entry points for job processing
The internal glue layer for the new pubic API * src/driver.h: Define internal driver API contract * src/libvirt.c, src/libvirt_public.syms: Wire up public API to internal driver API * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c, src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c, src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Stub new entry point
This commit is contained in:
parent
7d575e09e2
commit
92bd859a29
@ -373,6 +373,10 @@ typedef char *
|
|||||||
unsigned int ncpus,
|
unsigned int ncpus,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
|
typedef int
|
||||||
|
(*virDrvDomainGetJobInfo)(virDomainPtr domain,
|
||||||
|
virDomainJobInfoPtr info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _virDriver:
|
* _virDriver:
|
||||||
*
|
*
|
||||||
@ -464,6 +468,7 @@ struct _virDriver {
|
|||||||
virDrvDomainIsPersistent domainIsPersistent;
|
virDrvDomainIsPersistent domainIsPersistent;
|
||||||
virDrvCPUCompare cpuCompare;
|
virDrvCPUCompare cpuCompare;
|
||||||
virDrvCPUBaseline cpuBaseline;
|
virDrvCPUBaseline cpuBaseline;
|
||||||
|
virDrvDomainGetJobInfo domainGetJobInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
|
@ -3404,6 +3404,7 @@ static virDriver esxDriver = {
|
|||||||
esxDomainIsPersistent, /* domainIsPersistent */
|
esxDomainIsPersistent, /* domainIsPersistent */
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -11159,3 +11159,51 @@ error:
|
|||||||
virDispatchError(conn);
|
virDispatchError(conn);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virDomainGetJobInfo:
|
||||||
|
* @domain: a domain object
|
||||||
|
* @info: pointer to a virDomainJobInfo structure allocated by the user
|
||||||
|
*
|
||||||
|
* Extract information about progress of a background job on a domain.
|
||||||
|
* Will return an error if the domain is not active.
|
||||||
|
*
|
||||||
|
* Returns 0 in case of success and -1 in case of failure.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info)
|
||||||
|
{
|
||||||
|
virConnectPtr conn;
|
||||||
|
DEBUG("domain=%p, info=%p", domain, info);
|
||||||
|
|
||||||
|
virResetLastError();
|
||||||
|
|
||||||
|
if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
|
||||||
|
virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||||
|
virDispatchError(NULL);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
if (info == NULL) {
|
||||||
|
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(info, 0, sizeof(virDomainJobInfo));
|
||||||
|
|
||||||
|
conn = domain->conn;
|
||||||
|
|
||||||
|
if (conn->driver->domainGetJobInfo) {
|
||||||
|
int ret;
|
||||||
|
ret = conn->driver->domainGetJobInfo (domain, info);
|
||||||
|
if (ret < 0)
|
||||||
|
goto error;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||||
|
|
||||||
|
error:
|
||||||
|
virDispatchError(domain->conn);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
@ -354,6 +354,7 @@ LIBVIRT_0.7.7 {
|
|||||||
virDomainAttachDeviceFlags;
|
virDomainAttachDeviceFlags;
|
||||||
virDomainDetachDeviceFlags;
|
virDomainDetachDeviceFlags;
|
||||||
virConnectBaselineCPU;
|
virConnectBaselineCPU;
|
||||||
|
virDomainGetJobInfo;
|
||||||
} LIBVIRT_0.7.5;
|
} LIBVIRT_0.7.5;
|
||||||
|
|
||||||
# .... define new API here using predicted next version number ....
|
# .... define new API here using predicted next version number ....
|
||||||
|
@ -2451,6 +2451,7 @@ static virDriver lxcDriver = {
|
|||||||
lxcDomainIsPersistent,
|
lxcDomainIsPersistent,
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virStateDriver lxcStateDriver = {
|
static virStateDriver lxcStateDriver = {
|
||||||
|
@ -786,6 +786,7 @@ static virDriver oneDriver = {
|
|||||||
NULL, /* domainIsPersistent */
|
NULL, /* domainIsPersistent */
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virStateDriver oneStateDriver = {
|
static virStateDriver oneStateDriver = {
|
||||||
|
@ -1538,6 +1538,7 @@ static virDriver openvzDriver = {
|
|||||||
openvzDomainIsPersistent,
|
openvzDomainIsPersistent,
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
int openvzRegister(void) {
|
int openvzRegister(void) {
|
||||||
|
@ -1654,6 +1654,7 @@ virDriver phypDriver = {
|
|||||||
NULL, /* domainIsPersistent */
|
NULL, /* domainIsPersistent */
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -8773,6 +8773,7 @@ static virDriver qemuDriver = {
|
|||||||
qemuDomainIsPersistent,
|
qemuDomainIsPersistent,
|
||||||
qemuCPUCompare, /* cpuCompare */
|
qemuCPUCompare, /* cpuCompare */
|
||||||
qemuCPUBaseline, /* cpuBaseline */
|
qemuCPUBaseline, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -9060,6 +9060,7 @@ static virDriver remote_driver = {
|
|||||||
remoteDomainIsPersistent, /* domainIsPersistent */
|
remoteDomainIsPersistent, /* domainIsPersistent */
|
||||||
remoteCPUCompare, /* cpuCompare */
|
remoteCPUCompare, /* cpuCompare */
|
||||||
remoteCPUBaseline, /* cpuBaseline */
|
remoteCPUBaseline, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virNetworkDriver network_driver = {
|
static virNetworkDriver network_driver = {
|
||||||
|
@ -5243,6 +5243,7 @@ static virDriver testDriver = {
|
|||||||
testDomainIsPersistent, /* domainIsPersistent */
|
testDomainIsPersistent, /* domainIsPersistent */
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virNetworkDriver testNetworkDriver = {
|
static virNetworkDriver testNetworkDriver = {
|
||||||
|
@ -1920,6 +1920,7 @@ static virDriver umlDriver = {
|
|||||||
umlDomainIsPersistent,
|
umlDomainIsPersistent,
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -7063,6 +7063,7 @@ virDriver NAME(Driver) = {
|
|||||||
vboxDomainIsPersistent,
|
vboxDomainIsPersistent,
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
virNetworkDriver NAME(NetworkDriver) = {
|
virNetworkDriver NAME(NetworkDriver) = {
|
||||||
|
@ -1904,6 +1904,7 @@ static virDriver xenUnifiedDriver = {
|
|||||||
xenUnifiedDomainisPersistent,
|
xenUnifiedDomainisPersistent,
|
||||||
NULL, /* cpuCompare */
|
NULL, /* cpuCompare */
|
||||||
NULL, /* cpuBaseline */
|
NULL, /* cpuBaseline */
|
||||||
|
NULL, /* domainGetJobInfo */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user