Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01FAC433ED for ; Fri, 9 Apr 2021 16:16:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 565516103E for ; Fri, 9 Apr 2021 16:16:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 565516103E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUtnh-0006oO-Mv for qemu-devel@archiver.kernel.org; Fri, 09 Apr 2021 12:16:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUtlD-00040c-E8 for qemu-devel@nongnu.org; Fri, 09 Apr 2021 12:13:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUtl9-00021q-FF for qemu-devel@nongnu.org; Fri, 09 Apr 2021 12:13:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617984805; 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=0Ve4nVg8s2s1QT7OA4YuNADg2QlgbN7iU4fcag6o8IQ=; b=imfWyLm+vJ3Ceui+WAFw/a7KeW8zN3R+87R5ZzXoXrCeNO0RX13zu86KCZbyi+pxYUaJxP qZkZimBwKTrNYYyRss7aqpQGzMpzk84kgV5x7+TLzxZ4qMFmy0QItjumRe7P+ajilSxtHL D4QV2f5SQrdNeGuTZzcH70OcPqjJ7Lg= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-vgZq0QPsNTuWNLo8KqxL2g-1; Fri, 09 Apr 2021 12:13:22 -0400 X-MC-Unique: vgZq0QPsNTuWNLo8KqxL2g-1 Received: by mail-wr1-f71.google.com with SMTP id a15so2484492wrf.19 for ; Fri, 09 Apr 2021 09:13:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Ve4nVg8s2s1QT7OA4YuNADg2QlgbN7iU4fcag6o8IQ=; b=pOJ12Jbpjk444yKA0xvZOU0JcwTaWQ/uM4j4ApSm17Qau2Dkys7eF3JoKMnk7kj2SL gkrUYIBm2nwEX4AnShLg5z627QM8+c8oociUrXWiIudTwrRH0eS5skbYVFKGcCvAQpI4 znamQz3gtlh4dg2DQ3dfSW3RrLcO4nLywkPqicOgSvnHXAQjEFJEoHtFA9WkETawRNzF ApPycNyw6oHS7OIMQXcCf/7a1bljB7DdjWddqzGRutBEgVQb1JqG3H4HmH2MpBgK80Ev EBeqzay1Uj8AQVE6bVN46lYEQ4d+ZHAW+bQtr1s4uEKBXOuHfuHJHoRQPYyphro71enu /TeA== X-Gm-Message-State: AOAM533ImgmSyIOQl2lAFwWbXwQyU6ynH0d8MuKvDeFWS6eH3IrtXN2V gh/R5UBL2JamUmTRRVDDM0q6QLJgtUYoJF+lFhabvbG66eyfYpo4HDvd80ijrS+liGT7XtQjkT9 C3hCK9vQ0bl7pYoY= X-Received: by 2002:adf:eec8:: with SMTP id a8mr10073603wrp.382.1617984801313; Fri, 09 Apr 2021 09:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFn4aiCVfr7PHlymozWNHL5wZzUxKjkjEQtYngHBh8+Hy3Vx0chqOqBJsIbSlpk+Wq/2phSg== X-Received: by 2002:adf:eec8:: with SMTP id a8mr10073581wrp.382.1617984801105; Fri, 09 Apr 2021 09:13:21 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.173]) by smtp.gmail.com with ESMTPSA id m5sm4973617wrx.83.2021.04.09.09.13.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Apr 2021 09:13:20 -0700 (PDT) Subject: Re: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers To: Paolo Bonzini References: <20210407135021.48330-1-eesposit@redhat.com> <20210407135021.48330-5-eesposit@redhat.com> From: Emanuele Giuseppe Esposito Message-ID: <754ab22c-6432-4713-e375-353361d31f41@redhat.com> Date: Fri, 9 Apr 2021 18:13:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eesposit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Eduardo Habkost , "open list:Block layer core" , qemu-devel , Max Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 08/04/2021 21:03, Paolo Bonzini wrote: > > > Il gio 8 apr 2021, 18:06 Emanuele Giuseppe Esposito > ha scritto: > > > > On 08/04/2021 17:40, Paolo Bonzini wrote: > > On 07/04/21 15:50, Emanuele Giuseppe Esposito wrote: > >>       def get_qmp_events_filtered(self, wait=60.0): > >>           result = [] > >> -        for ev in self.get_qmp_events(wait=wait): > >> +        qmp_wait = wait > >> +        if qemu_gdb: > >> +            qmp_wait = 0.0 > >> +        for ev in self.get_qmp_events(wait=qmp_wait): > >>               result.append(filter_qmp_event(ev)) > >>           return result > > > > Should this be handled in get_qmp_events instead, since you're > basically > > changing all the callers? > > get_qmp_events is in python/machine.py, which as I understand might be > used also by some other scripts, so I want to keep the changes there to > the minimum. Also, machine.py has no access to qemu_gdb or > qemu_valgrind, so passing a boolean or something to delay the timer > would still require to add a similar check in all sections. > > Or do you have a cleaner way to do this? > > > Maybe a subclass IotestsMachine? > I actually figured that I could override get_qmp_events and put the check there. Something like (simplified): class VM(qtest.QEMUQtestMachine): ... def get_qmp_events(self, wait) if qemu_gdb or qemu_valgrind: wait = 0.0 return super().get_qmp_events(wait) Emanuele