]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bootindex: rework add_boot_device_path function
authorGonglei <arei.gonglei@huawei.com>
Tue, 7 Oct 2014 08:00:09 +0000 (16:00 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Oct 2014 07:52:47 +0000 (09:52 +0200)
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>
bootdevice.c

index 7167fbcfe676308aace7264f13f4125b88ad3256..aac0ffbcefcb2788b1f4caeeebb215ad550b1c52 100644 (file)
@@ -82,6 +82,8 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     assert(dev != NULL || suffix != NULL);
 
+    del_boot_device_path(dev, suffix);
+
     node = g_malloc0(sizeof(FWBootEntry));
     node->bootindex = bootindex;
     node->suffix = g_strdup(suffix);