Remove bogus call to dbus_set_error_from_message

The dbus_connection_send_with_reply_and_block method will
automatically call dbus_set_error_from_message for us. We
mistakenly thought we had todo it because of a flaw in the
systemd unit test mock impl. The latter should have directly
set the error object, instead of creating an error message
object.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2014-03-17 17:38:52 +00:00
parent dc7f3ffc02
commit 217ac43e03
2 changed files with 3 additions and 17 deletions

View File

@ -1321,13 +1321,6 @@ int virDBusCall(DBusConnection *conn,
goto cleanup;
}
if (dbus_set_error_from_message(&error,
reply)) {
virReportDBusServiceError(error.message ? error.message : "unknown error",
error.name);
goto cleanup;
}
ret = 0;
cleanup:

View File

@ -70,16 +70,9 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio
if (STREQ(service, "org.freedesktop.machine1")) {
if (getenv("FAIL_BAD_SERVICE")) {
DBusMessageIter iter;
const char *error_message = "Something went wrong creating the machine";
if (!(reply = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR)))
return NULL;
dbus_message_set_error_name(reply, "org.freedesktop.systemd.badthing");
dbus_message_iter_init_append(reply, &iter);
if (!dbus_message_iter_append_basic(&iter,
DBUS_TYPE_STRING,
&error_message))
goto error;
dbus_set_error_const(error,
"org.freedesktop.systemd.badthing",
"Something went wrong creating the machine");
} else {
reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
}