From nobody Mon Feb 9 19:26:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1586526952; cv=none; d=zohomail.com; s=zohoarc; b=lZ6jNdzo98nWCCjYGV+kOwFIv2LC/yHEUi95c5bXT2XkSnROm1kWXE269KUxYYmow3fCctyPFIOphGvdCpmX8okO3+p01QYuCx3WNuu1FzjahutbueWhHjw7lMR10aRe6wfnt6R2+oOcvfytAVQwNG/L2mOkaIRfmNljH2Z7YJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586526952; h=Content-Type:Content-Transfer-Encoding:Cc: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=kFZfW2uxs3+o5ZbEfHFivQievMWZCujVjs3VFI5ATRc=; b=QG4XoTxw0zu1LKwb3OerRM+VeTrLHf1JjfIC2LFGweuTlv+ZipvQfXRIzSTZHAHRcIW8/kx1aMBZGKavmgp0AF+Exew1874Z+W7uxDaG6uyKv3MKJDhgs+UY/NpugE6I0FCHbKpNcsrX6+xJ2h7YZ8Jl0KktwWuKbxSJS8ciHno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1586526952208609.0049325947426; Fri, 10 Apr 2020 06:55:52 -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-170-ymuIAhM4MLG2wYq5lElbtg-1; Fri, 10 Apr 2020 09:55:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 835FC800D5B; Fri, 10 Apr 2020 13:55:43 +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 50CB3C0D8D; Fri, 10 Apr 2020 13:55:43 +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 43ED318089C8; Fri, 10 Apr 2020 13:55:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADtbrI022871 for ; Fri, 10 Apr 2020 09:55:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 311EC20230A6; Fri, 10 Apr 2020 13:55:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C9B3202A940 for ; Fri, 10 Apr 2020 13:55:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A37B800294 for ; Fri, 10 Apr 2020 13:55:34 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-jCZOmi2oO76USAGayfIguw-1; Fri, 10 Apr 2020 09:55:31 -0400 Received: by mail-wr1-f68.google.com with SMTP id 65so2413442wrl.1 for ; Fri, 10 Apr 2020 06:55:31 -0700 (PDT) Received: from localhost.localdomain (public-gprs377075.centertel.pl. [37.47.104.52]) by smtp.gmail.com with ESMTPSA id c11sm3066319wrt.24.2020.04.10.06.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586526951; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=kFZfW2uxs3+o5ZbEfHFivQievMWZCujVjs3VFI5ATRc=; b=Yhw24FKyKzpoDqJQbd/L1xay1h9Mwsl9aqEXX+Dgj+VSs+ZARYh+R1crbK9M3NQE22mIy+ vb8egOD6HQG4tt5XxPUCuSDKnhDgjCMRr16C5teyZObOjt3WWk2oJ4FQdDWSPxZyJuXdJ6 c25pQ+zSKLlmZhECKd5c5L8luLT4fRI= X-MC-Unique: ymuIAhM4MLG2wYq5lElbtg-1 X-MC-Unique: jCZOmi2oO76USAGayfIguw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yE4K2pelANBjsb/IKX7fcdrxUPDWr6T4JUa4Ry5GIRs=; b=Rb7wVwm8i5RW8djd8qTMSDoAxtXp4BWghfDXXH1tu0IxzX7+ThGw0mjyUngqnDtKq9 AX51AQotvPCk1/DGChIjRty2f39tV2IvPQ16cJ53L7b3Vph89ssGG5mkW/vnU8mm6mnJ GB4/t0zVByidH5D93aaMOLzT03f8mpVQ/6prIiaCvv/W11jlIQwXlbd4E2KlwylkcyiN aD0vj+ROC3oktevPG7YQcp0LzBbT85QWbgU/BkGu95auMxTRgQqRuIFWMApGu80GICU4 cJHu2ZiD2f+m367TW1sjlBeZj+TCPww4PmKn/cE7mw0ADT/pIBlY8iCoHMUqDYbQaH4i 4fyA== X-Gm-Message-State: AGi0PuaaqOl8VQU37c3N8Lcf6T30twNaz3QMzNCDMWy+MaLcjF1l+zAm r9w3xyIqIuy60OtCcWKuqe6QWj3jTSQ= X-Google-Smtp-Source: APiQypL5JeHIIeJcjedMJdqsPreGEPW6PjaNGM2Zw4aMqxjRHkOWwGlOJU5GESpVA62XhNhl40zP3w== X-Received: by 2002:adf:ee12:: with SMTP id y18mr4502280wrn.289.1586526930241; Fri, 10 Apr 2020 06:55:30 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 01/43] admin: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:54:28 +0200 Message-Id: <20200410135510.2148319-2-r4f4rfs@gmail.com> In-Reply-To: <20200410135510.2148319-1-r4f4rfs@gmail.com> References: <20200410135510.2148319-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADtbrI022871 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca 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.15 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: Rafael Fonseca Reviewed-by: Pavel Mores --- src/admin/admin_server_dispatch.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dis= patch.c index b3da577995..2515528779 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -45,7 +45,7 @@ typedef daemonAdmClientPrivate *daemonAdmClientPrivatePtr; /* Separate private data for admin connection */ struct daemonAdmClientPrivate { /* Just a placeholder, not that there is anything to be locked */ - virMutex lock; + GMutex lock; =20 virNetDaemonPtr dmn; }; @@ -55,7 +55,7 @@ remoteAdmClientFree(void *data) { struct daemonAdmClientPrivate *priv =3D data; =20 - virMutexDestroy(&priv->lock); + g_mutex_clear(&priv->lock); virObjectUnref(priv->dmn); VIR_FREE(priv); } @@ -91,11 +91,7 @@ remoteAdmClientNew(virNetServerClientPtr client G_GNUC_U= NUSED, if (VIR_ALLOC(priv) < 0) return NULL; =20 - if (virMutexInit(&priv->lock) < 0) { - VIR_FREE(priv); - virReportSystemError(errno, "%s", _("unable to init mutex")); - return NULL; - } + g_mutex_init(&priv->lock); =20 /* * We don't necessarily need to ref this object right now as there @@ -167,9 +163,9 @@ adminDispatchConnectOpen(virNetServerPtr server G_GNUC_= UNUSED, struct daemonAdmClientPrivate *priv =3D virNetServerClientGetPrivateData(client); int ret =3D -1; + g_autoptr(GMutexLocker) locker =3D g_mutex_locker_new(&priv->lock); =20 VIR_DEBUG("priv=3D%p dmn=3D%p", priv, priv->dmn); - virMutexLock(&priv->lock); =20 flags =3D args->flags; virCheckFlagsGoto(0, cleanup); @@ -178,7 +174,6 @@ adminDispatchConnectOpen(virNetServerPtr server G_GNUC_= UNUSED, cleanup: if (ret < 0) virNetMessageSaveError(rerr); - virMutexUnlock(&priv->lock); return ret; } =20 --=20 2.25.2