From 05dc61a970c84f2e9ff387608ec8c3b45569a8ff Mon Sep 17 00:00:00 2001 Message-Id: <05dc61a970c84f2e9ff387608ec8c3b45569a8ff.1367947969.git.minovotn@redhat.com> In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Michal Novotny Date: Tue, 7 May 2013 18:38:36 +0200 Subject: [PATCH 055/114] Revert "error: drop error_get_qobject()/error_set_qobject()" This reverts commit 5ee14c19936781c6385f6c2f3318b28e3e7c80a2. Reverting as asked by Laszlo in message <51892739.2030807@redhat.com> because of the ordering issue (most likely) related to supersed testing. Signed-off-by: Michal Novotny --- error.c | 19 +++++++++++++++++++ error_int.h | 2 ++ qemu-ga.c | 1 + 3 files changed, 22 insertions(+) diff --git a/error.c b/error.c index acf54f3..867eec2 100644 --- a/error.c +++ b/error.c @@ -119,3 +119,22 @@ void error_propagate(Error **dst_err, Error *local_err) error_free(local_err); } } + +QObject *error_get_qobject(Error *err) +{ + QINCREF(err->obj); + return QOBJECT(err->obj); +} + +void error_set_qobject(Error **errp, QObject *obj) +{ + Error *err; + if (errp == NULL) { + return; + } + err = qemu_mallocz(sizeof(*err)); + err->obj = qobject_to_qdict(obj); + qobject_incref(obj); + + *errp = err; +} diff --git a/error_int.h b/error_int.h index 8bf36b5..5e39424 100644 --- a/error_int.h +++ b/error_int.h @@ -23,5 +23,7 @@ * These are used to convert QErrors to Errors */ QDict *error_get_data(Error *err); +QObject *error_get_qobject(Error *err); +void error_set_qobject(Error **errp, QObject *obj); #endif diff --git a/qemu-ga.c b/qemu-ga.c index 919170f..e3c1929 100644 --- a/qemu-ga.c +++ b/qemu-ga.c @@ -28,6 +28,7 @@ #include "module.h" #include "signal.h" #include "qerror.h" +#include "error_int.h" #include "qapi/qmp-core.h" #include "qga/channel.h" #ifdef _WIN32 -- 1.7.11.7