bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
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 <edivaldoapereira@yahoo.com.br> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1425001784-6752-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
		
							parent
							
								
									2ed1ebcf65
								
							
						
					
					
						commit
						57fe6a6e4a
					
				| 
						 | 
					@ -221,13 +221,18 @@ char *get_boot_devices_list(size_t *size, bool ignore_suffixes)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!ignore_suffixes) {
 | 
					        if (!ignore_suffixes) {
 | 
				
			||||||
            d = qdev_get_own_fw_dev_path_from_handler(i->dev->parent_bus, i->dev);
 | 
					            if (i->dev) {
 | 
				
			||||||
 | 
					                d = qdev_get_own_fw_dev_path_from_handler(i->dev->parent_bus,
 | 
				
			||||||
 | 
					                                                          i->dev);
 | 
				
			||||||
                if (d) {
 | 
					                if (d) {
 | 
				
			||||||
                    assert(!i->suffix);
 | 
					                    assert(!i->suffix);
 | 
				
			||||||
                    suffix = d;
 | 
					                    suffix = d;
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    suffix = g_strdup(i->suffix);
 | 
					                    suffix = g_strdup(i->suffix);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                suffix = g_strdup(i->suffix);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bootpath = g_strdup_printf("%s%s",
 | 
					        bootpath = g_strdup_printf("%s%s",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue