From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvxuB-0003p8-Vt for qemu-devel@nongnu.org; Sun, 16 Oct 2016 22:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvxu8-0000Nk-Sc for qemu-devel@nongnu.org; Sun, 16 Oct 2016 22:44:00 -0400 From: David Gibson Date: Mon, 17 Oct 2016 13:43:26 +1100 Message-Id: <1476672219-8836-4-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1476672219-8836-1-git-send-email-david@gibson.dropbear.id.au> References: <1476672219-8836-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 03/16] tests/boot-sector: Use minimum length for the Forth boot script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, aik@ozlabs.ru, Thomas Huth , David Gibson From: Thomas Huth The pxe-test is quite slow on ppc64 with tcg. We can speed it up a little bit by decreasing the size of the file that has to be loaded via TFTP. Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Reviewed-by: Michael S. Tsirkin Signed-off-by: David Gibson --- tests/boot-sector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/boot-sector.c b/tests/boot-sector.c index e3193c0..0168fd0 100644 --- a/tests/boot-sector.c +++ b/tests/boot-sector.c @@ -72,6 +72,7 @@ static uint8_t boot_sector[0x7e000] = { int boot_sector_init(const char *fname) { FILE *f = fopen(fname, "w"); + size_t len = sizeof boot_sector; if (!f) { fprintf(stderr, "Couldn't open \"%s\": %s", fname, strerror(errno)); @@ -80,13 +81,12 @@ int boot_sector_init(const char *fname) /* For Open Firmware based system, we can use a Forth script instead */ if (strcmp(qtest_get_arch(), "ppc64") == 0) { - memset(boot_sector, ' ', sizeof boot_sector); - sprintf((char *)boot_sector, "\\ Bootscript\n%x %x c! %x %x c!\n", + len = sprintf((char *)boot_sector, "\\ Bootscript\n%x %x c! %x %x c!\n", LOW(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET, HIGH(SIGNATURE), BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1); } - fwrite(boot_sector, 1, sizeof boot_sector, f); + fwrite(boot_sector, 1, len, f); fclose(f); return 0; } -- 2.7.4