[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/15] hw/pci/pcie_sriov: Replace fprintf(error_pretty) -> war
From: |
Philippe Mathieu-Daudé |
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 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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));
}
--
2.38.1
- [PATCH v2 00/15] hw: Use QOM alias properties and few QOM/QDev cleanups, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 01/15] hw/pci/pcie_sriov: Replace fprintf(error_pretty) -> warn_reportf_err(),
Philippe Mathieu-Daudé <=
- [PATCH v2 02/15] hw/qdev: Introduce qdev_unrealize_and_unref(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 03/15] linux-user/syscall: Do not open-code qdev_unrealize_and_unref(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 04/15] hw/pci/pcie_sriov: Do not open-code qdev_unrealize_and_unref(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 05/15] hw/i386/sgx: Do not open-code qdev_realize_and_unref(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 06/15] hw/ppc/sam460ex: Correctly set MAL properties, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 07/15] hw/arm/nrf51: Alias 'flash-size' QOM property in SoC object, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 08/15] hw/arm/fsl-imx: Alias 'phy-num' QOM property in SoC object, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 09/15] hw/usb/hcd-ohci: Include missing 'sysbus.h' header, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH v2 10/15] hw/display/sm501: Embed OHCI QOM child in chipset, Philippe Mathieu-Daudé, 2023/02/03