From patchwork Wed Sep 18 14:56:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11150583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF8E51747 for ; Wed, 18 Sep 2019 15:40:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF65821848 for ; Wed, 18 Sep 2019 15:40:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF65821848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAc3q-00014o-Ko for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Sep 2019 11:40:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49172) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAbs9-0006bb-D0 for qemu-devel@nongnu.org; Wed, 18 Sep 2019 11:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAbs8-0006bo-9G for qemu-devel@nongnu.org; Wed, 18 Sep 2019 11:28:01 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAbs8-0006bW-3Z for qemu-devel@nongnu.org; Wed, 18 Sep 2019 11:28:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id x15so36380pgg.8 for ; Wed, 18 Sep 2019 08:28:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=JhWZs3kYQOWNeKlb2pNkOyfw/b4rNeIZqwng3Q4zhcI=; b=ramZ30ObRgnbJjh3MASXwFXm6rf1/8fFsqNQ7gluyer+a+uHx+WuiCEqt2NqxWFxdE ay+oivGpnUUxGcIGxeJCv2ilLcw6ck3QTIUQK40ermfmxIUMlC2ShUd0ZY6rF/vM92nD 6f0XwNSfhGfE3nAeZb8s2S42p49ATWFheOdbBmn6SwNBZg/4Ce4L6s4nYV9Qis6jCBn/ W9JHUoyE92LdgTIOF5H7NKzNGiTVJn00etzhvRBmsC5F4K0ekQtK1h3JWMGp5V0JLigK KECqCIQUBcnfBgh0rNqYbIe/WJiSfcstwLqGnBE6R9cuhl9i52XvMamgaSDFz/T1UM/B rp+A== X-Gm-Message-State: APjAAAVFbKMzK2pa8iho4OT0ebok57ZgvTn7+w3V7KZgmcYWUykuGrZp VH3y6EHMAh3nfxmFHGvCerct/5zsAh4= X-Google-Smtp-Source: APXvYqzqHelCSqlljqByqBbSQ64IyZY/gtKz4+pYFTcK/H7Xc57YaL3meCdOUH47gbb4MRqn7TuopA== X-Received: by 2002:aa7:9a48:: with SMTP id x8mr4645432pfj.201.1568820479005; Wed, 18 Sep 2019 08:27:59 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a4sm6595516pfn.110.2019.09.18.08.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 08:27:58 -0700 (PDT) Date: Wed, 18 Sep 2019 07:56:03 -0700 Message-Id: <20190918145640.17349-12-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918145640.17349-1-palmer@sifive.com> References: <20190918145640.17349-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.194 Subject: [Qemu-devel] [PULL 11/48] riscv: Resolve full path of the given bios image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Bin Meng , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Palmer Dabbelt Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bin Meng At present when "-bios image" is supplied, we just use the straight path without searching for the configured data directories. Like "-bios default", we add the same logic so that "-L" actually works. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/boot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 10f7991490..2e92fb0680 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -72,14 +72,14 @@ void riscv_find_and_load_firmware(MachineState *machine, firmware_filename = riscv_find_firmware(default_machine_firmware); } else { firmware_filename = machine->firmware; + if (strcmp(firmware_filename, "none")) { + firmware_filename = riscv_find_firmware(firmware_filename); + } } if (strcmp(firmware_filename, "none")) { /* If not "none" load the firmware */ riscv_load_firmware(firmware_filename, firmware_load_addr); - } - - if (!strcmp(machine->firmware, "default")) { g_free(firmware_filename); } }