From nobody Sat Apr 20 10:25:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567784245; cv=none; d=zoho.com; s=zohoarc; b=m0yTykrJCitaVlZwyk0adsfC82LaPb+dpIR2ltWoUeIYUOeya0uNLlPOQ6rE9++3WM5/Fygjgz1YJvZ9JSR9YaRjFP6XOR9uWqZ08k9xfZVVfhYPYaZmWUODNroFC3xKgbnsIcHQlf2vNUCeeMqXrMJGEuG4QHb8VoPFDaDLtCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567784245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=SeisrbibOkZtpQ7R+/FfZ1nzS6uQZQ9qacbS5/e5fvs=; b=T5byjxh4bOXJOcMMD1hy+aTHFVwdnF8ig7YCtyPXp4ReywuyvIj4/I0FeYj//ki+veVi8/ht/LosxxNfjVTgmoZI5lh/sr6VYxz28BSC8RjcTeh61WOtZY0R1LKawgVZApdpEFJpVGMoGyEPZa/pNxiCSNpymkJUuv4dpWYTNfY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567784245250184.8728151045649; Fri, 6 Sep 2019 08:37:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A32D307D851; Fri, 6 Sep 2019 15:37:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C902C5D9CA; Fri, 6 Sep 2019 15:37:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 92EF124F30; Fri, 6 Sep 2019 15:37:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x86FbJeL020105 for ; Fri, 6 Sep 2019 11:37:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id C31865D9E5; Fri, 6 Sep 2019 15:37:19 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF8D85D9CA; Fri, 6 Sep 2019 15:37:14 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 6 Sep 2019 17:36:32 +0200 Message-Id: <0dab0f8dbdcfa85deb8db0b984509bce683204ac.1567784192.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: marcandre.lureau@redhat.com Subject: [libvirt] [PATCH] Revert "dbus: correctly build reply message" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 06 Sep 2019 15:37:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This reverts commit 39dded7bb61444bb608fadd3f82f6fe93d08fd0e. 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 Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/util/virdbus.c | 18 ++++++------------ src/util/virdbus.h | 6 ++---- tests/virfirewalltest.c | 9 +++------ tests/virpolkittest.c | 3 +-- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/util/virdbus.c b/src/util/virdbus.c index 64513eef14..b0ac8d7055 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -1456,7 +1456,6 @@ int virDBusCreateMethod(DBusMessage **call, =20 /** * virDBusCreateReplyV: - * @msg: the message to reply to * @reply: pointer to be filled with a method reply message * @types: type signature for following method arguments * @args: method arguments @@ -1469,14 +1468,13 @@ int virDBusCreateMethod(DBusMessage **call, * as variadic args. See virDBusCreateMethodV for a * description of this parameter. */ -int virDBusCreateReplyV(DBusMessage *msg, - DBusMessage **reply, +int virDBusCreateReplyV(DBusMessage **reply, const char *types, va_list args) { int ret =3D -1; =20 - if (!(*reply =3D dbus_message_new_method_return(msg))) { + if (!(*reply =3D dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN))) { virReportOOMError(); goto cleanup; } @@ -1495,7 +1493,6 @@ int virDBusCreateReplyV(DBusMessage *msg, =20 /** * virDBusCreateReply: - * @msg: the message to reply to * @reply: pointer to be filled with a method reply message * @types: type signature for following method arguments * @...: method arguments @@ -1503,15 +1500,14 @@ int virDBusCreateReplyV(DBusMessage *msg, * See virDBusCreateReplyV for a description of the * behaviour of this method. */ -int virDBusCreateReply(DBusMessage *msg, - DBusMessage **reply, +int virDBusCreateReply(DBusMessage **reply, const char *types, ...) { va_list args; int ret; =20 va_start(args, types); - ret =3D virDBusCreateReplyV(msg, reply, types, args); + ret =3D virDBusCreateReplyV(reply, types, args); va_end(args); =20 return ret; @@ -1815,8 +1811,7 @@ int virDBusCreateMethodV(DBusMessage **call ATTRIBUTE= _UNUSED, return -1; } =20 -int virDBusCreateReplyV(DBusMessage *msg ATTRIBUTE_UNUSED, - DBusMessage **reply ATTRIBUTE_UNUSED, +int virDBusCreateReplyV(DBusMessage **reply ATTRIBUTE_UNUSED, const char *types ATTRIBUTE_UNUSED, va_list args ATTRIBUTE_UNUSED) { @@ -1825,8 +1820,7 @@ int virDBusCreateReplyV(DBusMessage *msg ATTRIBUTE_UN= USED, return -1; } =20 -int virDBusCreateReply(DBusMessage *msg ATTRIBUTE_UNUSED, - DBusMessage **reply ATTRIBUTE_UNUSED, +int virDBusCreateReply(DBusMessage **reply ATTRIBUTE_UNUSED, const char *types ATTRIBUTE_UNUSED, ...) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/util/virdbus.h b/src/util/virdbus.h index 0303e91045..083c074d59 100644 --- a/src/util/virdbus.h +++ b/src/util/virdbus.h @@ -52,11 +52,9 @@ int virDBusCreateMethodV(DBusMessage **call, const char *member, const char *types, va_list args); -int virDBusCreateReply(DBusMessage *msg, - DBusMessage **reply, +int virDBusCreateReply(DBusMessage **reply, const char *types, ...); -int virDBusCreateReplyV(DBusMessage *msg, - DBusMessage **reply, +int virDBusCreateReplyV(DBusMessage **reply, const char *types, va_list args); =20 diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index e5eeb52175..78685a3bf4 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -150,8 +150,7 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_reply_= and_block, if (nargs =3D=3D 1 && STREQ(type, "ipv4") && STREQ(args[0], "-L")) { - if (virDBusCreateReply(message, - &reply, + if (virDBusCreateReply(&reply, "s", TEST_FILTER_TABLE_LIST) < 0) goto error; } else if (nargs =3D=3D 3 && @@ -159,13 +158,11 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_repl= y_and_block, STREQ(args[0], "-t") && STREQ(args[1], "nat") && STREQ(args[2], "-L")) { - if (virDBusCreateReply(message, - &reply, + if (virDBusCreateReply(&reply, "s", TEST_NAT_TABLE_LIST) < 0) goto error; } else { - if (virDBusCreateReply(message, - &reply, + if (virDBusCreateReply(&reply, "s", "success") < 0) goto error; } diff --git a/tests/virpolkittest.c b/tests/virpolkittest.c index 845ceb1736..ce1ff92bf2 100644 --- a/tests/virpolkittest.c +++ b/tests/virpolkittest.c @@ -123,8 +123,7 @@ VIR_MOCK_WRAP_RET_ARGS(dbus_connection_send_with_reply_= and_block, VIR_FREE(cancellationId); virStringListFreeCount(details, detailslen); =20 - if (virDBusCreateReply(message, - &reply, + if (virDBusCreateReply(&reply, "(bba&{ss})", is_authorized, is_challenge, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list