1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

Implementations of virDomainIsUpdated for drivers except qemu

Except LXC and UML driver, implementations of all other drivers
simply return 0, because these drivers doesn't have config both
in memory and on disk, no need to track if the domain of these
drivers updated or not.

Rename "xenUnifiedDomainisPersistent" to "xenUnifiedDomainIsPersistent"

* esx/esx_driver.c
* lxc/lxc_driver.c
* opennebula/one_driver.c
* openvz/openvz_driver.c
* phyp/phyp_driver.c
* test/test_driver.c
* uml/uml_driver.c
* vbox/vbox_tmpl.c
* xen/xen_driver.c
* xenapi/xenapi_driver.c
This commit is contained in:
Osier Yang 2010-11-24 15:43:15 +08:00 committed by Eric Blake
parent c1fb916618
commit f3605b33a1
10 changed files with 94 additions and 13 deletions

View File

@ -3765,7 +3765,11 @@ esxDomainIsPersistent(virDomainPtr domain ATTRIBUTE_UNUSED)
return 1;
}
static int
esxDomainIsUpdated(virDomainPtr domain ATTRIBUTE_UNUSED)
{
return 0;
}
static virDomainSnapshotPtr
esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
@ -4360,7 +4364,7 @@ static virDriver esxDriver = {
esxIsSecure, /* isSecure */
esxDomainIsActive, /* domainIsActive */
esxDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
esxDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -325,6 +325,29 @@ cleanup:
return ret;
}
static int lxcDomainIsUpdated(virDomainPtr dom)
{
lxc_driver_t *driver = dom->conn->privateData;
virDomainObjPtr obj;
int ret = -1;
lxcDriverLock(driver);
obj = virDomainFindByUUID(&driver->domains, dom->uuid);
lxcDriverUnlock(driver);
if (!obj) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
lxcError(VIR_ERR_NO_DOMAIN,
_("No domain with matching uuid '%s'"), uuidstr);
goto cleanup;
}
ret = obj->updated;
cleanup:
if (obj)
virDomainObjUnlock(obj);
return ret;
}
static int lxcListDomains(virConnectPtr conn, int *ids, int nids) {
lxc_driver_t *driver = conn->privateData;
@ -2882,7 +2905,7 @@ static virDriver lxcDriver = {
lxcIsSecure, /* isSecure */
lxcDomainIsActive, /* domainIsActive */
lxcDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
lxcDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -106,6 +106,10 @@ static int oneIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
return 0;
}
static int oneIsUpdated(virDomainPtr conn ATTRIBUTE_UNUSED)
{
return 0;
}
static virDomainPtr oneDomainLookupByID(virConnectPtr conn,
int id)
@ -800,7 +804,7 @@ static virDriver oneDriver = {
oneIsSecure, /* isSecure */
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* domainIsUpdated */
oneIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -459,6 +459,10 @@ cleanup:
return ret;
}
static int openvzDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
{
return 0;
}
static char *openvzDomainDumpXML(virDomainPtr dom, int flags) {
struct openvz_driver *driver = dom->conn->privateData;
@ -1670,7 +1674,7 @@ static virDriver openvzDriver = {
openvzIsSecure,
openvzDomainIsActive,
openvzDomainIsPersistent,
NULL, /* domainIsUpdated */
openvzDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -1277,6 +1277,11 @@ phypIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
return 1;
}
static int
phypIsUpdated(virDomainPtr conn ATTRIBUTE_UNUSED)
{
return 0;
}
/* return the lpar_id given a name and a managed system name */
static int
@ -4021,7 +4026,7 @@ static virDriver phypDriver = {
phypIsSecure, /* isSecure */
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* domainIsUpdated */
phypIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -1295,6 +1295,11 @@ cleanup:
return ret;
}
static int testDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
{
return 0;
}
static virDomainPtr
testDomainCreateXML(virConnectPtr conn, const char *xml,
unsigned int flags)
@ -5413,7 +5418,7 @@ static virDriver testDriver = {
testIsSecure, /* isEncrypted */
testDomainIsActive, /* domainIsActive */
testDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
testDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -1236,6 +1236,26 @@ cleanup:
return ret;
}
static int umlDomainIsUpdated(virDomainPtr dom)
{
struct uml_driver *driver = dom->conn->privateData;
virDomainObjPtr obj;
int ret = -1;
umlDriverLock(driver);
obj = virDomainFindByUUID(&driver->domains, dom->uuid);
umlDriverUnlock(driver);
if (!obj) {
umlReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
ret = obj->updated;
cleanup:
if (obj)
virDomainObjUnlock(obj);
return ret;
}
static int umlGetVersion(virConnectPtr conn, unsigned long *version) {
struct uml_driver *driver = conn->privateData;
@ -2248,7 +2268,7 @@ static virDriver umlDriver = {
umlIsSecure, /* isSecure */
umlDomainIsActive, /* domainIsActive */
umlDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
umlDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -1347,6 +1347,10 @@ static int vboxDomainIsPersistent(virDomainPtr dom ATTRIBUTE_UNUSED) {
}
static int vboxDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED) {
return 0;
}
static int vboxDomainSuspend(virDomainPtr dom) {
VBOX_OBJECT_CHECK(dom->conn, int, -1);
IMachine *machine = NULL;
@ -8451,7 +8455,7 @@ virDriver NAME(Driver) = {
vboxIsSecure, /* isSecure */
vboxDomainIsActive, /* domainIsActive */
vboxDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
vboxDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -740,7 +740,7 @@ xenUnifiedDomainIsActive(virDomainPtr dom)
}
static int
xenUnifiedDomainisPersistent(virDomainPtr dom)
xenUnifiedDomainIsPersistent(virDomainPtr dom)
{
GET_PRIVATE(dom->conn);
virDomainPtr currdom = NULL;
@ -790,6 +790,12 @@ done:
return ret;
}
static int
xenUnifiedDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
{
return 0;
}
static int
xenUnifiedDomainSuspend (virDomainPtr dom)
{
@ -2069,8 +2075,8 @@ static virDriver xenUnifiedDriver = {
xenUnifiedIsEncrypted, /* isEncrypted */
xenUnifiedIsSecure, /* isSecure */
xenUnifiedDomainIsActive, /* domainIsActive */
xenUnifiedDomainisPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
xenUnifiedDomainIsPersistent, /* domainIsPersistent */
xenUnifiedDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */

View File

@ -1745,6 +1745,12 @@ xenapiNodeGetFreeMemory (virConnectPtr conn)
return freeMem;
}
static int
xenapiDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
{
return 0;
}
/*
* xenapiNodeGetCellsFreeMemory
*
@ -1847,7 +1853,7 @@ static virDriver xenapiDriver = {
NULL, /* isSecure */
NULL, /* domainIsActive */
NULL, /* domainIsPersistent */
NULL, /* domainIsUpdated */
xenapiDomainIsUpdated, /* domainIsUpdated */
NULL, /* cpuCompare */
NULL, /* cpuBaseline */
NULL, /* domainGetJobInfo */