From patchwork Tue Aug 7 19:26:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 175769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B01022C008D for ; Wed, 8 Aug 2012 05:26:50 +1000 (EST) Received: from localhost ([::1]:57908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SypQW-00060X-2S for incoming@patchwork.ozlabs.org; Tue, 07 Aug 2012 15:26:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SypQO-0005zT-Bv for qemu-devel@nongnu.org; Tue, 07 Aug 2012 15:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SypQM-0007qc-Tr for qemu-devel@nongnu.org; Tue, 07 Aug 2012 15:26:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SypQM-0007qW-LM for qemu-devel@nongnu.org; Tue, 07 Aug 2012 15:26:38 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q77JQaa8002260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Aug 2012 15:26:37 -0400 Received: from blackfin.pond.sub.org (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q77JQZ78028912; Tue, 7 Aug 2012 15:26:36 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DE35020058; Tue, 7 Aug 2012 21:26:34 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 07 Aug 2012 21:26:34 +0200 Message-ID: <87obmmcxlh.fsf@blackfin.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Anthony Liguori Subject: [Qemu-devel] For all targets and machine types: "start to monitor" smoke test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Very basic smoke test: start QEMU with -monitor stdio, quit immediately. Wouldn't it be nice if that worked for all targets and machine types? Many targets have mandatory options (fun oxymoron), such as -kernel or -pflash. Can't stop me, I just try a bunch until something works. Many targets expect various files to be present, and some of them need to have the right size. Can't stop me, I hack up the file loaders until it works (silly patch appended). To do this right, we'd need the required files or suitable mock-ups in-tree. Test script: #!/bin/sh for i in ../qemu/bld/*-softmmu/qemu-system-* do echo "= $i =" for m in `$i -M help | sed -n '2,$s/ .*//gp'` do echo "== $m ==" for k in "" "-kernel /dev/null" "-pflash /dev/null" "-pflash /dev/null -pflash /dev/null -kernel /dev/null" do echo "=== ${k:-(default)} ===" if echo q | QEMU_AUDIO_DRV=none $i -S -vnc :0 -M $m $k -monitor stdio | fgrep -q '(qemu)' then break else false fi done if [ $? -eq 0 ] then echo "*** Success $k ***" else echo '*** Fail' fi done done Summary of results: * Bad unexplained qemu-system-arm lm3s811evb qemu-system-arm lm3s6965evb qemu-system-arm: /work/armbru/qemu/hw/qdev.c:310: qdev_get_gpio_in: Assertion `n >= 0 && n < dev->num_gpio_in' failed. qemu-system-ppc64 prep qemu: hardware error: Unknown device 'i82378' for bus 'PCI' qemu-system-ppcemb ref405ep qemu-system-ppcemb taihu Unable to find PowerPC 405ep CPU definition qemu-system-ppcemb mac99 qemu-system-ppcemb g3beige qemu-system-ppcemb prep Unable to find PowerPC CPU definition qemu-system-xtensaeb lx60 qemu-system-xtensaeb lx200 qemu-system-xtensaeb sim Unable to find CPU definition I'm not saying these are all busted. If you know how to "start to monitor" one of these, let us know. * Not easily testable for me qemu-system-i386 xenfv qemu-system-i386 xenpv qemu-system-x86_64 xenfv qemu-system-x86_64 xenpv failed to initialize Xen: Operation not permitted No accelerator found! * Good qemu-system-alpha clipper qemu-system-arm collie nuri smdkc210 connex verdex highbank integratorcp kzm mainstone musicpal n800 n810 sx1 sx1-v1 cheetah realview-eb realview-eb-mpcore realview-pb-a8 realview-pbx-a9 akita spitz borzoi terrier tosa versatilepb versatileab vexpress-a9 vexpress-a15 xilinx-zynq-a9 z2 qemu-system-cris axis-dev88 qemu-system-i386 pc pc-1.2 pc-1.1 pc-1.0 pc-0.15 pc-0.14 pc-0.13 pc-0.12 pc-0.11 pc-0.10 isapc qemu-system-lm32 lm32-uclinux lm32-evr milkymist qemu-system-m68k an5206 dummy mcf5208evb qemu-system-microblaze petalogix-ml605 petalogix-s3adsp1800 qemu-system-microblazeel petalogix-ml605 petalogix-s3adsp1800 qemu-system-mips magnum pica61 malta mipssim mips qemu-system-mips64 magnum pica61 malta mipssim mips qemu-system-mips64el fulong2e magnum pica61 malta mipssim mips qemu-system-mipsel magnum pica61 malta mipssim mips qemu-system-or32 or32-sim qemu-system-ppc ref405ep taihu bamboo mac99 g3beige prep virtex-ml507 qemu-system-ppc64 ref405ep taihu bamboo mac99 g3beige virtex-ml507 qemu-system-ppcemb bamboo virtex-ml507 qemu-system-s390x s390 s390-virtio qemu-system-sh4 r2d shix qemu-system-sh4eb r2d shix qemu-system-sparc leon3_generic SS-5 SS-10 SS-600MP SS-20 Voyager LX SS-4 SPARCClassic SPARCbook SS-1000 SS-2000 SS-2 qemu-system-sparc64 sun4u sun4v Niagara qemu-system-x86_64 pc pc-1.2 pc-1.1 pc-1.0 pc-0.15 pc-0.14 pc-0.13 pc-0.12 pc-0.11 pc-0.10 isapc qemu-system-xtensa lx60 lx200 sim diff --git a/hw/loader.c b/hw/loader.c index 33acc2f..e23af6c 100644 --- a/hw/loader.c +++ b/hw/loader.c @@ -62,7 +62,7 @@ int get_image_size(const char *filename) int fd, size; fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) - return -1; + return 0;//-1; size = lseek(fd, 0, SEEK_END); close(fd); return size; @@ -75,7 +75,7 @@ int load_image(const char *filename, uint8_t *addr) int fd, size; fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) - return -1; + return 0;//-1; size = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); if (read(fd, addr, size) != size) { @@ -108,6 +108,7 @@ int load_image_targphys(const char *filename, int size; size = get_image_size(filename); + if (size < 0) size = 0; if (size > max_sz) { return -1; } @@ -293,7 +294,7 @@ int load_elf(const char *filename, uint64_t (*translate_fn)(void *, uint64_t), fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { perror(filename); - return -1; + return 0;//-1; } if (read(fd, e_ident, sizeof(e_ident)) != sizeof(e_ident)) goto fail; @@ -332,7 +333,7 @@ int load_elf(const char *filename, uint64_t (*translate_fn)(void *, uint64_t), fail: close(fd); - return -1; + return 0;//-1; } static void bswap_uboot_header(uboot_image_header_t *hdr) diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c index d1c7423..f4c20dd 100644 --- a/hw/pflash_cfi01.c +++ b/hw/pflash_cfi01.c @@ -609,7 +609,7 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base, pfl->storage = memory_region_get_ram_ptr(&pfl->mem); memory_region_add_subregion(get_system_memory(), base, &pfl->mem); - pfl->bs = bs; + pfl->bs = NULL;//bs; if (pfl->bs) { /* read the initial flash content */ ret = bdrv_read(pfl->bs, 0, pfl->storage, total_len >> 9); diff --git a/vl.c b/vl.c index 9fea320..bcba96d 100644 --- a/vl.c +++ b/vl.c @@ -1814,6 +1814,7 @@ char *qemu_find_file(int type, const char *name) snprintf(buf, len, "%s/%s%s", data_dir, subdir, name); if (access(buf, R_OK)) { g_free(buf); + return g_strdup("/dev/null"); return NULL; } return buf;