mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Introduce virErrorCopyNew
A helper function for copying error objects. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
a7c22a1f29
commit
9d0a2af6c2
@ -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 = {
|
||||
|
@ -1365,6 +1365,7 @@ ebtablesRemoveForwardAllowIn;
|
||||
|
||||
# util/virerror.h
|
||||
virDispatchError;
|
||||
virErrorCopyNew;
|
||||
virErrorInitialize;
|
||||
virErrorSetErrnoFromLastError;
|
||||
virLastErrorIsSystemErrno;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user