From nobody Thu Nov 6 18:20:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542292431014927.1645498392917; Thu, 15 Nov 2018 06:33:51 -0800 (PST) Received: from localhost ([::1]:39188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNIiL-0003Ng-LT for importer@patchew.org; Thu, 15 Nov 2018 09:33:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNIgB-0002CG-DV for qemu-devel@nongnu.org; Thu, 15 Nov 2018 09:31:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNIg5-0003r8-GC for qemu-devel@nongnu.org; Thu, 15 Nov 2018 09:31:33 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:56144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNIg5-0003q5-99 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 09:31:29 -0500 Received: by mail-wm1-x343.google.com with SMTP id y139so1666783wmc.5 for ; Thu, 15 Nov 2018 06:31:28 -0800 (PST) Received: from localhost.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id x194-v6sm55262620wmd.41.2018.11.15.06.31.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Nov 2018 06:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Tbgvo7nqHxj+E/PSacuAqrya2h0ycHk1P0mZoBsUn4=; b=oFecYQGl7MsTsEeXgPdWitOkLm2vhvs3W5VxWFMMfpyps7BPmkahMLUpA1pAaYPh1e gVoEaeceD6nupss6yRHQpnRN+BT7AsZKWAbvSIL2CFM6l79yIzyoVTI4t02w/YpDOhrP /2tszJy2q1TY1McniGP9ewfGNXND7p/FKkw/nXGFBjbN45aqwdQoXLnXLK+0gW17r91L NwZkQf9aSNFpcGRwuy/iEsX9QgsYfytmDN9IxVHMnu9Ljr+Z/tRbBTMSvLkxx+gS2YYS iLSHvbrakiSAOWj3YOz67HLl3U+Nj2dfpP2P+0sayHSTYEDlwqF3/AsNqlYZfsVC0PFy 0IcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8Tbgvo7nqHxj+E/PSacuAqrya2h0ycHk1P0mZoBsUn4=; b=TZcknk8zsU3JKsy0XYxRdQSO5NUV72l81xdM+nSzjhgcWVl7VUn/IZAxi49ZXIbK/T v/8Mas6KwGYXVNDbaS1+owAPPn2+9iWIHSUCRSgeTCk/mTBFXbpSheZWe3itRoolrWB4 r3j3jU+Ho3ykBZKN8fDtqQpu5Xyq1Ia/djfESA6iphTMzoy6kWhsH2Yki7f9B9a8LdeT y/BMnmqbFnpwHAa9n4+w/Yq2NhaRGWmgpfqM3FeyuvKsCSKVepo1eKl8zVNHchp38LBO IekCJfkmmNi8lO3NDEKRhSLtB1MinkMB/MTNJP00/Lzo9QWOmThW9EVFnPpsLF+1MPuK wr0w== X-Gm-Message-State: AGRZ1gKzJSSdqtFm6uQO+Ngvh2PsWML1QzfhbEXcCh6o2Jq1p4Cz8yV0 3GCd4/QibLtA6lXbWTrNMDxZ0Lwo X-Google-Smtp-Source: AJdET5dVZm5lYEhkz/ei8hbK7Nm0NHMSSgwbWThQYafbOpyQcrvra6peHX984n+iUKV0ilPPnnoGMw== X-Received: by 2002:a1c:2c03:: with SMTP id s3-v6mr5543318wms.38.1542292286823; Thu, 15 Nov 2018 06:31:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 15:31:15 +0100 Message-Id: <20181115143124.19234-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115143124.19234-1-pbonzini@redhat.com> References: <20181115143124.19234-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH 01/10] vhost-user-test: use g_cond_broadcast X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , jasowang@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" g_cond_signal is rarely the right thing to do, it works now because vhost-user-test only has two threads but it is not correct in general. Fix it before adding more calls. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/vhost-user-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 45d58d8ea2..656e51938b 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -393,7 +393,7 @@ static void chr_read(void *opaque, const uint8_t *buf, = int size) G_N_ELEMENTS(s->fds)); =20 /* signal the test that it can continue */ - g_cond_signal(&s->data_cond); + g_cond_broadcast(&s->data_cond); break; =20 case VHOST_USER_SET_VRING_KICK: @@ -419,7 +419,7 @@ static void chr_read(void *opaque, const uint8_t *buf, = int size) p =3D (uint8_t *) &msg; qemu_chr_fe_write_all(chr, p, VHOST_USER_HDR_SIZE); =20 - g_cond_signal(&s->data_cond); + g_cond_broadcast(&s->data_cond); break; =20 case VHOST_USER_SET_VRING_BASE: --=20 2.19.1