From patchwork Mon Jan 18 11:32:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1428097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DK8mf31mzz9sWL for ; Mon, 18 Jan 2021 22:33:22 +1100 (AEDT) Received: from localhost ([::1]:59400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1Sme-0007qm-D8 for incoming@patchwork.ozlabs.org; Mon, 18 Jan 2021 06:33:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Slf-0007p5-W3; Mon, 18 Jan 2021 06:32:20 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:39897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Sle-0000Pp-Bk; Mon, 18 Jan 2021 06:32:19 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MLhsE-1lIzeM3K8O-00HhFx; Mon, 18 Jan 2021 12:32:10 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/4] hw/virtio-pci: Replace error_report() by qemu_log_mask(GUEST_ERROR) Date: Mon, 18 Jan 2021 12:32:02 +0100 Message-Id: <20210118113205.1915888-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118113205.1915888-1-laurent@vivier.eu> References: <20210118113205.1915888-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ytZLWhdAIyUryIjvahpjtjy3oD0Q9D9Q9wWHxqzbJvUFiQtW3xI EznltKKYnt7NnCZ/msRz3R4bTGmj1JNEH/LYl4BlNVP3L1BgLpSv0MpLQV6BlQ9JjVEEa/p VbmX6ItRQnpM0/LpCYsqduTG9SN1iqUQ2m9noaH9Ef68tZbKm1PQq7QxfuoN/AxiUPmBrxX p1W3wjP3aM/QTA7QiZ4mQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:7vTjW94XwZo=:MRULBJPVS75oEpFXCRKwZN N+tyCxxI50FHSRwKBrFHWspj2gwRrr3Nx7GZg6rSHJlmgmOFUZimWU3QX/Pb+0eRAyEBgXsNj Gv3U6YVgvpXfDkh5iThh4gKNQ6MCgIFYphxJaR+7NVI31k+yCHjm0Zy8WVouG3HskhvdIqA3M ov3dans/hRHxCkKITp41hqZzxmfXziJ3hLUY1+zKLMMAVsduJZKk64OwZ6OdAidHfk55Fw2Qh TIET6Sqg0YbfkCYPfrpdwZuyrS+LEDxeHpacXVJpoeOjJgGPVKZOFY8AMeWBVSjcCl8pcC2eM lbxywfVQgFJSjp8jPAaw36CrsXoDJ1ojNlZLIk1NembwKeYkoLzBr586xMJLfcf1DVJJCGR6q 1R531R++qVlBCaCx0OgdQHe/729+oXMhVUV9CyVuPRO+hA2Klel8HzqcfKDML Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: Thomas Huth , qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Replace I/O write error reported with error_report() by qemu_log_mask(GUEST_ERROR) which allow filtering. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Stefano Garzarella Message-Id: <20201210172834.178052-1-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/virtio/virtio-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index f863f69ede4f..094c36aa3ea3 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -27,6 +27,7 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -365,8 +366,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) virtio_queue_set_vector(vdev, vdev->queue_sel, val); break; default: - error_report("%s: unexpected address 0x%x value 0x%x", - __func__, addr, val); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: unexpected address 0x%x value 0x%x\n", + __func__, addr, val); break; } } From patchwork Mon Jan 18 11:32:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1428099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DK8nv6BtWz9sW8 for ; Mon, 18 Jan 2021 22:34:27 +1100 (AEDT) Received: from localhost ([::1]:35442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1Snh-0001d0-QQ for incoming@patchwork.ozlabs.org; Mon, 18 Jan 2021 06:34:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Slt-0007y7-Rb; Mon, 18 Jan 2021 06:32:36 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:55349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Slm-0000TW-Lg; Mon, 18 Jan 2021 06:32:33 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MStOy-1lTQId0hFW-00UMz1; Mon, 18 Jan 2021 12:32:13 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/4] pl031: Use timer_free() in the finalize function to avoid memleaks Date: Mon, 18 Jan 2021 12:32:03 +0100 Message-Id: <20210118113205.1915888-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118113205.1915888-1-laurent@vivier.eu> References: <20210118113205.1915888-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZiGxvzKsj0KAfmOmtibw21jlgd3fohYDzstTPc9Hatb1Di5QVvx B2+/MQnGJynWgmrl6brgUyAtYSXa6iQ/N6p9H9gfm0Mwh9QksWZDlDoFDd/xCx/48SBLp6w ZPKFzWUFM1pqy8W7jyBUlsbNPHdA+8fGJRdnyScD2CrUm9LdlTfiAom8hWSCwK/SOnOGoqC 9Qn4Y8V53fYlp1BvGyIWA== X-UI-Out-Filterresults: notjunk:1;V03:K0:061fqQGQQH0=:VdiZ+EudP3JydSwB2Ztj7N CSN0vC9vPlh+CsjU96bbWajpEVwbi6UCw4KNNmKtu1EHbkOpIdYtWD26T3UwVAeVlYEtPPtTJ MmNGILeqhNH7g+HTO2jXjrPGYoFffxqyx/xBYH+s210AMetBrTc2LqTpg4bCbPZR5bWJrrzqX 72+1XBOtVAyO0fUfVOtLcC/gmBRjB8RN4Ly+1c7jCh604J6Ybll2VQfyQJREg50bn2eF8D4q8 ImrVyGZqykwcOH5u90pE7EJtKUkV/uZdWrNiZRIlttbZ9bbJcqhjgeuB3Yswx9mBS83P2RMb6 NsuzoPBhUEDQCAgvcvvXfPhFU9HUAO2ey+B2u1vE+cdIjy5yCGWO4FyQ0co0CoMH2aeITBjRX y/IyZdEp1JaohDVkJ5+7IWPyCnBfd7wr/WwAycCM8ZGJSkPOZ6EHQsCidnImD Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=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: Peter Maydell , qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Gan Qixin , Euler Robot Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gan Qixin When running device-introspect-test, a memory leak occurred in the pl031_init function, this patch use timer_free() in the finalize function to fix it. ASAN shows memory leak stack: Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0xffffab97e1f0 in __interceptor_calloc (/lib64/libasan.so.5+0xee1f0) #1 0xffffab256800 in g_malloc0 (/lib64/libglib-2.0.so.0+0x56800) #2 0xaaabf5621cfc in timer_new_full qemu/include/qemu/timer.h:523 #3 0xaaabf5621cfc in timer_new qemu/include/qemu/timer.h:544 #4 0xaaabf5621cfc in timer_new_ns qemu/include/qemu/timer.h:562 #5 0xaaabf5621cfc in pl031_init qemu/hw/rtc/pl031.c:194 #6 0xaaabf6339f6c in object_initialize_with_type qemu/qom/object.c:515 #7 0xaaabf633a1e0 in object_new_with_type qemu/qom/object.c:729 #8 0xaaabf6375e40 in qmp_device_list_properties qemu/qom/qom-qmp-cmds.c:153 #9 0xaaabf5a95540 in qdev_device_help qemu/softmmu/qdev-monitor.c:283 #10 0xaaabf5a96940 in qmp_device_add qemu/softmmu/qdev-monitor.c:801 #11 0xaaabf5a96e70 in hmp_device_add qemu/softmmu/qdev-monitor.c:916 #12 0xaaabf5ac0a2c in handle_hmp_command qemu/monitor/hmp.c:1100 Reported-by: Euler Robot Signed-off-by: Gan Qixin Reviewed-by: Peter Maydell Message-Id: <20210112112705.380534-2-ganqixin@huawei.com> Signed-off-by: Laurent Vivier --- hw/rtc/pl031.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index ae47f09635da..2bbb2062ac85 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -194,6 +194,13 @@ static void pl031_init(Object *obj) s->timer = timer_new_ns(rtc_clock, pl031_interrupt, s); } +static void pl031_finalize(Object *obj) +{ + PL031State *s = PL031(obj); + + timer_free(s->timer); +} + static int pl031_pre_save(void *opaque) { PL031State *s = opaque; @@ -329,6 +336,7 @@ static const TypeInfo pl031_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PL031State), .instance_init = pl031_init, + .instance_finalize = pl031_finalize, .class_init = pl031_class_init, }; From patchwork Mon Jan 18 11:32:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1428101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DK8sJ1jTdz9sVr for ; Mon, 18 Jan 2021 22:37:24 +1100 (AEDT) Received: from localhost ([::1]:42232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1SqY-0004To-5F for incoming@patchwork.ozlabs.org; Mon, 18 Jan 2021 06:37:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Slz-0007zA-IK; Mon, 18 Jan 2021 06:32:40 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:39895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Sls-0000Up-1O; Mon, 18 Jan 2021 06:32:39 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M8QBa-1l5qTm2V2e-004PbN; Mon, 18 Jan 2021 12:32:14 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/4] misc/mos6522: Use timer_free() in the finalize function to avoid memleak Date: Mon, 18 Jan 2021 12:32:04 +0100 Message-Id: <20210118113205.1915888-4-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118113205.1915888-1-laurent@vivier.eu> References: <20210118113205.1915888-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:kOWuMus3UQdj1CwohTTwUIPfE1m0cm3AIDrkUyZ5H6hTcmWKVST /kyRw1MHAi1GwnCs0lbahJk6T7ekOJk8ie+vLv1X6H43at/OrLAwv85ukLmIw74RPsSI3lH 9Xxl32mYvm+riF9CNIfoSG2S6UNMZCb0FNW61nwBZH73GNkbFUeSlJD6JIvqlsYhzcLaAod 2znZeiVJVI5KQAoBMHnmA== X-UI-Out-Filterresults: notjunk:1;V03:K0:lG7wYzcJ/iY=:4J/0kcaZR0jW7saUY72tu0 TMcKGUwxB3ajJRILi8V9u2yFvmx+QJZil8h2AVcK9+NPT6DV6mmqpu3CJ/9Av3Rq6srY3wsEy /e53T3EJENkNHd9xffeXngFYnm9DGekogWsoeBIzukSN3QGRyhiZZLDVOWAgIGvMxivpeyHfS Mo7UaUPiLmvSTYUt/gPFtWLW3pcFDDzqlxJSc8wGmzjXwpMBFgsPDT70Fvy+FgXEz3pooa7Tz BiV+BzDG4PxE3w5AwxDJht/v+FI/x9DSGKyyu9oYifjuviL9oi+16pdPVQ6l+uwiZJWdrpZjd 1tyEUfkAVSN+xDNs2OJqbN+fRxWgHfsclQWj/ZueVADq71w00wMB+fnWrAzh8FguKl779J6z2 TkL/9xhKYY9eTttGqUAy4XWqxH0wIum43ICilUyWSKxu1QKa46Lek8SLutiBwXxH09lfe9NVm IZC1FPQxRQ== Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: Peter Maydell , qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Gan Qixin , Euler Robot , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gan Qixin When running device-introspect-test, a memory leak occurred in the mos6522_init function, this patch use timer_free() in the finalize function to fix it. ASAN shows memory leak stack: Direct leak of 96 byte(s) in 2 object(s) allocated from: #0 0xfffd5fe9e1f0 in __interceptor_calloc (/lib64/libasan.so.5+0xee1f0) #1 0xfffd5f7b6800 in g_malloc0 (/lib64/libglib-2.0.so.0+0x56800) #2 0xaaae50303d0c in timer_new_full qemu/include/qemu/timer.h:523 #3 0xaaae50303d0c in timer_new qemu/include/qemu/timer.h:544 #4 0xaaae50303d0c in timer_new_ns qemu/include/qemu/timer.h:562 #5 0xaaae50303d0c in mos6522_init qemu/hw/misc/mos6522.c:490 #6 0xaaae50b77d70 in object_init_with_type qemu/qom/object.c:371 #7 0xaaae50b7ae84 in object_initialize_with_type qemu/qom/object.c:515 #8 0xaaae50b7b0f8 in object_new_with_type qemu/qom/object.c:729 #9 0xaaae50bb6d58 in qmp_device_list_properties qemu/qom/qom-qmp-cmds.c:153 #10 0xaaae50d7e1dc in qmp_marshal_device_list_properties qemu/qapi/qapi-commands-qdev.c:59 #11 0xaaae50dc87a0 in do_qmp_dispatch_bh qemu/qapi/qmp-dispatch.c:110 #12 0xaaae50d931a0 in aio_bh_call qemu/util/async.c:136 Reported-by: Euler Robot Signed-off-by: Gan Qixin Acked-by: David Gibson Reviewed-by: Peter Maydell Message-Id: <20210112112705.380534-3-ganqixin@huawei.com> Signed-off-by: Laurent Vivier --- hw/misc/mos6522.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index ac4cd1d58ebe..1c57332b4004 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -490,6 +490,14 @@ static void mos6522_init(Object *obj) s->timers[1].timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, mos6522_timer2, s); } +static void mos6522_finalize(Object *obj) +{ + MOS6522State *s = MOS6522(obj); + + timer_free(s->timers[0].timer); + timer_free(s->timers[1].timer); +} + static Property mos6522_properties[] = { DEFINE_PROP_UINT64("frequency", MOS6522State, frequency, 0), DEFINE_PROP_END_OF_LIST() @@ -519,6 +527,7 @@ static const TypeInfo mos6522_type_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MOS6522State), .instance_init = mos6522_init, + .instance_finalize = mos6522_finalize, .abstract = true, .class_size = sizeof(MOS6522DeviceClass), .class_init = mos6522_class_init, From patchwork Mon Jan 18 11:32:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1428100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DK8qv3Cdtz9sWR for ; Mon, 18 Jan 2021 22:36:11 +1100 (AEDT) Received: from localhost ([::1]:38672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1SpN-0002wY-A9 for incoming@patchwork.ozlabs.org; Mon, 18 Jan 2021 06:36:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Sli-0007qN-3f; Mon, 18 Jan 2021 06:32:22 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:32835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Slg-0000Q0-Ez; Mon, 18 Jan 2021 06:32:21 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MlO9r-1lkOos0m7x-00llJE; Mon, 18 Jan 2021 12:32:15 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/4] hw/ide/ahci: Replace fprintf() by qemu_log_mask(GUEST_ERROR) Date: Mon, 18 Jan 2021 12:32:05 +0100 Message-Id: <20210118113205.1915888-5-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118113205.1915888-1-laurent@vivier.eu> References: <20210118113205.1915888-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:75/DxdI5dAfrV67DyZ6ZftfY9vcFxZNe2ENnwHOvirp+DuRAj6s 1KFBKiB/zwwbx4XlEbp6PxFmuaMZX4UfmnbtBp25LE6287f1CxFGQDl+RE8nBqkSxNEnrH1 ZClgKBA12YJvWjOLYtg4nyFYrG6V10EGfAzaa+Lc6KrXVznZWZqInDuXUcemOqlr3l9nJjK C/bqu2F+IrubHGqs4SSWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Oo18ZwQLkMk=:/Nh1sYK8HD5tVrPOh9iQD0 EF/833396CidPRsf6M0sENKI720BEfbldlRMaO2PpbDa++rTlvQewqoDA9fvDfrnxdpWKGGpj nt0aIOeJS1BG5pZ3GxJjG5aHFCmhQjXEhvLYsMSjOEymXBZ3umZd84NUE0lBLBPNGY30Bac4c mpewhFAl5257Piq5wT+QkWipLgL6KVx8QKNhdNUu4H5/fx14Cx9tX/mKgDxf4mVSrFKhxDMyS outkzLzoEf1ga9EgTLjJzFPQsXJ+ifgNRylr/JAvtvXQvCicT+8HurAVkg8YtxAucjzUNpFBY S9DMkqLDjpkRIR+MY5/DrhHkPPGu9/8PDazRQHgqiHLqUVXLO/AjmGZXilkTChnrEOVBmDwhC kleESefjsL+W39BQFzf1ibDrN3VohPRzzMXDSN6AHX5TMFq1q9ATNz/m9RpXLqrPvSc8zFcz1 QYkhABlAPQ== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=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: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Michael Tokarev , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Replace fprintf() calls by qemu_log_mask(LOG_GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20210112112955.1849212-1-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/ide/ahci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 4b675b9cfd8d..6d50482b8d1a 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -465,8 +465,9 @@ static void ahci_mem_write(void *opaque, hwaddr addr, /* Only aligned reads are allowed on AHCI */ if (addr & 3) { - fprintf(stderr, "ahci: Mis-aligned write to addr 0x" - TARGET_FMT_plx "\n", addr); + qemu_log_mask(LOG_GUEST_ERROR, + "ahci: Mis-aligned write to addr 0x%03" HWADDR_PRIX "\n", + addr); return; } @@ -1111,7 +1112,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, g_assert(is_ncq(ncq_fis->command)); if (ncq_tfs->used) { /* error - already in use */ - fprintf(stderr, "%s: tag %d already used\n", __func__, tag); + qemu_log_mask(LOG_GUEST_ERROR, "%s: tag %d already used\n", + __func__, tag); return; }