From patchwork Thu Sep 2 07:00:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12470941 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 1B91CC432BE for ; Thu, 2 Sep 2021 07:05:02 +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 D3909600EF for ; Thu, 2 Sep 2021 07:05:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3909600EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLgmS-0007J8-VQ for qemu-devel@archiver.kernel.org; Thu, 02 Sep 2021 03:05:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgiL-0000Un-48 for qemu-devel@nongnu.org; Thu, 02 Sep 2021 03:00:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgiJ-0007wy-JT for qemu-devel@nongnu.org; Thu, 02 Sep 2021 03:00:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630566039; 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=bBtss4QrAZvCKlRzk4+0XN0kMEBQG8X7JlDa7aeGGM4=; b=PcwSbdDJg+CxCRHyyjz0/9VjlFVf9jS84uWoBU5fcl59NHZ4c683Y5MrasNpeKbq4xeFc+ kAkP8hZdJ4yX4DEukGnbDlwJ5cVqdiSIE3tOnBP4lxZTU9jw7mjUNEViXnYsyYUCwlrBhX SxV9ZAKSQrFrAt5I6VbNq4xCclgjj/s= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-nCsJYiAzPPeCvvuI_8g1jg-1; Thu, 02 Sep 2021 03:00:38 -0400 X-MC-Unique: nCsJYiAzPPeCvvuI_8g1jg-1 Received: by mail-wm1-f71.google.com with SMTP id r125-20020a1c2b830000b0290197a4be97b7so334736wmr.9 for ; Thu, 02 Sep 2021 00:00:38 -0700 (PDT) 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=bBtss4QrAZvCKlRzk4+0XN0kMEBQG8X7JlDa7aeGGM4=; b=IzQp9YokMPYdymxofvXYBwPtKBmCKtKRI6rm/tl27GiwVX0LMc+07GsIuAA8KlLEuW HGI+HprDATmiBY9jhmZh4smWt4Kz37H7xiDjgbWP27mKSA2DLNRbgYb6UkalHfpnCMLz FmfjglB18uINrKalKa8MBWIEmj70gExIjktp12GF0aHCNJM42xBe2gQ5DScsF+g+ny+F txssNs14sRc1omn3czXabFC6p7GBa2bHGo9Zbw1MhSFWL4AScEPrxP+8gVmprc2+EuWF ko0kJHPosQ/yn1AM+mcDui4mOUjlP9UPDYsyuBQ0S0Zvxm3tKHwsDAjZHfDWwm2VvTh6 yyuw== X-Gm-Message-State: AOAM5337UN44LV8iIU9g++OjqFWDj9eRQTfgV0u1OWOJzyQeKznfKi81 Mh+GUDDA/QBYTFgQmlCsBVXQA3ZRkVPfgXKWjWWwR/HY6ifsexh6oQxwi5IbYHHNzsm97UhMYsu Zuaez/40H/YP9KQBA+1TXTQs1buy84AKnhmTn32bNk+w9qUxem6rHTUm1a3e8a1vn X-Received: by 2002:a7b:c441:: with SMTP id l1mr1511152wmi.69.1630566036753; Thu, 02 Sep 2021 00:00:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqzlcRd6hLENRtIYmXuNe2XYP5FMGyq04M4x0uGtqjDbinDjdqTxZZXnD6HnxGookx9mDnpg== X-Received: by 2002:a7b:c441:: with SMTP id l1mr1511125wmi.69.1630566036532; Thu, 02 Sep 2021 00:00:36 -0700 (PDT) Received: from x1w.redhat.com (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id t7sm1012543wrq.90.2021.09.02.00.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 00:00:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 02/11] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report() Date: Thu, 2 Sep 2021 09:00:16 +0200 Message-Id: <20210902070025.197072-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902070025.197072-1-philmd@redhat.com> References: <20210902070025.197072-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 , Fam Zheng , qemu-block@nongnu.org, Klaus Jensen , Auger Eric , Hanna Reitz , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Instead of displaying the error on stderr, use error_report() which also report to the monitor. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 911115b86e6..1d149136299 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -660,13 +660,13 @@ static bool qemu_vfio_verify_mappings(QEMUVFIOState *s) if (QEMU_VFIO_DEBUG) { for (i = 0; i < s->nr_mappings - 1; ++i) { if (!(s->mappings[i].host < s->mappings[i + 1].host)) { - fprintf(stderr, "item %d not sorted!\n", i); + error_report("item %d not sorted!", i); qemu_vfio_dump_mappings(s); return false; } if (!(s->mappings[i].host + s->mappings[i].size <= s->mappings[i + 1].host)) { - fprintf(stderr, "item %d overlap with next!\n", i); + error_report("item %d overlap with next!", i); qemu_vfio_dump_mappings(s); return false; }