]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Introduce virErrorCopyNew
authorJiri Denemark <jdenemar@redhat.com>
Fri, 10 Jul 2015 06:44:41 +0000 (08:44 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 10 Jul 2015 09:47:13 +0000 (11:47 +0200)
A helper function for copying error objects.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
docs/apibuild.py
src/libvirt_private.syms
src/util/virerror.c
src/util/virerror.h

index 69f991ddd463eeaf0e0d34bc17e25a2cd19b254d..f934fb20e9ae372234d6f981d3306409b3c032c8 100755 (executable)
@@ -102,6 +102,7 @@ ignored_functions = {
   "virDomainMigratePrepare3Params": "private function for migration",
   "virDomainMigrateConfirm3Params": "private function for migration",
   "virDomainMigratePrepareTunnel3Params": "private function for tunnelled migration",
+  "virErrorCopyNew": "private",
 }
 
 ignored_macros = {
index 65168b164d51e9d3a3afb8dfdad2af171e94320f..1a0326844d49c9d4d46bfc0e4860cf6a3bb1000b 100644 (file)
@@ -1365,6 +1365,7 @@ ebtablesRemoveForwardAllowIn;
 
 # util/virerror.h
 virDispatchError;
+virErrorCopyNew;
 virErrorInitialize;
 virErrorSetErrnoFromLastError;
 virLastErrorIsSystemErrno;
index fae627b780bfecc980d77b47e2d46045e91b5cea..60b2e793021b9533fd74baca42254213c80c4147 100644 (file)
@@ -214,6 +214,22 @@ virCopyError(virErrorPtr from,
     return ret;
 }
 
+
+virErrorPtr
+virErrorCopyNew(virErrorPtr err)
+{
+    virErrorPtr ret;
+
+    if (VIR_ALLOC_QUIET(ret) < 0)
+        return NULL;
+
+    if (virCopyError(err, ret) < 0)
+        VIR_FREE(ret);
+
+    return ret;
+}
+
+
 static virErrorPtr
 virLastErrorObject(void)
 {
index baa2d088088508ea4ddf1248eaed4fdfed18bf94..234864812a95c8c757d0acdb6266640e5858b32e 100644 (file)
@@ -185,6 +185,7 @@ void virReportOOMErrorFull(int domcode,
     virRaiseErrorObject(__FILE__, __FUNCTION__, __LINE__, obj)
 
 int virSetError(virErrorPtr newerr);
+virErrorPtr virErrorCopyNew(virErrorPtr err);
 void virDispatchError(virConnectPtr conn);
 const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen);