From patchwork Thu Aug 26 19:50:05 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: 12460633 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,URIBL_BLOCKED,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 66ABFC432BE for ; Thu, 26 Aug 2021 19:55: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 167CC60F11 for ; Thu, 26 Aug 2021 19:55:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 167CC60F11 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]:34390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJLSs-0005dc-9H for qemu-devel@archiver.kernel.org; Thu, 26 Aug 2021 15:55:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJLOQ-0004yf-3t for qemu-devel@nongnu.org; Thu, 26 Aug 2021 15:50:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJLOO-0002pU-JY for qemu-devel@nongnu.org; Thu, 26 Aug 2021 15:50:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630007427; 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=rai7h32TrTkDK/wiLtMpSewodwbvjWhnx25D5kPSBpM=; b=Vape+nU5EIRmNzpGxCEn6wjDu5auxD268RGcs6c768mSQVJzO4fVU2oD+nVJKuSEFiDdyH f5trtSl8sLkq+gpoygPqx5U4SniUbToS6HPSSz+lCzpguRlN8fiR0UASKcy4cxw3u5OeW9 V/LgB633LFGrZ9kS+q9JL8ohb8CzAP4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-b0nJgZRJPryr4XoMIeuSKg-1; Thu, 26 Aug 2021 15:50:26 -0400 X-MC-Unique: b0nJgZRJPryr4XoMIeuSKg-1 Received: by mail-wm1-f69.google.com with SMTP id 201-20020a1c01d2000000b002e72ba822dcso4772431wmb.6 for ; Thu, 26 Aug 2021 12:50:26 -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=rai7h32TrTkDK/wiLtMpSewodwbvjWhnx25D5kPSBpM=; b=Zqtqj7etiYa1LMCzXWc9BdZ2gjnkcwkyoYf8/fv8tpQK1kdXim/uXQC222oBXcJq1g pJacoQjX7XptmsbdSHH56GbwNy8KDNcfPxfcfd7z88bOLzCletC/UeHQJ5034Ioj1TBO eWy/dhbxD/tMUxg/lpHQ1HCwpGYViXXqVNQF1gCnqt/mwEQVj5NhVrbpdYrd2ngsX/Yj u8rhyLbwzqgNJt1oQ/LmvNOlaE8Xa+wmkq7vPLtcwEInEnK00wsG3do4T/F0RzlX6ovz RYt5/SU1jssZ7/XO+Ceyifto8TEEPu3iTkiP4beKSKUBGCipSxU+q9jeJZYkqMNuBiZX uTMQ== X-Gm-Message-State: AOAM532nVIrkj95nXXgIn11TrmxQkYbR2yXOSR+zfid4vjj1jrG1xXM0 qgGRLtMnjBS/PXcRlZVgDckDAP30j6y6LJ5KUxShXlHb8+ByTLLiSu4S5oYmI9mFzKoYOVdJ8Mu adjiVQAc9fg7ZSMgllVkcW/hWDK/sjvh/2cNLc3RmtPO+gD06DRlxtGfnuCJIHnVk X-Received: by 2002:a1c:210a:: with SMTP id h10mr7971664wmh.117.1630007425279; Thu, 26 Aug 2021 12:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDRJMm/10Yb6eJeXOOXHlAhtXlhDCxZAVFiUBI3triim5kJuM2Pq0s4mOxybiUpx/CAYgyqQ== X-Received: by 2002:a1c:210a:: with SMTP id h10mr7971645wmh.117.1630007425097; Thu, 26 Aug 2021 12:50:25 -0700 (PDT) Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id a10sm8817058wmj.44.2021.08.26.12.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 12:50:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/11] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report() Date: Thu, 26 Aug 2021 21:50:05 +0200 Message-Id: <20210826195014.2180369-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210826195014.2180369-1-philmd@redhat.com> References: <20210826195014.2180369-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=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.742, 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=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 , 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Klaus Jensen --- 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; }