From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24696C433EF for ; Tue, 19 Jul 2022 12:04:26 +0000 (UTC) Received: from localhost ([::1]:39904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDlxh-0007BB-2j for qemu-devel@archiver.kernel.org; Tue, 19 Jul 2022 08:04:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDluA-00052Y-E8 for qemu-devel@nongnu.org; Tue, 19 Jul 2022 08:00:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDlu5-0008UI-Fs for qemu-devel@nongnu.org; Tue, 19 Jul 2022 08:00:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658232040; h=from:from: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; bh=m/NDLCFDyw5c7q7tl06QjHAe+MhVls/cgTFpTU8+IhY=; b=L4SlgrDcynnNTFNZKhtuVnoIZrv5gbM0Wf8b2GPqnq1B0iNxsLirwy9jsLUojEIDACekyI VDj6JjdYdEw30AKck8CwtVW0KNk4oo+pgZhB/h3gNSwo/8SBB97cfLIUqWwDtmLm8HLE5g vjgBJbUZ/iqNBr1ysiUymEqHwaZC1/I= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-R-4fPMdHM1ingJinN4cGNw-1; Tue, 19 Jul 2022 08:00:38 -0400 X-MC-Unique: R-4fPMdHM1ingJinN4cGNw-1 Received: by mail-qt1-f200.google.com with SMTP id u2-20020ac80502000000b002f94701339eso10119157qtg.13 for ; Tue, 19 Jul 2022 05:00:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=m/NDLCFDyw5c7q7tl06QjHAe+MhVls/cgTFpTU8+IhY=; b=jB6S9G8KfZfVS6eUO1soKagpjG70D8kDDpOx0gnxt65AoJFbaKR2oHL6M/G1a7hYwC kDzC7EwUVBpn9zaJYGrltqXHOIBudPSarfcmvIfarIJcBUBxO2qv7ruSdsf7KddIzT4u Dlphq4FvEBQElNMT6DJMOxF1lgVa43JQekQr7aAmpBp5WucFngJsZ+JJHAD7Xt5Q8FGF GLQFS0ovJzcky9/MvNJquoOXhMl2LMQi2IRStZQxPSFTRjEHfGIARdhKatDwr0BmwAa8 oG31m5mpJcdjsAJ4RJcMzjJ85skJe2Bc6mp5xx1yV5z3NGDny7J4dKu8xvbJgKHkKQ5h W5lQ== X-Gm-Message-State: AJIora/aDftB4/anEOC8bGMsApRCj48kkiGuM1lHIAokn7UuLtia4uZj 2JCTWKSYEZf28atPvuEz2Fwy7/fabna21PW2khpZDHPlUjXV6rV+tbeZ15xcU+XWNUM/z8LnGS1 je6J69728Hy3afU8= X-Received: by 2002:a05:622a:14cc:b0:31e:f6ef:a137 with SMTP id u12-20020a05622a14cc00b0031ef6efa137mr4138701qtx.606.1658232036242; Tue, 19 Jul 2022 05:00:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v0GfSN2pAey/gJ1lKP+z6OzHXAVmFhFKkMzTPyPGMXRRBm7Ttu44g96a9DGOPrfkyT3D9COQ== X-Received: by 2002:a05:622a:14cc:b0:31e:f6ef:a137 with SMTP id u12-20020a05622a14cc00b0031ef6efa137mr4138672qtx.606.1658232035964; Tue, 19 Jul 2022 05:00:35 -0700 (PDT) Received: from [192.168.149.123] (58.254.164.109.static.wline.lns.sme.cust.swisscom.ch. [109.164.254.58]) by smtp.gmail.com with ESMTPSA id x20-20020a05620a0b5400b006a6ab259261sm13699159qkg.29.2022.07.19.05.00.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jul 2022 05:00:35 -0700 (PDT) Message-ID: <8726804c-5dbc-bc27-3922-a00ae676941d@redhat.com> Date: Tue, 19 Jul 2022 14:00:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v9 09/21] jobs: use job locks also in the unit tests Content-Language: en-US To: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org Cc: Kevin Wolf , Hanna Reitz , Paolo Bonzini , John Snow , Vladimir Sementsov-Ogievskiy , Wen Congyang , Xie Changlong , Markus Armbruster , Stefan Hajnoczi , Fam Zheng , qemu-devel@nongnu.org References: <20220706201533.289775-1-eesposit@redhat.com> <20220706201533.289775-10-eesposit@redhat.com> From: Emanuele Giuseppe Esposito In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Am 11/07/2022 um 15:08 schrieb Vladimir Sementsov-Ogievskiy: > > That made me ask: > > 1. Are all tests always run in main loop? If yes, why to protect status > reading in test_complete_in_standby() ? > > 2. Maybe, we don't need to protect anything here? Why to protect other > things if we run everything in main loop? I think it's still good example and practice to protect a function if it needs to be protected and its name ends with _locked. It would just confuse the reader if we don't protect it. Emanuele