qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order


From: Gonglei
Subject: Re: [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order()
Date: Fri, 30 Jan 2015 08:47:06 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 2015/1/30 0:03, Alexander Graf wrote:

> 
> 
> On 29.01.15 14:29, address@hidden wrote:
>> From: Gonglei <address@hidden>
>>
>> If boot order is invaild or is set failed,
>> exit qemu.
>>
>> Signed-off-by: Gonglei <address@hidden>
> 
> Do we really want to kill the machine only because the boot device
> string doesn't validate?
> 

Not all of the situation. If people want to change boot order by qmp/hmp
command, it just report an error, please see do_boot_set(). But if the boot
order is set in qemu command line, it will exit qemu if the boot device string
is invalidate, as this patch's situation, which follow the original processing
way (commit ef3adf68).

Regards,
-Gonglei

> 
> Alex
> 
>> ---
>>  bootdevice.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/bootdevice.c b/bootdevice.c
>> index 52d3f9e..8d05b8d 100644
>> --- a/bootdevice.c
>> +++ b/bootdevice.c
>> @@ -94,6 +94,7 @@ void restore_boot_order(void *opaque)
>>  {
>>      char *normal_boot_order = opaque;
>>      static int first = 1;
>> +    Error *local_err = NULL;
>>  
>>      /* Restore boot order and remove ourselves after the first boot */
>>      if (first) {
>> @@ -101,7 +102,12 @@ void restore_boot_order(void *opaque)
>>          return;
>>      }
>>  
>> -    qemu_boot_set(normal_boot_order, NULL);
>> +    qemu_boot_set(normal_boot_order, &local_err);
>> +    if (local_err) {
>> +        error_report("%s", error_get_pretty(local_err));
>> +        error_free(local_err);
>> +        exit(1);
>> +    }
>>  
>>      qemu_unregister_reset(restore_boot_order, normal_boot_order);
>>      g_free(normal_boot_order);
>>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]