From 5cea8590eaa099be8087f363f80d0e6917382385 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Sat, 30 May 2009 00:52:44 +0100 Subject: Use relative path for bios Look for bios and other support files relative to qemu binary, rather than a hardcoded prefix. Signed-off-by: Paul Brook --- hw/mips_malta.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'hw/mips_malta.c') diff --git a/hw/mips_malta.c b/hw/mips_malta.c index a300808639..970da4e60f 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -758,7 +758,7 @@ void mips_malta_init (ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - char buf[1024]; + char *filename; ram_addr_t ram_offset; ram_addr_t bios_offset; target_long bios_size; @@ -846,12 +846,18 @@ void mips_malta_init (ram_addr_t ram_size, /* Load a BIOS image. */ if (bios_name == NULL) bios_name = BIOS_FILENAME; - snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); - bios_size = load_image_targphys(buf, 0x1fc00000LL, BIOS_SIZE); + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (filename) { + bios_size = load_image_targphys(filename, 0x1fc00000LL, + BIOS_SIZE); + qemu_free(filename); + } else { + bios_size = -1; + } if ((bios_size < 0 || bios_size > BIOS_SIZE) && !kernel_filename) { fprintf(stderr, "qemu: Could not load MIPS bios '%s', and no -kernel argument was specified\n", - buf); + bios_name); exit(1); } } -- cgit v1.2.3