hw/arm/boot.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
Replace direct fprintf(stderr, …) with QEMU's error_report() API,
which ensures consistent formatting and integrates with QEMU's
logging infrastructure.
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
hw/arm/boot.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index d391cd01bb..17c744762f 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -531,13 +531,13 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
char *filename;
filename = qemu_find_file(QEMU_FILE_TYPE_DTB, binfo->dtb_filename);
if (!filename) {
- fprintf(stderr, "Couldn't open dtb file %s\n", binfo->dtb_filename);
+ error_report("Couldn't open dtb file %s", binfo->dtb_filename);
goto fail;
}
fdt = load_device_tree(filename, &size);
if (!fdt) {
- fprintf(stderr, "Couldn't open dtb file %s\n", filename);
+ error_report("Couldn't open dtb file %s", filename);
g_free(filename);
goto fail;
}
@@ -545,7 +545,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
} else {
fdt = binfo->get_dtb(binfo, &size);
if (!fdt) {
- fprintf(stderr, "Board was unable to create a dtb blob\n");
+ error_report("Board was unable to create a dtb blob");
goto fail;
}
}
@@ -564,7 +564,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
scells = qemu_fdt_getprop_cell(fdt, "/", "#size-cells",
NULL, &error_fatal);
if (acells == 0 || scells == 0) {
- fprintf(stderr, "dtb file invalid (#address-cells or #size-cells 0)\n");
+ error_report("dtb file invalid (#address-cells or #size-cells 0)");
goto fail;
}
@@ -572,8 +572,8 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
/* This is user error so deserves a friendlier error message
* than the failure of setprop_sized_cells would provide
*/
- fprintf(stderr, "qemu: dtb file not compatible with "
- "RAM size > 4GB\n");
+ error_report("qemu: dtb file not compatible with "
+ "RAM size > 4GB");
goto fail;
}
@@ -611,7 +611,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
rc = fdt_add_memory_node(fdt, acells, mem_base,
scells, mem_len, i);
if (rc < 0) {
- fprintf(stderr, "couldn't add /memory@%"PRIx64" node\n",
+ error_report("couldn't add /memory@%"PRIx64" node",
mem_base);
goto fail;
}
@@ -622,7 +622,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
rc = fdt_add_memory_node(fdt, acells, binfo->loader_start,
scells, binfo->ram_size, -1);
if (rc < 0) {
- fprintf(stderr, "couldn't add /memory@%"PRIx64" node\n",
+ error_report("couldn't add /memory@%"PRIx64" node",
binfo->loader_start);
goto fail;
}
@@ -637,7 +637,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
rc = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs",
ms->kernel_cmdline);
if (rc < 0) {
- fprintf(stderr, "couldn't set /chosen/bootargs\n");
+ error_report("couldn't set /chosen/bootargs");
goto fail;
}
}
@@ -646,7 +646,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
rc = qemu_fdt_setprop_sized_cells(fdt, "/chosen", "linux,initrd-start",
acells, binfo->initrd_start);
if (rc < 0) {
- fprintf(stderr, "couldn't set /chosen/linux,initrd-start\n");
+ error_report("couldn't set /chosen/linux,initrd-start");
goto fail;
}
@@ -655,7 +655,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
binfo->initrd_start +
binfo->initrd_size);
if (rc < 0) {
- fprintf(stderr, "couldn't set /chosen/linux,initrd-end\n");
+ error_report("couldn't set /chosen/linux,initrd-end");
goto fail;
}
}
--
2.43.0
On Sat, 23 Aug 2025 at 16:03, Osama Abdelkader <osama.abdelkader@gmail.com> wrote: > > Replace direct fprintf(stderr, …) with QEMU's error_report() API, > which ensures consistent formatting and integrates with QEMU's > logging infrastructure. > > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> > --- > hw/arm/boot.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) Applied to target-arm.next, thanks. -- PMM
Peter Maydell <peter.maydell@linaro.org> writes: > On Sat, 23 Aug 2025 at 16:03, Osama Abdelkader > <osama.abdelkader@gmail.com> wrote: >> >> Replace direct fprintf(stderr, …) with QEMU's error_report() API, >> which ensures consistent formatting and integrates with QEMU's >> logging infrastructure. >> >> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> >> --- >> hw/arm/boot.c | 22 +++++++++++----------- >> 1 file changed, 11 insertions(+), 11 deletions(-) > > > > Applied to target-arm.next, thanks. I didn't see this had been posted but I did a more extensive clean-up here: Message-ID: <20250901125304.1047624-1-alex.bennee@linaro.org> Date: Mon, 1 Sep 2025 13:53:00 +0100 Subject: [PATCH 0/4] arm_load_dtb cleanups From: =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org> > > -- PMM -- Alex Bennée Virtualisation Tech Lead @ Linaro
On Mon, 1 Sept 2025 at 17:59, Alex Bennée <alex.bennee@linaro.org> wrote: > > Peter Maydell <peter.maydell@linaro.org> writes: > > > On Sat, 23 Aug 2025 at 16:03, Osama Abdelkader > > <osama.abdelkader@gmail.com> wrote: > >> > >> Replace direct fprintf(stderr, …) with QEMU's error_report() API, > >> which ensures consistent formatting and integrates with QEMU's > >> logging infrastructure. > >> > >> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> > >> --- > >> hw/arm/boot.c | 22 +++++++++++----------- > >> 1 file changed, 11 insertions(+), 11 deletions(-) > > > > > > > > Applied to target-arm.next, thanks. > > I didn't see this had been posted but I did a more extensive clean-up > here: > > Message-ID: <20250901125304.1047624-1-alex.bennee@linaro.org> > Date: Mon, 1 Sep 2025 13:53:00 +0100 > Subject: [PATCH 0/4] arm_load_dtb cleanups > From: =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org> OK, I'll drop this one and take that series instead: it does look like it does a more comprehensive approach. -- PMM
On Mon, Sep 01, 2025 at 05:59:03PM +0100, Alex Bennée wrote: > Peter Maydell <peter.maydell@linaro.org> writes: > > > On Sat, 23 Aug 2025 at 16:03, Osama Abdelkader > > <osama.abdelkader@gmail.com> wrote: > >> > >> Replace direct fprintf(stderr, …) with QEMU's error_report() API, > >> which ensures consistent formatting and integrates with QEMU's > >> logging infrastructure. > >> > >> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> > >> --- > >> hw/arm/boot.c | 22 +++++++++++----------- > >> 1 file changed, 11 insertions(+), 11 deletions(-) > > > > > > > > Applied to target-arm.next, thanks. > > I didn't see this had been posted but I did a more extensive clean-up > here: > > Message-ID: <20250901125304.1047624-1-alex.bennee@linaro.org> > Date: Mon, 1 Sep 2025 13:53:00 +0100 > Subject: [PATCH 0/4] arm_load_dtb cleanups > From: =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org> > > > > > -- PMM > > -- > Alex Bennée > Virtualisation Tech Lead @ Linaro sorry Alex, I didn't know that your patch set covers that. I just submitted a simple patch to replace fprintf in raspi4b Would appreciate your review. Thank you. Regards, Osama
Osama Abdelkader <osama.abdelkader@gmail.com> writes: > On Mon, Sep 01, 2025 at 05:59:03PM +0100, Alex Bennée wrote: >> Peter Maydell <peter.maydell@linaro.org> writes: >> >> > On Sat, 23 Aug 2025 at 16:03, Osama Abdelkader >> > <osama.abdelkader@gmail.com> wrote: >> >> >> >> Replace direct fprintf(stderr, …) with QEMU's error_report() API, >> >> which ensures consistent formatting and integrates with QEMU's >> >> logging infrastructure. >> >> >> >> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> >> >> --- >> >> hw/arm/boot.c | 22 +++++++++++----------- >> >> 1 file changed, 11 insertions(+), 11 deletions(-) >> > >> > >> > >> > Applied to target-arm.next, thanks. >> >> I didn't see this had been posted but I did a more extensive clean-up >> here: >> >> Message-ID: <20250901125304.1047624-1-alex.bennee@linaro.org> >> Date: Mon, 1 Sep 2025 13:53:00 +0100 >> Subject: [PATCH 0/4] arm_load_dtb cleanups >> From: =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org> >> >> > >> > -- PMM >> >> -- >> Alex Bennée >> Virtualisation Tech Lead @ Linaro > > sorry Alex, I didn't know that your patch set covers that. No need to apologise - qemu-devel is a firehose of patches so its inevitable two or more people might touch the same thing at the same time. > I just submitted a simple patch to replace fprintf in raspi4b > Would appreciate your review. I have left some comments. > > Thank you. > > Regards, > Osama -- Alex Bennée Virtualisation Tech Lead @ Linaro
© 2016 - 2025 Red Hat, Inc.