提交 92bd859a 编写于 作者: D Daniel P. Berrange

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
上级 7d575e09
......@@ -373,6 +373,10 @@ typedef char *
unsigned int ncpus,
unsigned int flags);
typedef int
(*virDrvDomainGetJobInfo)(virDomainPtr domain,
virDomainJobInfoPtr info);
/**
* _virDriver:
*
......@@ -464,6 +468,7 @@ struct _virDriver {
virDrvDomainIsPersistent domainIsPersistent;
virDrvCPUCompare cpuCompare;
virDrvCPUBaseline cpuBaseline;
virDrvDomainGetJobInfo domainGetJobInfo;
};
typedef int
......
......@@ -3404,6 +3404,7 @@ static virDriver esxDriver = {
esxDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
......
......@@ -11159,3 +11159,51 @@ error:
virDispatchError(conn);
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;
virDomainDetachDeviceFlags;
virConnectBaselineCPU;
virDomainGetJobInfo;
} LIBVIRT_0.7.5;
# .... define new API here using predicted next version number ....
......@@ -2451,6 +2451,7 @@ static virDriver lxcDriver = {
lxcDomainIsPersistent,
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
static virStateDriver lxcStateDriver = {
......
......@@ -786,6 +786,7 @@ static virDriver oneDriver = {
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
static virStateDriver oneStateDriver = {
......
......@@ -1538,6 +1538,7 @@ static virDriver openvzDriver = {
openvzDomainIsPersistent,
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
int openvzRegister(void) {
......
......@@ -1654,6 +1654,7 @@ virDriver phypDriver = {
NULL, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
int
......
......@@ -8773,6 +8773,7 @@ static virDriver qemuDriver = {
qemuDomainIsPersistent,
qemuCPUCompare, /* cpuCompare */
qemuCPUBaseline, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
......
......@@ -9060,6 +9060,7 @@ static virDriver remote_driver = {
remoteDomainIsPersistent, /* domainIsPersistent */
remoteCPUCompare, /* cpuCompare */
remoteCPUBaseline, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
static virNetworkDriver network_driver = {
......
......@@ -5243,6 +5243,7 @@ static virDriver testDriver = {
testDomainIsPersistent, /* domainIsPersistent */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
static virNetworkDriver testNetworkDriver = {
......
......@@ -1920,6 +1920,7 @@ static virDriver umlDriver = {
umlDomainIsPersistent,
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
......
......@@ -7063,6 +7063,7 @@ virDriver NAME(Driver) = {
vboxDomainIsPersistent,
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
virNetworkDriver NAME(NetworkDriver) = {
......
......@@ -1904,6 +1904,7 @@ static virDriver xenUnifiedDriver = {
xenUnifiedDomainisPersistent,
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */
};
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册