summaryrefslogtreecommitdiff
path: root/bootdevice.c
AgeCommit message (Collapse)AuthorFilesLines
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>