aboutsummaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-03-19 08:51:06 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-03-19 08:51:06 -0500
commit5c20f4e54a311620861c659dec29d0ee402e8b93 (patch)
tree4e35db5155d8539650df69e629cc1a009ae54579 /error.c
parent46a5801d0cb5f5ed01a4d31c0e7cc581237ed5ce (diff)
parente1c37d0e94048502f9874e6356ce7136d4b05bdb (diff)
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp: qapi: Convert migrate Purge migration of (almost) everything to do with monitors Error: Introduce error_copy() QError: Introduce new errors for the migration command
Diffstat (limited to 'error.c')
-rw-r--r--error.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/error.c b/error.c
index 990050f792..d3455ab9e6 100644
--- a/error.c
+++ b/error.c
@@ -43,6 +43,19 @@ void error_set(Error **errp, const char *fmt, ...)
*errp = err;
}
+Error *error_copy(const Error *err)
+{
+ Error *err_new;
+
+ err_new = g_malloc0(sizeof(*err));
+ err_new->msg = g_strdup(err->msg);
+ err_new->fmt = err->fmt;
+ err_new->obj = err->obj;
+ QINCREF(err_new->obj);
+
+ return err_new;
+}
+
bool error_is_set(Error **errp)
{
return (errp && *errp);