aboutsummaryrefslogtreecommitdiff
path: root/bootdevice.c
AgeCommit message (Collapse)AuthorFilesLines
2015-03-26misc: fix typos in copyright declarationGonglei1-1/+1
Add a space after comma. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1427374663-10168-1-git-send-email-arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-08Merge remote-tracking branch 'remotes/gonglei/tags/bootdevice-next-20150303' ↵Peter Maydell1-1/+3
into staging bootdevice: bug fixes # gpg: Signature made Tue Mar 3 05:18:39 2015 GMT using RSA key ID DDE30FBB # gpg: Good signature from "Gonglei <arei.gonglei@huawei.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 5178 9C82 617F 2F58 8693 63B1 BA7A 65B0 DDE3 0FBB * remotes/gonglei/tags/bootdevice-next-20150303: bootdevice: add check in restore_boot_order() bootdevice: check boot order argument validation before vm running Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03bootdevice: add check in restore_boot_order()Gonglei1-1/+3
qemu_boot_set() can't fail in restore_boot_order(), then simply assert it doesn't fail, by passing &error_abort if boot_set_handler set. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2015-02-27bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'Gonglei1-4/+9
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>
2015-02-11qdev: support to get a device firmware path directlyGonglei1-14/+17
commit 6b1566c (qdev: Introduce FWPathProvider interface) did a good job for supproting to get firmware path on some different architectures. Moreover further more, we can use the interface to get firmware path name for a device which isn't attached a specific bus, such as virtio-bus, scsi-bus etc. When the device (such as vhost-scsi) realize the TYPE_FW_PATH_PROVIDER interface, we should introduce a new function to get the correct firmware path name for it. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-22bootdevice: add Error **errp argument for QEMUBootSetHandlerGonglei1-4/+1
It will be useful for checking when we change traditional boot order dynamically and propagate error message to the monitor. For x86 architecture, we pass &local_err to set_boot_dev() when vm startup in pc_coms_init(). Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Alexander Graf <agraf@suse.de> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: qemu-ppc@nongnu.org Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-12-22bootdevice: add validate check for qemu_boot_set()Gonglei1-0/+8
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-12-22bootdevice: add Error **errp argument for qemu_boot_set()Gonglei1-4/+10
It will be useful for checking when we change traditional boot order dynamically and propagate error message to the monitor. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-12-22bootdevice: add Error **errp argument for validate_bootdevices()Gonglei1-5/+5
It will be useful for checking when we change traditional boot order dynamically and propagate error message to the monitor. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-12-22bootdevice: move code about bootorder from vl.c to bootdevice.cGonglei1-0/+62
First, we can downsize vl.c, make it simpler by little and little. Second, I can maintain those code and make some improvement. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-10-15bootindex: change fprintf to error_reportGonglei1-1/+2
The function may be called by qmp command, we should report error message to the caller. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: delete bootindex when device is removedGonglei1-0/+2
Device should be removed from global boot list when it is hot-unplugged. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: move calling add_boot_device_patch to bootindex setter functionGonglei1-0/+2
On this way, we can assure the new bootindex take effect during vm rebooting. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add a setter/getter functions wrapper for bootindex propertyGonglei1-0/+73
when we remove bootindex form qdev.property to qom.property, we can use those functions set/get bootindex property for all correlative devices. Meanwhile set the initial value of bootindex to -1. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: support to set a existent device's bootindex to -1Gonglei1-0/+1
When set a device's bootindex to -1, we remove it from global fw_boot_order list. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: rework add_boot_device_path functionGonglei1-0/+2
Add the function of updating bootindex about fw_boot_order list in add_boot_device_path(). We should delete the old one if a device has existed in global fw_boot_order list. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add del_boot_device_path functionGonglei1-0/+20
Introduce del_boot_device_path() to clean up fw_cfg content when hot-unplugging a device that refers to a bootindex or update a existent devcie's bootindex. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Chenliang <chenliang88@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootindex: add check bootindex functionGonglei1-0/+15
Determine whether a given bootindex exists or not. If exists, we report an error. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-10-15bootdevice: move bootdevice related code to new file bootdevice.cGonglei1-0/+142
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>