From patchwork Fri Feb 3 14:55:22 2023 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: 650076 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp863567pva; Fri, 3 Feb 2023 06:58:20 -0800 (PST) X-Google-Smtp-Source: AK7set/MEmYWULHcdtq59Ef+bZu1k69NbmOloFGGg70E+TP9WhkkN5JtRlyZ1u4N8iT+io0lDo6G X-Received: by 2002:ad4:5590:0:b0:536:ba5e:6ac0 with SMTP id f16-20020ad45590000000b00536ba5e6ac0mr13919768qvx.40.1675436300359; Fri, 03 Feb 2023 06:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675436300; cv=none; d=google.com; s=arc-20160816; b=KpadbOY8q7vdZYLwW2DG7dxHU5OXawV1QrFCEpPMY4L1j/wwYV6dolCbX6fmCELN94 jB9xYhA2OnN6hJ3vZA/vMj+TM6mD9fQiVT9HVCA1unwTlazjXiBj5s8mQUE02WOYa9Cm vAGKKZnp5k2dJalXLHcPw5TcyEa9ZrZykE/Wwc2no4OrrA5ydVyhs6k/2p4b3rwAo08T bwNf6VYxhNN2AffO+dWpT1QNrHU8pSPlGsXLMauMRqylLrkdp76YLloBY6e+xS8RTr75 nyuwYU5633VBYUhyiC+ugTdpz6nKaWxTznAVUFfNKTtjFJleIY96otocyfB5VY0Rf8vg O91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=u5Qt91xmpfg3Kkkw/BgIYU9U4GYdhogVmKvN1otILDLR+sQppgeAHMt+EFlIQiWAH5 u1K55y/nQ5F1UZn+OBcV5WgKWr+c0DEgFo8CrHmOoxwdtaSmeb4T9sMb4WZzRMtCzKWp qO2RTOPZf5LW10bOGkNcd2uoeC1Yb7pZNdxU7ZP8RzMpgFLYFdaPdcgP9SWdOExXazdj Fl5SZCLkauTOAtD7b9BN9jV/pJGSQxZRarjViXfJJuhACiC0yO4HQKUesz0mzPiEpUNm Rtcqm93HudO400TngOf0dnHsjbb6g4FjUQucxsY73Qt0934HJezzfNQKcme0f0JAtbj7 jPFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lPgZ9n5K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gc4-20020a056214230400b005352f0d8ce1si2231124qvb.326.2023.02.03.06.58.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 06:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lPgZ9n5K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxTg-0001lU-B7; Fri, 03 Feb 2023 09:55:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTe-0001gS-8B for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:46 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTc-0005qu-Ct for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:45 -0500 Received: by mail-wr1-x429.google.com with SMTP id h16so4856423wrz.12 for ; Fri, 03 Feb 2023 06:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=lPgZ9n5K6CrRTxxEvSmCqY3ghiogDX+rg/hCCPZOkska+sJM5KTqot5rIAqQeeMbEQ 9CYZPKlEaD1JEVEF+kffMJtFgVlO8oOgwhEfEfHmCk07Afv/GiyZrYS2/Zm3O1T7lm7B RB1tQMNLC8i1ObzebgXpBUa85iEhQvn5OKyH1oSAkAmo2R1nQfojrEj4k8KgL9HUbApg o0DMjNiDWI5mbBsEn6fLg6qwfmi8U8Gdgc9YaCwJnzO1v30khNF6OZZgmRXFcRoLp7Gh YPLJ2hHcAiiwQT6kw2GT+eag7pUW8LUb9B1kMXe2x+1eBVRweY4Jn51ExYzsFyvWpEKH 1OhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=XqPh7eDHbbQ3nF8oDcV2pzgF6xUU5knIarf5RVo6EDmY9CiwH7at+rpGAzB8GhPnqy qcENPfUL8opoVtGJoDB/6cBablw61vo2fkn+6MPJ5+kskS+7gEPGvUst1mnssoUqMenv qcCDIuakVLpd1nssZcws5G10Y4Ccm1gesTEpgDrBniQWt+l9c7FbADg5ErKQBNb5E7XG CNzCu2AIuCjsDk8vnQGBX9lB7/3Ak7dWdVYUWD8K0ZoW4E6bMNhfQRPkuMbxSqpK2u4D hclANCRbWhUod7fIIi4gIdWyEvX2jOyI+tnk9CzNS3WGDC1MOv5RZWI0HBBrVvMvJxXe jfbA== X-Gm-Message-State: AO0yUKUr5+57YTVx73B3rLAI9DlqVFkuvfVqEcYQW8+bUL1K2dD8mtkZ qBNghMMqw0JxwyRngWfY4DFMqj6Mx0E4e5kn X-Received: by 2002:adf:a102:0:b0:2bf:942b:ddc with SMTP id o2-20020adfa102000000b002bf942b0ddcmr8142730wro.55.1675436143513; Fri, 03 Feb 2023 06:55:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t10-20020a5d690a000000b002bbedd60a9asm2175645wru.77.2023.02.03.06.55.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:55:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v2 01/15] hw/pci/pcie_sriov: Replace fprintf(error_pretty) -> warn_reportf_err() Date: Fri, 3 Feb 2023 15:55:22 +0100 Message-Id: <20230203145536.17585-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/pcie_sriov.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index f0bd72e069..93b0624599 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -196,19 +196,17 @@ static void register_vfs(PCIDevice *dev) static void unregister_vfs(PCIDevice *dev) { - Error *local_err = NULL; uint16_t num_vfs = dev->exp.sriov_pf.num_vfs; uint16_t i; trace_sriov_unregister_vfs(dev->name, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), num_vfs); for (i = 0; i < num_vfs; i++) { + Error *errp = NULL; PCIDevice *vf = dev->exp.sriov_pf.vf[i]; - object_property_set_bool(OBJECT(vf), "realized", false, &local_err); - if (local_err) { - fprintf(stderr, "Failed to unplug: %s\n", - error_get_pretty(local_err)); - error_free(local_err); + object_property_set_bool(OBJECT(vf), "realized", false, &errp); + if (errp) { + warn_reportf_err(errp, "Failed to unplug: "); } object_unparent(OBJECT(vf)); }