mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Revert "dbus: correctly build reply message"
This reverts commit 39dded7bb6
.
This commit broke virpolkittest on Ubuntu 18 which has an old
dbus (v1.12.2). Any other distro with the recent one works
(v1.12.16) which hints its a bug in dbus somewhere. Revert the
commit to stop tickling it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
6bb4242d9f
commit
5ae24a13c7
@ -1456,7 +1456,6 @@ int virDBusCreateMethod(DBusMessage **call,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* virDBusCreateReplyV:
|
* virDBusCreateReplyV:
|
||||||
* @msg: the message to reply to
|
|
||||||
* @reply: pointer to be filled with a method reply message
|
* @reply: pointer to be filled with a method reply message
|
||||||
* @types: type signature for following method arguments
|
* @types: type signature for following method arguments
|
||||||
* @args: method arguments
|
* @args: method arguments
|
||||||
@ -1469,14 +1468,13 @@ int virDBusCreateMethod(DBusMessage **call,
|
|||||||
* as variadic args. See virDBusCreateMethodV for a
|
* as variadic args. See virDBusCreateMethodV for a
|
||||||
* description of this parameter.
|
* description of this parameter.
|
||||||
*/
|
*/
|
||||||
int virDBusCreateReplyV(DBusMessage *msg,
|
int virDBusCreateReplyV(DBusMessage **reply,
|
||||||
DBusMessage **reply,
|
|
||||||
const char *types,
|
const char *types,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(*reply = dbus_message_new_method_return(msg))) {
|
if (!(*reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN))) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1495,7 +1493,6 @@ int virDBusCreateReplyV(DBusMessage *msg,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* virDBusCreateReply:
|
* virDBusCreateReply:
|
||||||
* @msg: the message to reply to
|
|
||||||
* @reply: pointer to be filled with a method reply message
|
* @reply: pointer to be filled with a method reply message
|
||||||
* @types: type signature for following method arguments
|
* @types: type signature for following method arguments
|
||||||
* @...: method arguments
|
* @...: method arguments
|
||||||
@ -1503,15 +1500,14 @@ int virDBusCreateReplyV(DBusMessage *msg,
|
|||||||
* See virDBusCreateReplyV for a description of the
|
* See virDBusCreateReplyV for a description of the
|
||||||
* behaviour of this method.
|
* behaviour of this method.
|
||||||
*/
|
*/
|
||||||
int virDBusCreateReply(DBusMessage *msg,
|
int virDBusCreateReply(DBusMessage **reply,
|
||||||
DBusMessage **reply,
|
|
||||||
const char *types, ...)
|
const char *types, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
va_start(args, types);
|
va_start(args, types);
|
||||||
ret = virDBusCreateReplyV(msg, reply, types, args);
|
ret = virDBusCreateReplyV(reply, types, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1815,8 +1811,7 @@ int virDBusCreateMethodV(DBusMessage **call ATTRIBUTE_UNUSED,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int virDBusCreateReplyV(DBusMessage *msg ATTRIBUTE_UNUSED,
|
int virDBusCreateReplyV(DBusMessage **reply ATTRIBUTE_UNUSED,
|
||||||
DBusMessage **reply ATTRIBUTE_UNUSED,
|
|
||||||
const char *types ATTRIBUTE_UNUSED,
|
const char *types ATTRIBUTE_UNUSED,
|
||||||
va_list args ATTRIBUTE_UNUSED)
|
va_list args ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
@ -1825,8 +1820,7 @@ int virDBusCreateReplyV(DBusMessage *msg ATTRIBUTE_UNUSED,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int virDBusCreateReply(DBusMessage *msg ATTRIBUTE_UNUSED,
|
int virDBusCreateReply(DBusMessage **reply ATTRIBUTE_UNUSED,
|
||||||
DBusMessage **reply ATTRIBUTE_UNUSED,
|
|
||||||
const char *types ATTRIBUTE_UNUSED, ...)
|
const char *types ATTRIBUTE_UNUSED, ...)
|
||||||
{
|
{
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@ -52,11 +52,9 @@ int virDBusCreateMethodV(DBusMessage **call,
|
|||||||
const char *member,
|
const char *member,
|
||||||
const char *types,
|
const char *types,
|
||||||
va_list args);
|
va_list args);
|
||||||
int virDBusCreateReply(DBusMessage *msg,
|
int virDBusCreateReply(DBusMessage **reply,
|
||||||
DBusMessage **reply,
|
|
||||||
const char *types, ...);
|
const char *types, ...);
|
||||||
int virDBusCreateReplyV(DBusMessage *msg,
|
int virDBusCreateReplyV(DBusMessage **reply,
|
||||||
DBusMessage **reply,
|
|
||||||
const char *types,
|
const char *types,
|
||||||
va_list args);
|
va_list args);
|
||||||
|
|
||||||
|
@ -150,8 +150,7 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_reply_and_block,
|
|||||||
if (nargs == 1 &&
|
if (nargs == 1 &&
|
||||||
STREQ(type, "ipv4") &&
|
STREQ(type, "ipv4") &&
|
||||||
STREQ(args[0], "-L")) {
|
STREQ(args[0], "-L")) {
|
||||||
if (virDBusCreateReply(message,
|
if (virDBusCreateReply(&reply,
|
||||||
&reply,
|
|
||||||
"s", TEST_FILTER_TABLE_LIST) < 0)
|
"s", TEST_FILTER_TABLE_LIST) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else if (nargs == 3 &&
|
} else if (nargs == 3 &&
|
||||||
@ -159,13 +158,11 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_reply_and_block,
|
|||||||
STREQ(args[0], "-t") &&
|
STREQ(args[0], "-t") &&
|
||||||
STREQ(args[1], "nat") &&
|
STREQ(args[1], "nat") &&
|
||||||
STREQ(args[2], "-L")) {
|
STREQ(args[2], "-L")) {
|
||||||
if (virDBusCreateReply(message,
|
if (virDBusCreateReply(&reply,
|
||||||
&reply,
|
|
||||||
"s", TEST_NAT_TABLE_LIST) < 0)
|
"s", TEST_NAT_TABLE_LIST) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
if (virDBusCreateReply(message,
|
if (virDBusCreateReply(&reply,
|
||||||
&reply,
|
|
||||||
"s", "success") < 0)
|
"s", "success") < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,7 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_reply_and_block,
|
|||||||
VIR_FREE(cancellationId);
|
VIR_FREE(cancellationId);
|
||||||
virStringListFreeCount(details, detailslen);
|
virStringListFreeCount(details, detailslen);
|
||||||
|
|
||||||
if (virDBusCreateReply(message,
|
if (virDBusCreateReply(&reply,
|
||||||
&reply,
|
|
||||||
"(bba&{ss})",
|
"(bba&{ss})",
|
||||||
is_authorized,
|
is_authorized,
|
||||||
is_challenge,
|
is_challenge,
|
||||||
|
Loading…
Reference in New Issue
Block a user