aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsier Yang <jyang@redhat.com>2010-11-24 15:43:15 +0800
committerEric Blake <eblake@redhat.com>2010-11-24 11:22:30 -0700
commitf3605b33a1289302f62c148fa0d96d17772f970c (patch)
treed283333932819790059900a6598619c35598b63e
parentimplement callback function for qemu driver (diff)
downloadlibvirt-f3605b33a1289302f62c148fa0d96d17772f970c.tar.gz
libvirt-f3605b33a1289302f62c148fa0d96d17772f970c.tar.bz2
libvirt-f3605b33a1289302f62c148fa0d96d17772f970c.zip
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
-rw-r--r--src/esx/esx_driver.c8
-rw-r--r--src/lxc/lxc_driver.c25
-rw-r--r--src/opennebula/one_driver.c6
-rw-r--r--src/openvz/openvz_driver.c6
-rw-r--r--src/phyp/phyp_driver.c7
-rw-r--r--src/test/test_driver.c7
-rw-r--r--src/uml/uml_driver.c22
-rw-r--r--src/vbox/vbox_tmpl.c6
-rw-r--r--src/xen/xen_driver.c12
-rw-r--r--src/xenapi/xenapi_driver.c8
10 files changed, 94 insertions, 13 deletions
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 5c04596db..8ea6219f8 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -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 */
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 886286b52..eb5808683 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -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 */
diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c
index 4fe7f9bf8..a2d9ab3bb 100644
--- a/src/opennebula/one_driver.c
+++ b/src/opennebula/one_driver.c
@@ -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 */
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 5089e37f3..807bb7c09 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -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 */
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 24b426e92..350889136 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -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 */
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index b6838c287..ddff160e2 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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 */
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 6c28c7660..f42a6675d 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -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 */
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 0a7a247c1..ada71b497 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -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 */
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 959cc7d81..4c11b11d1 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -740,7 +740,7 @@ xenUnifiedDomainIsActive(virDomainPtr dom)
}
static int
-xenUnifiedDomainisPersistent(virDomainPtr dom)
+xenUnifiedDomainIsPersistent(virDomainPtr dom)
{
GET_PRIVATE(dom->conn);
virDomainPtr currdom = NULL;
@@ -791,6 +791,12 @@ done:
}
static int
+xenUnifiedDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+static int
xenUnifiedDomainSuspend (virDomainPtr dom)
{
GET_PRIVATE(dom->conn);
@@ -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 */
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index dec2d25d1..6fff27680 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -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 */