Commit d749e10c authored by Gonglei's avatar Gonglei Committed by Gerd Hoffmann
Browse files

bootindex: move calling add_boot_device_patch to bootindex setter function



On this way, we can assure the new bootindex take effect
during vm rebooting.

Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent d2b186f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -212,6 +212,8 @@ static void device_set_bootindex(Object *obj, Visitor *v, void *opaque,
    /* change bootindex to a new one */
    *prop->bootindex = boot_index;

    add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);

out:
    if (local_err) {
        error_propagate(errp, local_err);
+0 −3
Original line number Diff line number Diff line
@@ -2216,9 +2216,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)
        error_propagate(errp, err);
        return;
    }

    add_boot_device_path(isa->bootindexA, dev, "/floppy@0");
    add_boot_device_path(isa->bootindexB, dev, "/floppy@1");
}

static void sysbus_fdc_initfn(Object *obj)
+0 −2
Original line number Diff line number Diff line
@@ -768,8 +768,6 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
    bdrv_set_guest_block_size(s->bs, s->conf->logical_block_size);

    bdrv_iostatus_enable(s->bs);

    add_boot_device_path(s->conf->bootindex, dev, "/disk@0,0");
}

static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
+0 −2
Original line number Diff line number Diff line
@@ -1825,8 +1825,6 @@ static int assigned_initfn(struct PCIDevice *pci_dev)

    assigned_dev_load_option_rom(dev);

    add_boot_device_path(dev->bootindex, &pci_dev->qdev, NULL);

    return 0;

assigned_out:
+0 −1
Original line number Diff line number Diff line
@@ -4296,7 +4296,6 @@ static int vfio_initfn(PCIDevice *pdev)
        }
    }

    add_boot_device_path(vdev->bootindex, &pdev->qdev, NULL);
    vfio_register_err_notifier(vdev);

    return 0;
Loading