mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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:
parent
dc7f3ffc02
commit
217ac43e03
@ -1321,13 +1321,6 @@ int virDBusCall(DBusConnection *conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbus_set_error_from_message(&error,
|
|
||||||
reply)) {
|
|
||||||
virReportDBusServiceError(error.message ? error.message : "unknown error",
|
|
||||||
error.name);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -70,16 +70,9 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio
|
|||||||
|
|
||||||
if (STREQ(service, "org.freedesktop.machine1")) {
|
if (STREQ(service, "org.freedesktop.machine1")) {
|
||||||
if (getenv("FAIL_BAD_SERVICE")) {
|
if (getenv("FAIL_BAD_SERVICE")) {
|
||||||
DBusMessageIter iter;
|
dbus_set_error_const(error,
|
||||||
const char *error_message = "Something went wrong creating the machine";
|
"org.freedesktop.systemd.badthing",
|
||||||
if (!(reply = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR)))
|
"Something went wrong creating the machine");
|
||||||
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;
|
|
||||||
} else {
|
} else {
|
||||||
reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
|
reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user