]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
implement public API virDomainIsUpdated
authorOsier Yang <jyang@redhat.com>
Thu, 18 Nov 2010 11:12:06 +0000 (19:12 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 23 Nov 2010 22:04:41 +0000 (15:04 -0700)
* src/libvirt.c

src/libvirt.c

index eba0deee596865b38270aba766bd9ebeb1d837eb..b4951c233dad3839bc9eb3821ffc93232eeb4d02 100644 (file)
@@ -11438,6 +11438,39 @@ error:
     return -1;
 }
 
+/**
+ * virDomainIsUpdated:
+ * @dom: pointer to the domain object
+ *
+ * Determine if the domain has been updated.
+ *
+ * Returns 1 if updated, 0 if not, -1 on error
+ */
+int virDomainIsUpdated(virDomainPtr dom)
+{
+    DEBUG("dom=%p", dom);
+
+    virResetLastError();
+
+    if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
+        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virDispatchError(NULL);
+        return (-1);
+    }
+    if (dom->conn->driver->domainIsUpdated) {
+        int ret;
+        ret = dom->conn->driver->domainIsUpdated(dom);
+        if (ret < 0)
+            goto error;
+        return ret;
+    }
+
+    virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+    virDispatchError(dom->conn);
+    return -1;
+}
+
 /**
  * virNetworkIsActive:
  * @net: pointer to the network object