]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add domainIsUpdated to libxl driver
authorMarkus Groß <gross@univention.de>
Wed, 6 Apr 2011 08:58:39 +0000 (10:58 +0200)
committerJim Fehlig <jfehlig@novell.com>
Wed, 6 Apr 2011 21:31:04 +0000 (15:31 -0600)
src/libxl/libxl_driver.c

index 8cc4469007f72c7e53e7c2d445f16fed2b71a0f4..e95c403b5177db985dd0f4108967d04dd0e3e5a2 100644 (file)
@@ -2329,6 +2329,28 @@ libxlDomainIsPersistent(virDomainPtr dom)
     return ret;
 }
 
+static int
+libxlDomainIsUpdated(virDomainPtr dom)
+{
+    libxlDriverPrivatePtr driver = dom->conn->privateData;
+    virDomainObjPtr vm;
+    int ret = -1;
+
+    libxlDriverLock(driver);
+    vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+    libxlDriverUnlock(driver);
+    if (!vm) {
+        libxlError(VIR_ERR_NO_DOMAIN, NULL);
+        goto cleanup;
+    }
+    ret = vm->updated;
+
+cleanup:
+    if (vm)
+        virDomainObjUnlock(vm);
+    return ret;
+}
+
 static int
 libxlDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eventID,
                             virConnectDomainEventGenericCallback callback,
@@ -2456,7 +2478,7 @@ static virDriver libxlDriver = {
     NULL,                       /* IsSecure */
     libxlDomainIsActive,        /* DomainIsActive */
     libxlDomainIsPersistent,    /* DomainIsPersistent */
-    NULL,                       /* domainIsUpdated */
+    libxlDomainIsUpdated,       /* domainIsUpdated */
     NULL,                       /* cpuCompare */
     NULL,                       /* cpuBaseline */
     NULL,                       /* domainGetJobInfo */