From nobody Mon Feb 9 03:12:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=A0hiwwQEAmxvU+BHlgQqTLYvQvI4OEzkitYPz8bnQe+aHZm9gn1FdHZZZ5qcrKEbWCiKQj6fAES6JW7cg37eFflVyHThRmO3ptKixv238Q0QGplvWDFQW/KFjotKRni8UvRA9QiyknbCerA8pITZ+CrOEO8+3DzJBLR9q5CUKC4= 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=dqn7xfnQQ2UU4zIjP7jMTdeBd3tRjNeMqOsoinl19e4=; b=l50/XabNkwbrgY+jCgCwEk1D7C7/E/T7Z2uJc5FeKslyaOUUsvFnRqZguW+8Fw9oEqg1M+uo3ovbdBhR5Sp9aQTu6s8ji6Air5JSW8rEXWEhSmf5KW1pbMN58FznxbgKx9mWMID6bz5ftaan/uc02FjWu+9zapwJsEZb76itbZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1586526952581687.6416932655725; 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-357-rU5sa0ZwM5qKhkr6gWEwzA-1; Fri, 10 Apr 2020 09:55:49 -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 AA74D107ACC7; Fri, 10 Apr 2020 13:55:43 +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 D77E596F88; Fri, 10 Apr 2020 13:55:42 +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 4464393088; Fri, 10 Apr 2020 13:55:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03ADtcYV022879 for ; Fri, 10 Apr 2020 09:55:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id E567712750F; Fri, 10 Apr 2020 13:55:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1195127512 for ; Fri, 10 Apr 2020 13:55:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 20587101A55A for ; Fri, 10 Apr 2020 13:55:35 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-115-B8z9FEFQOtOkXKaXr3dpAg-1; Fri, 10 Apr 2020 09:55:32 -0400 Received: by mail-wm1-f65.google.com with SMTP id z6so2818731wml.2 for ; Fri, 10 Apr 2020 06:55:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 06:55:30 -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=dqn7xfnQQ2UU4zIjP7jMTdeBd3tRjNeMqOsoinl19e4=; b=jCn9Md2qGLZwuA9phfPimjFRMiraAOUBmvZemEEgxXSFO1YI8POyx+oDh8ImyipTkoF4Nq Is621vpu32+T5zlIUwqw42LwFC4IMCWY2Q55I1ytGqJK6hDQeDhaixe2nPSSrGelaNtWro 07BgPoWE91cqDy4cjpvzrCyY7USPGJI= X-MC-Unique: rU5sa0ZwM5qKhkr6gWEwzA-1 X-MC-Unique: B8z9FEFQOtOkXKaXr3dpAg-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=CF6p19CQI701/y3Xtd/Q8qqY5ZkxIP5eHURqnfI7qIY=; b=AEQUmcMybIlMQm3vs4JdhqnqIK24Qi4NA+zOL28ociA9IcKVkKMKdIScN5pRX+lsgx su1wtfQ2AeGe55bTfBRSI9/G3xUc3yAJb1um2Zg/zRzrDq6K6/sQmJEy8LNfQ7LTYu8L JiyHQc1pKLI5hv2MDTU0ZwPlYnJyLY+PSAT3r69UzSw3Km7re4T+0a/OH0LXdfzld8Ud fnymP6mR2xUlcLaz8Ob3G0Q47NLQCKExZ4vBo8jeMVzusi3d/B2vskZU14pCNQJWPUI6 GIbIiAxF8y+DvMmpzUvKf65yoZrxEkBlks+CMElLVC4RdBJYIR0tA3Fq22d4dV2NJqMD tmTA== X-Gm-Message-State: AGi0PuZEL3OU/auCAiwz4olVBSrvctUUW/glSgbWSIfw1XgFg62qqwm2 elQaK5Zz9fQ3vv6uE8N8DzvcaynlfIk= X-Google-Smtp-Source: APiQypISXyDEUe0KJqNu5AoE9aYQjOh3FhzixlLdrJUG0in61eHaiOtbEUseFVV5oTe5vA68iol7KQ== X-Received: by 2002:a1c:9c15:: with SMTP id f21mr5148682wme.18.1586526931435; Fri, 10 Apr 2020 06:55:31 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 02/43] bhyve: convert virMutex to GMutex Date: Fri, 10 Apr 2020 15:54:29 +0200 Message-Id: <20200410135510.2148319-3-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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03ADtcYV022879 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.13 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/bhyve/bhyve_driver.c | 11 ++++------- src/bhyve/bhyve_utils.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index b6204c7fb9..6e9a79cb52 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -73,13 +73,13 @@ bhyveConnPtr bhyve_driver =3D NULL; void bhyveDriverLock(bhyveConnPtr driver) { - virMutexLock(&driver->lock); + g_mutex_lock(&driver->lock); } =20 void bhyveDriverUnlock(bhyveConnPtr driver) { - virMutexUnlock(&driver->lock); + g_mutex_unlock(&driver->lock); } =20 static int @@ -1199,7 +1199,7 @@ bhyveStateCleanup(void) if (bhyve_driver->lockFD !=3D -1) virPidFileRelease(BHYVE_STATE_DIR, "driver", bhyve_driver->lockFD); =20 - virMutexDestroy(&bhyve_driver->lock); + g_mutex_clear(&bhyve_driver->lock); VIR_FREE(bhyve_driver); =20 return 0; @@ -1228,10 +1228,7 @@ bhyveStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; =20 bhyve_driver->lockFD =3D -1; - if (virMutexInit(&bhyve_driver->lock) < 0) { - VIR_FREE(bhyve_driver); - return VIR_DRV_STATE_INIT_ERROR; - } + g_mutex_init(&bhyve_driver->lock); =20 if (!(bhyve_driver->closeCallbacks =3D virCloseCallbacksNew())) goto cleanup; diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h index f3e80b6121..a92ecb48c4 100644 --- a/src/bhyve/bhyve_utils.h +++ b/src/bhyve/bhyve_utils.h @@ -44,7 +44,7 @@ struct _virBhyveDriverConfig { }; =20 struct _bhyveConn { - virMutex lock; + GMutex lock; =20 virBhyveDriverConfigPtr config; =20 --=20 2.25.2