From patchwork Mon Oct 16 13:12:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzM92JFfz9t3R for ; Tue, 17 Oct 2017 00:15:01 +1100 (AEDT) Received: from localhost ([::1]:32936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45ER-0004XV-DW for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:14:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CM-0003F6-L2 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CK-00014Y-F0 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33218) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CK-00013A-6S for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A8F281E06; Mon, 16 Oct 2017 13:12:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4A8F281E06 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77E125C7A4; Mon, 16 Oct 2017 13:12:46 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:40 +0200 Message-Id: <1508159564-30317-2-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 16 Oct 2017 13:12:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] hw/m68k: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org, Alistair Francis Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Thomas Huth [thuth: Remove "qemu:" prefix from strings] Signed-off-by: Thomas Huth --- hw/m68k/an5206.c | 4 ++-- hw/m68k/mcf5206.c | 3 ++- hw/m68k/mcf5208.c | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c index 9002c46..db634cb 100644 --- a/hw/m68k/an5206.c +++ b/hw/m68k/an5206.c @@ -66,7 +66,7 @@ static void an5206_init(MachineState *machine) if (qtest_enabled()) { return; } - fprintf(stderr, "Kernel image must be specified\n"); + error_report("Kernel image must be specified"); exit(1); } @@ -83,7 +83,7 @@ static void an5206_init(MachineState *machine) entry = KERNEL_LOAD_ADDR; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); + error_report("Could not load kernel '%s'", kernel_filename); exit(1); } diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index b81901f..fbf3f0f 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -220,7 +221,7 @@ static void m5206_mbar_update(m5206_mbar_state *s) break; default: /* Unknown vector. */ - fprintf(stderr, "Unhandled vector for IRQ %d\n", irq); + error_report("Unhandled vector for IRQ %d", irq); vector = 0xf; break; } diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index b9dde75..c9c5f5e 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -257,7 +258,7 @@ static void mcf5208evb_init(MachineState *machine) mcf5208_sys_init(address_space_mem, pic); if (nb_nics > 1) { - fprintf(stderr, "Too many NICs\n"); + error_report("Too many NICs"); exit(1); } if (nd_table[0].used) { @@ -292,7 +293,7 @@ static void mcf5208evb_init(MachineState *machine) if (qtest_enabled()) { return; } - fprintf(stderr, "Kernel image must be specified\n"); + error_report("Kernel image must be specified"); exit(1); } @@ -309,7 +310,7 @@ static void mcf5208evb_init(MachineState *machine) entry = 0x40000000; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); + error_report("Could not load kernel '%s'", kernel_filename); exit(1); } From patchwork Mon Oct 16 13:12:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzKN4phjz9t3R for ; Tue, 17 Oct 2017 00:13:28 +1100 (AEDT) Received: from localhost ([::1]:32931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45Cw-0003JB-Om for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:13:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CP-0003Gz-JR for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CO-00018N-JX for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45868) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CO-00017S-D4 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82B4D13AA3; Mon, 16 Oct 2017 13:12:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 82B4D13AA3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id A52BF61349; Mon, 16 Oct 2017 13:12:47 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:41 +0200 Message-Id: <1508159564-30317-3-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 16 Oct 2017 13:12:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] M68K: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed commits] Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- hw/m68k/mcf5206.c | 4 ++-- hw/m68k/mcf5208.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index fbf3f0f..bd8e993 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -138,7 +138,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq) m5206_timer_state *s; QEMUBH *bh; - s = (m5206_timer_state *)g_malloc0(sizeof(m5206_timer_state)); + s = g_new0(m5206_timer_state, 1); bh = qemu_bh_new(m5206_timer_trigger, s); s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT); s->irq = irq; @@ -534,7 +534,7 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu) m5206_mbar_state *s; qemu_irq *pic; - s = (m5206_mbar_state *)g_malloc0(sizeof(m5206_mbar_state)); + s = g_new0(m5206_mbar_state, 1); memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s, "mbar", 0x00001000); diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index c9c5f5e..68589c3 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -184,7 +184,7 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic) memory_region_add_subregion(address_space, 0xfc0a8000, iomem); /* Timers. */ for (i = 0; i < 2; i++) { - s = (m5208_timer_state *)g_malloc0(sizeof(m5208_timer_state)); + s = g_new0(m5208_timer_state, 1); bh = qemu_bh_new(m5208_timer_trigger, s); s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT); memory_region_init_io(&s->iomem, NULL, &m5208_timer_ops, s, From patchwork Mon Oct 16 13:12:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzMJ6YcFz9t3R for ; Tue, 17 Oct 2017 00:15:08 +1100 (AEDT) Received: from localhost ([::1]:32937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45EY-0004bX-4k for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:15:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CR-0003IZ-Q7 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CQ-0001Ah-N7 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34504) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CQ-0001A0-DD for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72A9B7E423; Mon, 16 Oct 2017 13:12:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 72A9B7E423 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3835518B4C; Mon, 16 Oct 2017 13:12:51 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:42 +0200 Message-Id: <1508159564-30317-4-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 16 Oct 2017 13:12:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] tests: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: split of some files in other commits of the same series, add libqtest.c] Acked-by: John Snow Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/ahci-test.c | 4 ++-- tests/fw_cfg-test.c | 4 ++-- tests/libqos/ahci.c | 2 +- tests/libqos/libqos.c | 2 +- tests/libqos/malloc.c | 6 +++--- tests/libqtest.c | 2 +- tests/pc-cpu-test.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 999121b..cb84edc 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -155,7 +155,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) { AHCIQState *s; - s = g_malloc0(sizeof(AHCIQState)); + s = g_new0(AHCIQState, 1); s->parent = qtest_pc_vboot(cli, ap); alloc_set_flags(s->parent->alloc, ALLOC_LEAK_ASSERT); @@ -1806,7 +1806,7 @@ static void create_ahci_io_test(enum IOMode type, enum AddrMode addr, char *name; AHCIIOTestOptions *opts; - opts = g_malloc(sizeof(AHCIIOTestOptions)); + opts = g_new(AHCIIOTestOptions, 1); opts->length = len; opts->address_type = addr; opts->io_type = type; diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 688342b..81f45bd 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -79,8 +79,8 @@ static void test_fw_cfg_numa(void) g_assert_cmpint(qfw_cfg_get_u64(fw_cfg, FW_CFG_NUMA), ==, nb_nodes); - cpu_mask = g_malloc0(sizeof(uint64_t) * max_cpus); - node_mask = g_malloc0(sizeof(uint64_t) * nb_nodes); + cpu_mask = g_new0(uint64_t, max_cpus); + node_mask = g_new0(uint64_t, nb_nodes); qfw_cfg_read_data(fw_cfg, cpu_mask, sizeof(uint64_t) * max_cpus); qfw_cfg_read_data(fw_cfg, node_mask, sizeof(uint64_t) * nb_nodes); diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 1ca7f45..13c0749 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -843,7 +843,7 @@ AHCICommand *ahci_command_create(uint8_t command_name) AHCICommand *cmd; g_assert(props); - cmd = g_malloc0(sizeof(AHCICommand)); + cmd = g_new0(AHCICommand, 1); g_assert(!(props->dma && props->pio)); g_assert(!(props->lba28 && props->lba48)); g_assert(!(props->read && props->write)); diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c index 6226546..991bc1a 100644 --- a/tests/libqos/libqos.c +++ b/tests/libqos/libqos.c @@ -17,7 +17,7 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) { char *cmdline; - struct QOSState *qs = g_malloc(sizeof(QOSState)); + struct QOSState *qs = g_new(QOSState, 1); cmdline = g_strdup_vprintf(cmdline_fmt, ap); qs->qts = qtest_start(cmdline); diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index b8eff5f..ac05874 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -129,7 +129,7 @@ static MemBlock *mlist_new(uint64_t addr, uint64_t size) if (!size) { return NULL; } - block = g_malloc0(sizeof(MemBlock)); + block = g_new0(MemBlock, 1); block->addr = addr; block->size = size; @@ -305,8 +305,8 @@ QGuestAllocator *alloc_init(uint64_t start, uint64_t end) s->start = start; s->end = end; - s->used = g_malloc(sizeof(MemList)); - s->free = g_malloc(sizeof(MemList)); + s->used = g_new(MemList, 1); + s->free = g_new(MemList, 1); QTAILQ_INIT(s->used); QTAILQ_INIT(s->free); diff --git a/tests/libqtest.c b/tests/libqtest.c index cbd7094..adf7118 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -171,7 +171,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) gchar *command; const char *qemu_binary = qtest_qemu_binary(); - s = g_malloc(sizeof(*s)); + s = g_new(QTestState, 1); socket_path = g_strdup_printf("/tmp/qtest-%d.sock", getpid()); qmp_socket_path = g_strdup_printf("/tmp/qtest-%d.qmp", getpid()); diff --git a/tests/pc-cpu-test.c b/tests/pc-cpu-test.c index c4211a4..11d3e81 100644 --- a/tests/pc-cpu-test.c +++ b/tests/pc-cpu-test.c @@ -87,7 +87,7 @@ static void add_pc_test_case(const char *mname) if (!g_str_has_prefix(mname, "pc-")) { return; } - data = g_malloc(sizeof(PCTestData)); + data = g_new(PCTestData, 1); data->machine = g_strdup(mname); data->cpu_model = "Haswell"; /* 1.3+ theoretically */ data->sockets = 1; From patchwork Mon Oct 16 13:12:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzP21Qbtz9t3Z for ; Tue, 17 Oct 2017 00:16:38 +1100 (AEDT) Received: from localhost ([::1]:32946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45G0-0005nD-BZ for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:16:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CS-0003J9-Fn for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CR-0001BF-H1 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39302) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CR-0001Al-B3 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CE294ACCB; Mon, 16 Oct 2017 13:12:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5CE294ACCB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5CA261349; Mon, 16 Oct 2017 13:12:53 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:43 +0200 Message-Id: <1508159564-30317-5-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 16 Oct 2017 13:12:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/5] tests/prom-env: Bump the timeout, and test pseries only in slow mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If QEMU has been compiled with the flags --enable-tcg-interpreter and --enable-debug, the guest is running incredibly slow. The prom-env test is approximately 10 times slower than normal in this case, and it takes up to 500 seconds until the test with the pseries machine finishs. While we should still look for ways to speed up the test on the pseries machine here, let's bump the timeout to 600 seconds to allow the test to pass with this unusal configuration already now. Also move the pseries test into the "slow" category - since it is really a very slow test. Reviewed-by: Stefan Weil Signed-off-by: Thomas Huth --- tests/prom-env-test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c index eac207b..bc8b616 100644 --- a/tests/prom-env-test.c +++ b/tests/prom-env-test.c @@ -1,7 +1,7 @@ /* - * Test OpenBIOS-based machines. + * Test Open-Firmware-based machines. * - * Copyright (c) 2016 Red Hat Inc. + * Copyright (c) 2016, 2017 Red Hat Inc. * * Author: * Thomas Huth @@ -30,8 +30,8 @@ static void check_guest_memory(void) uint32_t signature; int i; - /* Poll until code has run and modified memory. Wait at most 120 seconds */ - for (i = 0; i < 12000; ++i) { + /* Poll until code has run and modified memory. Wait at most 600 seconds */ + for (i = 0; i < 60000; ++i) { signature = readl(ADDRESS); if (signature == MAGIC) { break; @@ -78,7 +78,6 @@ int main(int argc, char *argv[]) const char *sparc_machines[] = { "SPARCbook", "Voyager", "SS-20", NULL }; const char *sparc64_machines[] = { "sun4u", NULL }; const char *ppc_machines[] = { "mac99", "g3beige", NULL }; - const char *ppc64_machines[] = { "mac99", "g3beige", "pseries", NULL }; const char *arch = qtest_get_arch(); g_test_init(&argc, &argv, NULL); @@ -86,7 +85,10 @@ int main(int argc, char *argv[]) if (!strcmp(arch, "ppc")) { add_tests(ppc_machines); } else if (!strcmp(arch, "ppc64")) { - add_tests(ppc64_machines); + add_tests(ppc_machines); + if (g_test_slow()) { + qtest_add_data_func("prom-env/pseries", "pseries", test_machine); + } } else if (!strcmp(arch, "sparc")) { add_tests(sparc_machines); } else if (!strcmp(arch, "sparc64")) { From patchwork Mon Oct 16 13:12:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzRr5dgmz9t3R for ; Tue, 17 Oct 2017 00:19:04 +1100 (AEDT) Received: from localhost ([::1]:32951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45IM-0007R1-OE for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:19:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CV-0003Lv-LZ for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:13:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CS-0001Bt-Gp for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39352) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CS-0001BV-AO for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E1C84E34A; Mon, 16 Oct 2017 13:12:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6E1C84E34A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id A162718B4C; Mon, 16 Oct 2017 13:12:54 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:44 +0200 Message-Id: <1508159564-30317-6-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 16 Oct 2017 13:12:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/5] default-configs: Enable CONFIG_VMXNET3_PCI only on x86 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The device can not be instantiated on many non-x86 and just prints some error messages, e.g.: $ qemu-system-ppc64 -device vmxnet3 -M g3beige [vmxnet3][WR][vmxnet3_init_msix]: Failed to initialize MSI-X, error -95 [vmxnet3][WR][vmxnet3_pci_realize]: Failed to initialize MSI-X, configuration is inconsistent. Since vmxnet3 is a para-virtualized device that is only useful on x86, it should also only be enabled on the x86 targets. Reviewed-by: Dmitry Fleytman Signed-off-by: Thomas Huth --- default-configs/i386-softmmu.mak | 1 + default-configs/pci.mak | 1 - default-configs/x86_64-softmmu.mak | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index d2ab2f6..a685c43 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -7,6 +7,7 @@ CONFIG_QXL=$(CONFIG_SPICE) CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y +CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y CONFIG_VMMOUSE=y CONFIG_IPMI=y diff --git a/default-configs/pci.mak b/default-configs/pci.mak index 187e438..e514bde 100644 --- a/default-configs/pci.mak +++ b/default-configs/pci.mak @@ -22,7 +22,6 @@ CONFIG_MPTSAS_SCSI_PCI=y CONFIG_RTL8139_PCI=y CONFIG_E1000_PCI=y CONFIG_E1000E_PCI=y -CONFIG_VMXNET3_PCI=y CONFIG_IDE_CORE=y CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak index 9bde2f1..ea69e82 100644 --- a/default-configs/x86_64-softmmu.mak +++ b/default-configs/x86_64-softmmu.mak @@ -7,6 +7,7 @@ CONFIG_QXL=$(CONFIG_SPICE) CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y +CONFIG_VMXNET3_PCI=y CONFIG_VIRTIO_VGA=y CONFIG_VMMOUSE=y CONFIG_IPMI=y