From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNQjy-0007SU-20 for qemu-devel@nongnu.org; Wed, 03 Apr 2013 12:40:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNQjq-0005Ag-82 for qemu-devel@nongnu.org; Wed, 03 Apr 2013 12:40:49 -0400 From: Fabien Chouteau Date: Wed, 3 Apr 2013 18:40:13 +0200 Message-Id: <1365007213-27603-4-git-send-email-chouteau@adacore.com> In-Reply-To: <1365007213-27603-1-git-send-email-chouteau@adacore.com> References: <1365007213-27603-1-git-send-email-chouteau@adacore.com> Subject: [Qemu-devel] [PATCH 3/3] PPC PReP: can run without bios image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, agraf@suse.de If we use an ELF kernel there's no need for bios. '-bios -' means no bios. Signed-off-by: Fabien Chouteau --- hw/ppc/prep.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 12198ff..8acec46 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -517,13 +517,22 @@ static void ppc_prep_init(QEMUMachineInitArgs *args) memory_region_set_readonly(bios, true); memory_region_add_subregion(sysmem, (uint32_t)(-BIOS_SIZE), bios); vmstate_register_ram_global(bios); - if (bios_name == NULL) - bios_name = BIOS_FILENAME; - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - if (filename) { - bios_size = get_image_size(filename); - } else { + + if (bios_name != NULL && strcmp(bios_name, "-") == 0) { + /* No bios */ bios_size = -1; + filename = NULL; + } else { + if (bios_name == NULL) { + /* Default bios */ + bios_name = BIOS_FILENAME; + } + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (filename != NULL) { + bios_size = get_image_size(filename); + } else { + bios_size = -1; + } } if (bios_size > 0 && bios_size <= BIOS_SIZE) { hwaddr bios_addr; @@ -531,7 +540,7 @@ static void ppc_prep_init(QEMUMachineInitArgs *args) bios_addr = (uint32_t)(-bios_size); bios_size = load_image_targphys(filename, bios_addr, bios_size); } - if (bios_size < 0 || bios_size > BIOS_SIZE) { + if (filename != NULL && (bios_size < 0 || bios_size > BIOS_SIZE)) { hw_error("qemu: could not load PPC PREP bios '%s'\n", bios_name); } if (filename) { -- 1.7.9.5