[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH] hw/s390x/ipl: Bail out if the netw
From: |
Thomas Huth |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH] hw/s390x/ipl: Bail out if the network bootloader can not be found |
Date: |
Tue, 27 Feb 2018 11:27:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 27.02.2018 11:16, Viktor Mihajlovski wrote:
> On 27.02.2018 11:05, Thomas Huth wrote:
>> If QEMU fails to load 's390-netboot.img', the guest firmware currently
>> loops forever and just floods the console with "Network boot device
>> detected" messages. The code in ipl.c apparently already tried to stop
>> the VM with vm_stop() in this case, but this is in vain since the run
>> state is later reset due to a call to vm_start() from vl.c again.
>> To avoid the ugly firmware loop, let's simply exit QEMU directly instead
>> since it just does not make sense to continue if the required firmware
>> image can not be loaded. While we're at it, also add the file name of
>> the netboot binary to the error message, so that the user has a better
>> hint about what is missing.
>>
>> Signed-off-by: Thomas Huth <address@hidden>
>> ---
>> hw/s390x/ipl.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
>> index 0d06fc1..ff8308e 100644
>> --- a/hw/s390x/ipl.c
>> +++ b/hw/s390x/ipl.c
>> @@ -322,7 +322,8 @@ static int load_netboot_image(Error **errp)
>>
>> netboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->netboot_fw);
>> if (netboot_filename == NULL) {
>> - error_setg(errp, "Could not find network bootloader");
>> + error_setg(errp, "Could not find network bootloader '%s'",> +
>> ipl->netboot_fw);
>> goto unref_mr;
>> }
>>
>> @@ -416,7 +417,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
>> if (ipl->netboot) {
>> if (load_netboot_image(&err) < 0) {
>> error_report_err(err);
>> - vm_stop(RUN_STATE_INTERNAL_ERROR);
> Should we print something like 'exiting' or 'terminating' here, to make
> clear that the situation is terminal?
No, we normally don't print out "exiting" or "terminating" in such a
case. For example:
hw/alpha/dp264.c: error_report("could not load palcode '%s'",
palcode_filename);
hw/alpha/dp264.c: exit(1);
hw/arm/boot.c: error_report("failed to load \"%s\"", image_name);
hw/arm/boot.c: exit(1);
hw/mips/mips_jazz.c: error_report("Could not load MIPS bios '%s'", bios_name);
hw/mips/mips_jazz.c: exit(1);
hw/ppc/spapr.c: error_report("Could not load LPAR rtas '%s'", filename);
hw/ppc/spapr.c: exit(1);
etc.
Thomas