qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] bootdevice: fix segment fault when booting gues


From: Gonglei
Subject: Re: [Qemu-devel] [PATCH] bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
Date: Sat, 28 Feb 2015 09:06:19 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015/2/27 22:15, Paolo Bonzini wrote:
> Looks good, I am applying it locally so that it can get into qemu.git
> very soon.
> 
OK, thanks.

Regards,
-Gonglei
> Paolo
> 
> On 27/02/2015 02:49, address@hidden wrote:
>> From: Gonglei <address@hidden>
>>
>> Reproducer:
>>
>>  $./qemu-system-x86_64 --enable-kvm -kernel 
>> /home/vmlinuz-2.6.32.12-0.7-default \
>>   -initrd /home/initrd-2.6.32.12-0.7-default -append \
>>  "root=/dev/ram rw console=ttyS0,115200" -dtb guest.dtb -vnc :10 --monitor 
>> stdio -smp 2
>> QEMU 2.2.50 monitor - type 'help' for more information
>> (qemu) Segmentation fault (core dumped)
>>
>> Reported-by: Edivaldo de Araujo Pereira <address@hidden>
>> Signed-off-by: Gonglei <address@hidden>
>> ---
>>  bootdevice.c | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/bootdevice.c b/bootdevice.c
>> index df9ab0e..673bfef 100644
>> --- a/bootdevice.c
>> +++ b/bootdevice.c
>> @@ -223,10 +223,15 @@ char *get_boot_devices_list(size_t *size, bool 
>> ignore_suffixes)
>>          }
>>  
>>          if (!ignore_suffixes) {
>> -            d = qdev_get_own_fw_dev_path_from_handler(i->dev->parent_bus, 
>> i->dev);
>> -            if (d) {
>> -                assert(!i->suffix);
>> -                suffix = d;
>> +            if (i->dev) {
>> +                d = 
>> qdev_get_own_fw_dev_path_from_handler(i->dev->parent_bus,
>> +                                                          i->dev);
>> +                if (d) {
>> +                    assert(!i->suffix);
>> +                    suffix = d;
>> +                } else {
>> +                    suffix = g_strdup(i->suffix);
>> +                }
>>              } else {
>>                  suffix = g_strdup(i->suffix);
>>              }
>>





reply via email to

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