From nobody Sun Apr 28 12:56:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601630583; cv=none; d=zohomail.com; s=zohoarc; b=DJR1TxoKbFRdmJhSb6h9shbnFWJOy3tK6nxq6PTnEi1Y+GHIvcZJwwLn1TO4rMmKbx5lK1QBpMRqg8V8GW7Cwmq8XbZrXD6VU2NYYKHLU/JQywa3kK/g6sYEs3hTw0/NRCmGqWFmrgUgrr2/bj1eJTPPybXis30iUMhdWAV/u5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601630583; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hr12JFqKKcU4lI0nYGG5Mm0IAsesny+4cRCQGaGAuYw=; b=NQTzabsnbdqw2w7bE5b4dkG8LAU3ztEZ3RV7zoAIdhrirD6ZPt7R1diXioXNGnqIKyV81VL+KkRq2Eeuv0OqGiRWmvUJcmvAJ2ftHxrFxAHTtzSkSglETJKLeZvDxOHQmwg9aZUPeNn4uv4x4myAVnFY/MHq1uJe19N4KNODAl4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601630583895516.942688280861; Fri, 2 Oct 2020 02:23:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-HYEgdEcXM-Kc5Eai2H4_2g-1; Fri, 02 Oct 2020 05:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EF55186DD2C; Fri, 2 Oct 2020 09:22:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23E9B60BE2; Fri, 2 Oct 2020 09:22:20 +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 06EA7181A06B; Fri, 2 Oct 2020 09:22:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0929MGCa018329 for ; Fri, 2 Oct 2020 05:22:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD68B5577C; Fri, 2 Oct 2020 09:22:16 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 109B655784 for ; Fri, 2 Oct 2020 09:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601630582; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hr12JFqKKcU4lI0nYGG5Mm0IAsesny+4cRCQGaGAuYw=; b=is5IB4jVbJEpMndvMPlUBDEJtT0hGk6v/z7UYq/pXRM+UUmB6RF+YvFVraSHB83tB6beUU eHUfvkH0OLo3huxiPAjo4HQUd82x2bLkBVyjaQBIpDmF2J844kMCGX7BaJhTs07FzSBReE 72d689kpCldDjk+Y9vMCCQJiPGMnH4A= X-MC-Unique: HYEgdEcXM-Kc5Eai2H4_2g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] lib: Don't unref message passed to virGDBusCallMethod{WithFD}() Date: Fri, 2 Oct 2020 11:22:06 +0200 Message-Id: <9ab312eb34cf10641de9b097d7a656e8fc2fce7f.1601630385.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The virGDBusCallMethod() and virGDBusCallMethodWithFD() are simple wrappers over g_dbus_connection_call_sync() and g_dbus_connection_call_with_unix_fd_list_sync() respectively. The documentation to these function states that passed parameters (@message in our case) is consumed for 'convenient' inline use of g_variant_new() [1]. But that means we must not unref the message afterwards. To make it explicit that the message is consumed the signature of our wrappers is changed too. 1: https://developer.gnome.org/gio/stable/GDBusConnection.html#g-dbus-conne= ction-call-sync Reported-by: Cole Robinson Signed-off-by: Michal Privoznik --- src/rpc/virnetdaemon.c | 4 ++-- src/util/virfirewalld.c | 16 ++++++++-------- src/util/virgdbus.c | 29 ++++++++++++++++++++--------- src/util/virgdbus.h | 4 ++-- src/util/virpolkit.c | 4 ++-- src/util/virsystemd.c | 23 ++++++++--------------- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 37a5662e04..b42feb7f1e 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -469,7 +469,7 @@ virNetDaemonCallInhibit(virNetDaemonPtr dmn, { g_autoptr(GVariant) reply =3D NULL; g_autoptr(GUnixFDList) replyFD =3D NULL; - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; GDBusConnection *systemBus; int fd; int rc; @@ -494,7 +494,7 @@ virNetDaemonCallInhibit(virNetDaemonPtr dmn, "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "Inhibit", - message, + &message, NULL); =20 if (rc < 0) diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index a94ac7c183..b00f3bf418 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -83,7 +83,7 @@ int virFirewallDGetVersion(unsigned long *version) { GDBusConnection *sysbus =3D virGDBusGetSystemBus(); - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(GVariant) reply =3D NULL; g_autoptr(GVariant) gvar =3D NULL; char *versionStr; @@ -101,7 +101,7 @@ virFirewallDGetVersion(unsigned long *version) "/org/fedoraproject/FirewallD1", "org.freedesktop.DBus.Properties", "Get", - message) < 0) + &message) < 0) return -1; =20 g_variant_get(reply, "(v)", &gvar); @@ -129,7 +129,7 @@ int virFirewallDGetBackend(void) { GDBusConnection *sysbus =3D virGDBusGetSystemBus(); - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(GVariant) reply =3D NULL; g_autoptr(GVariant) gvar =3D NULL; g_autoptr(virError) error =3D NULL; @@ -154,7 +154,7 @@ virFirewallDGetBackend(void) "/org/fedoraproject/FirewallD1/config", "org.freedesktop.DBus.Properties", "Get", - message) < 0) + &message) < 0) return -1; =20 if (error->level =3D=3D VIR_ERR_ERROR) { @@ -273,7 +273,7 @@ virFirewallDApplyRule(virFirewallLayer layer, { const char *ipv =3D virFirewallLayerFirewallDTypeToString(layer); GDBusConnection *sysbus =3D virGDBusGetSystemBus(); - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(GVariant) reply =3D NULL; g_autoptr(virError) error =3D NULL; =20 @@ -304,7 +304,7 @@ virFirewallDApplyRule(virFirewallLayer layer, "/org/fedoraproject/FirewallD1", "org.fedoraproject.FirewallD1.direct", "passthrough", - message) < 0) + &message) < 0) return -1; =20 if (error->level =3D=3D VIR_ERR_ERROR) { @@ -353,7 +353,7 @@ virFirewallDInterfaceSetZone(const char *iface, const char *zone) { GDBusConnection *sysbus =3D virGDBusGetSystemBus(); - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; =20 if (!sysbus) return -1; @@ -368,5 +368,5 @@ virFirewallDInterfaceSetZone(const char *iface, "/org/fedoraproject/FirewallD1", "org.fedoraproject.FirewallD1.zone", "changeZoneOfInterface", - message); + &message); } diff --git a/src/util/virgdbus.c b/src/util/virgdbus.c index 4360a6acff..856ad80a88 100644 --- a/src/util/virgdbus.c +++ b/src/util/virgdbus.c @@ -205,23 +205,26 @@ virGDBusCallMethod(GDBusConnection *conn, const char *objectPath, const char *ifaceName, const char *method, - GVariant *data) + GVariant **data) { g_autoptr(GVariant) ret =3D NULL; g_autoptr(GError) gerror =3D NULL; + GVariant *parameters =3D NULL; =20 if (error) memset(error, 0, sizeof(*error)); =20 - if (data) - g_variant_ref_sink(data); + if (data && *data) { + parameters =3D g_variant_ref_sink(*data); + *data =3D NULL; + } =20 ret =3D g_dbus_connection_call_sync(conn, busName, objectPath, ifaceName, method, - data, + parameters, replyType, G_DBUS_CALL_FLAGS_NONE, VIR_DBUS_METHOD_CALL_TIMEOUT_MILIS, @@ -259,24 +262,27 @@ virGDBusCallMethodWithFD(GDBusConnection *conn, const char *objectPath, const char *ifaceName, const char *method, - GVariant *data, + GVariant **data, GUnixFDList *dataFD) { g_autoptr(GVariant) ret =3D NULL; g_autoptr(GError) gerror =3D NULL; + GVariant *parameters =3D NULL; =20 if (error) memset(error, 0, sizeof(*error)); =20 - if (data) - g_variant_ref_sink(data); + if (data && *data) { + parameters =3D g_variant_ref_sink(*data); + *data =3D NULL; + } =20 ret =3D g_dbus_connection_call_with_unix_fd_list_sync(conn, busName, objectPath, ifaceName, method, - data, + parameters, replyType, G_DBUS_CALL_FLAGS_= NONE, VIR_DBUS_METHOD_CA= LL_TIMEOUT_MILIS, @@ -317,9 +323,14 @@ virGDBusCallMethodWithFD(GDBusConnection *conn G_GNUC_= UNUSED, const char *objectPath G_GNUC_UNUSED, const char *ifaceName G_GNUC_UNUSED, const char *method G_GNUC_UNUSED, - GVariant *data G_GNUC_UNUSED, + GVariant **data, GUnixFDList *dataFD G_GNUC_UNUSED) { + if (data && *data) { + g_variant_unref(*data); + *data =3D NULL; + } + virReportSystemError(ENOSYS, "%s", _("Unix file descriptors not supported on this pl= atform")); return -1; diff --git a/src/util/virgdbus.h b/src/util/virgdbus.h index ca7073e27c..9c3955073c 100644 --- a/src/util/virgdbus.h +++ b/src/util/virgdbus.h @@ -51,7 +51,7 @@ virGDBusCallMethod(GDBusConnection *conn, const char *objectPath, const char *ifaceName, const char *method, - GVariant *data); + GVariant **data); =20 int virGDBusCallMethodWithFD(GDBusConnection *conn, @@ -63,7 +63,7 @@ virGDBusCallMethodWithFD(GDBusConnection *conn, const char *objectPath, const char *ifaceName, const char *method, - GVariant *data, + GVariant **data, GUnixFDList *dataFD); =20 int diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index aad924a065..e9fb4ec64f 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -67,7 +67,7 @@ int virPolkitCheckAuth(const char *actionid, GVariantBuilder builder; GVariant *gprocess =3D NULL; GVariant *gdetails =3D NULL; - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(GVariant) reply =3D NULL; g_autoptr(GVariantIter) iter =3D NULL; char *retkey; @@ -110,7 +110,7 @@ int virPolkitCheckAuth(const char *actionid, "/org/freedesktop/PolicyKit1/Authority", "org.freedesktop.PolicyKit1.Authority", "CheckAuthorization", - message) < 0) + &message) < 0) return -1; =20 g_variant_get(reply, "((bba{ss}))", &is_authorized, &is_challenge, &it= er); diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 8456085476..f849cbbf60 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -198,7 +198,7 @@ char * virSystemdGetMachineNameByPID(pid_t pid) { GDBusConnection *conn; - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(GVariant) reply =3D NULL; g_autoptr(GVariant) gvar =3D NULL; g_autofree char *object =3D NULL; @@ -220,7 +220,7 @@ virSystemdGetMachineNameByPID(pid_t pid) "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", "GetMachineByPID", - message) < 0) + &message) < 0) return NULL; =20 g_variant_get(reply, "(o)", &object); @@ -231,7 +231,6 @@ virSystemdGetMachineNameByPID(pid_t pid) VIR_DEBUG("Domain with pid %lld has object path '%s'", (long long) pid, object); =20 - g_variant_unref(message); message =3D g_variant_new("(ss)", "org.freedesktop.machine1.Machine", "Name"); =20 @@ -243,7 +242,7 @@ virSystemdGetMachineNameByPID(pid_t pid) object, "org.freedesktop.DBus.Properties", "Get", - message) < 0) + &message) < 0) return NULL; =20 g_variant_get(reply, "(v)", &gvar); @@ -393,9 +392,7 @@ int virSystemdCreateMachine(const char *name, "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", "CreateMachineWithNetwork", - message); - - g_variant_unref(message); + &message); =20 if (rc < 0) return -1; @@ -440,9 +437,7 @@ int virSystemdCreateMachine(const char *name, "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", "CreateMachine", - message); - - g_variant_unref(message); + &message); =20 if (rc < 0) return -1; @@ -468,9 +463,7 @@ int virSystemdCreateMachine(const char *name, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "SetUnitProperties", - message); - - g_variant_unref(message); + &message); =20 if (rc < 0) return -1; @@ -483,7 +476,7 @@ int virSystemdTerminateMachine(const char *name) { int rc; GDBusConnection *conn; - g_autoptr(GVariant) message =3D NULL; + GVariant *message =3D NULL; g_autoptr(virError) error =3D NULL; =20 if (!name) @@ -519,7 +512,7 @@ int virSystemdTerminateMachine(const char *name) "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", "TerminateMachine", - message) < 0) + &message) < 0) return -1; =20 if (error->level =3D=3D VIR_ERR_ERROR && --=20 2.26.2 From nobody Sun Apr 28 12:56:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601630558; cv=none; d=zohomail.com; s=zohoarc; b=Yiqst9HsyXx8S8GXw/5PfWwlf78kdIH5sH8WGcJFG2qujS7N1pimcsFQtzRYtjWDaE7n2JZnbkUSVf7tLO1IoXUtJOFgi/padu3tTefZcbEAYhrz9rOOMC4CZOOsdgBEnv1ZobuYagiKGi11RV3mxNPFw+GbDDXzw4qZYQkz14Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601630558; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qp+NJpSV8/k2O6YgqhLxNOvutHyoHZkQ5BwJy7iTMDQ=; b=XC9mSK6Tqi/ZVukfqnURAIzxudeLP1OWVBaNeifi7tD/qCHOEbWHmglBLBo34fnTFj54FrEenp1UqLyWX5Qa+dujEkn7LPx/oZyVeyW8WP4aqqjNksD6iOtrQg8rznJwMOYuUR//7RyuIyDmBMZaZoEiGIFkq7BJn+AvUCKdwbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601630558506750.827661407749; Fri, 2 Oct 2020 02:22:38 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-bG-X-HsjMaOCAx-CdC3fkQ-1; Fri, 02 Oct 2020 05:22:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5E0E801AFB; Fri, 2 Oct 2020 09:22:29 +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 B35987367D; Fri, 2 Oct 2020 09:22:29 +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 819CA44A4A; Fri, 2 Oct 2020 09:22:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0929MHna018339 for ; Fri, 2 Oct 2020 05:22:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id C2FB55577C; Fri, 2 Oct 2020 09:22:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 350B55578D for ; Fri, 2 Oct 2020 09:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601630557; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Qp+NJpSV8/k2O6YgqhLxNOvutHyoHZkQ5BwJy7iTMDQ=; b=Zz03isLuHDC/T3/MS21Oqu02ji2M2fAdy0/jIePiOw0RfSW6o5aWznMR8Ujum2nvsqhq4l gUXmP2uUBzEwhaGFboZKGInqrqhGhzh4rpACXfKCeH5YBOLlkKwv6rrEZXY95f/jB+JScC pYo4Lcdmgm2hpfPfeiZiHdFQL+69jEA= X-MC-Unique: bG-X-HsjMaOCAx-CdC3fkQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/5] tests: Set G_DEBUG environment variable Date: Fri, 2 Oct 2020 11:22:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" With us switching to glib more and more it is easy to get things wrong (as can be seen in the previous commit). Set G_DEBUG variable to "fatal-warnings" which causes GLib to abort the program at the first call to g_warning() or g_critical(). Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- tests/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/meson.build b/tests/meson.build index cb720f3afe..790033e243 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -36,6 +36,7 @@ tests_env =3D [ 'abs_top_srcdir=3D@0@'.format(meson.source_root()), 'LC_ALL=3DC', 'LIBVIRT_AUTOSTART=3D0', + 'G_DEBUG=3Dfatal-warnings', ] =20 if use_expensive_tests --=20 2.26.2 From nobody Sun Apr 28 12:56:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601630608; cv=none; d=zohomail.com; s=zohoarc; b=BaWcMPkPyGzWXdEx+7OvL0CScGFmOIslsLsbQTxzkzZMIof/98+2k5uOvZNd8vFSKFx8AipbsG9by/R663QnWMppOxykwXgTKKjrbGEnYixvx8b3qWggDvwtzVanx7btg93D7jmtaUdHHNTVIkF5AnYMpzI5dcajdSGYpKyWN/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601630608; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xBmNV//CS7VUlk5RVyw7RK7EONF692HB7ctIwrpd5oQ=; b=SsXIlhRIRvYDeAtsLu6aa+Qt9oOJ/MTfHytMDOcKt/RBYysueoVSx9ikFHBbOOVydGTBEEcfqmbi41B3I7Bwfhx6mHYzYh3GOi9cYe3h5KQaZef0Ew4jh1lVrK4IWvt3j6aF9EdEylgyFUsfKNr9QVhWXm/OOQ6b3zY3ltz6Y84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601630608926840.9563443268743; Fri, 2 Oct 2020 02:23:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-IdFhiKt-NkihdALqp6cUTg-1; Fri, 02 Oct 2020 05:23:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A3EA1018F7E; Fri, 2 Oct 2020 09:23:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCAB060BE2; Fri, 2 Oct 2020 09:23:18 +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 ABF0B181A06D; Fri, 2 Oct 2020 09:23:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0929MIEI018352 for ; Fri, 2 Oct 2020 05:22:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id BAB9C55784; Fri, 2 Oct 2020 09:22:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B9EF5577C for ; Fri, 2 Oct 2020 09:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601630606; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xBmNV//CS7VUlk5RVyw7RK7EONF692HB7ctIwrpd5oQ=; b=ZvWX8FzkY2WA0tnAM4oTP0OrAUSZOJ+jfkxZGR3PFvOZ36IL9GFfSVmr8PiIJtSxf/q3jR tr6pJWdm8KYQb7AnhOYe3w0yVnUN6udN+GGGEto5P0MUTX+NZAe9IC62AErLiAO7bVeFt1 sm62GvxWQgF5PdyFWUz9NqGRXe71PmM= X-MC-Unique: IdFhiKt-NkihdALqp6cUTg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/5] virfirewalltest: Don't duplicate string when adding it onto stringlist Date: Fri, 2 Oct 2020 11:22:08 +0200 Message-Id: <28aab36bf9fd6ce43bfa56cd627341333e961837.1601630385.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In our wrapper of g_dbus_connection_call_sync() in virfirewalltest a string is duplicated and added onto a virStringList. This leads to a memory leak because virStringListAdd() duplicates the string itself. Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- tests/virfirewalltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index 607638e9d0..eed7bcbe50 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -119,7 +119,7 @@ VIR_MOCK_WRAP_RET_ARGS(g_dbus_connection_call_sync, doError =3D true; } =20 - virStringListAdd(&args, g_strdup(item)); + virStringListAdd(&args, item); } =20 if (fwBuf) { --=20 2.26.2 From nobody Sun Apr 28 12:56:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601630611; cv=none; d=zohomail.com; s=zohoarc; b=AWkF6+ocbZQviQtcqrD+WOryQgh6KHj8N1HsRwmINFnKJgVXFDZph2cABxG9lJXVfyXqrI2/4mLdO050duJrm1t9NLskWwnv6BZs9JzQIbt7MmqQFf75hwfkB2IuFqGz5GX5RPo9dXUD37t3r55MzRipRhYcjjM95QaVaJBfkNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601630611; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cqvWL9wkRXAizsytk+2ex9In61dLALcNuR+9zyjVTwc=; b=CXsw1wROjgwBp7iHlbeBvnIGJfU9cag+ppVpf0ssp+Rvr6To8mbqSunbBAiDY04pfZmlW7V3kwDodSSMODjch/GO83AAapMpkHQ0rT1E54PFGF86s4B+McCG0KKIcmqHyMAXaBgHkKMlUrlJrbxHECMP8yQgxg23y2uPpIiFAVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601630611192680.7233280489106; Fri, 2 Oct 2020 02:23:31 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-L5J7Kfy3MsS1RTqxQbnDSQ-1; Fri, 02 Oct 2020 05:23:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C996803F65; Fri, 2 Oct 2020 09:23:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD4CD7367D; Fri, 2 Oct 2020 09:23:21 +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 63757181A07B; Fri, 2 Oct 2020 09:23:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0929MJLD018361 for ; Fri, 2 Oct 2020 05:22:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id B257A55784; Fri, 2 Oct 2020 09:22:19 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 225BE5577C for ; Fri, 2 Oct 2020 09:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601630609; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cqvWL9wkRXAizsytk+2ex9In61dLALcNuR+9zyjVTwc=; b=OC67GmRWb9fC+sQM7uhmcoeWCQ5twDt+tk5RKX/y6Mb2Lqj2fFpv5aBvAe6IxtOSrjiu+W 5U5Lormi4vBPhSQUn9Vvp9HHdwSOwQQDBVWvkuQQ1u9qP95WvvGcKNbGwyfo9XDJY+p6Uc ZaSc1TefbuybQYbIUM4rcs5wvEvU3Eg= X-MC-Unique: L5J7Kfy3MsS1RTqxQbnDSQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/5] vmx; Free @checkMACAddress in virVMXParseEthernet() Date: Fri, 2 Oct 2020 11:22:09 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The @checkMACAddress string is allocated in virVMXGetConfigString() but never freed. Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- src/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4b1b04c6e1..9894d5c0ce 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2734,6 +2734,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, = virDomainNetDefPtr *def) VIR_FREE(networkName); VIR_FREE(connectionType); VIR_FREE(addressType); + VIR_FREE(checkMACAddress); VIR_FREE(generatedAddress); VIR_FREE(address); VIR_FREE(virtualDev); --=20 2.26.2 From nobody Sun Apr 28 12:56:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601630559; cv=none; d=zohomail.com; s=zohoarc; b=McnfBMQKnmZlk2xdCT345kos/UW47CI0v1SbmM4gIC8UrS86aQjrBmsTe+c0PD//dF7JAZ1Ix+3/Ah2QEtraegaCHeWvxt0qdhFi6kqdTALZ5J+tJzFJ/REHBW6vOIQOWWqAGxVg7P3RVql6du1YJhyQV4Z8rfPwl+T6uLDQ400= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601630559; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zl7dC2CQK103SghjqhBhNxKbDk2isR0WaGV1TG7L000=; b=UNMmB0VhivKwA5CL/FlxBs7683f3267T6KYW2fNNGTB5yfk8anj/Zf4bXIDtvoYjgJfbCef0r1GpuTp0XontVPG1580bApPrI/PX6C6fx/8/qIa2a23dRW0ZCEzOf0Gup8R1gPDHPWFRmVoQNrlP4LpOhDghwRCAaBVHQG51bYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160163055987126.85458649837676; Fri, 2 Oct 2020 02:22:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-RZxWC5bgM1q1R0zGFNBz8g-1; Fri, 02 Oct 2020 05:22:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D689186DD40; Fri, 2 Oct 2020 09:22:30 +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 0C3C05C1D7; Fri, 2 Oct 2020 09:22:30 +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 BDD5544A5E; Fri, 2 Oct 2020 09:22:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0929MKgn018373 for ; Fri, 2 Oct 2020 05:22:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6C7A5577C; Fri, 2 Oct 2020 09:22:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 193AB5578D for ; Fri, 2 Oct 2020 09:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601630558; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Zl7dC2CQK103SghjqhBhNxKbDk2isR0WaGV1TG7L000=; b=QzLaafZLAYAxxjidhC/cAvJW2i23YHzvkZrz10y6w0p+SCLcrq6qBBGzAse0AWoFaOdw8X zXvk+QCVoLppa37kRyIMTYdiYlycQ6CilNqH31UjeGR4s9Kp3vQey+xMsIZA1erPgE7QYi s8GqoYbCG7KjpKlvU83ufVzrjYj8YPM= X-MC-Unique: RZxWC5bgM1q1R0zGFNBz8g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/5] NEWS: Document recent GLib DBus fix Date: Fri, 2 Oct 2020 11:22:10 +0200 Message-Id: <1c6408a37e087a743480dc2939b76644c29a0319.1601630385.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 7663cf4208..6c237dbba8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,12 @@ v6.9.0 (unreleased) =20 * **Bug fixes** =20 + * lib: Don't unref message passed to virGDBusCallMethod{WithFD}() + + The switch to GLib DBus implementation done in the previous release + contained a bug in which a DBus message was unrefed twice causing GLib= to + abort the daemon. + =20 v6.8.0 (2020-10-01) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.26.2