]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bootindex: move calling add_boot_device_patch to bootindex setter function
authorGonglei <arei.gonglei@huawei.com>
Tue, 7 Oct 2014 08:00:36 +0000 (16:00 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Oct 2014 08:46:01 +0000 (10:46 +0200)
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>
18 files changed:
bootdevice.c
hw/block/fdc.c
hw/block/virtio-blk.c
hw/i386/kvm/pci-assign.c
hw/misc/vfio.c
hw/net/e1000.c
hw/net/eepro100.c
hw/net/ne2000.c
hw/net/pcnet.c
hw/net/rtl8139.c
hw/net/spapr_llan.c
hw/net/virtio-net.c
hw/net/vmxnet3.c
hw/scsi/scsi-disk.c
hw/scsi/scsi-generic.c
hw/usb/dev-network.c
hw/usb/host-libusb.c
hw/usb/redirect.c

index 69cffd8021ad776cb1d8811cd765fd0a381959c6..79c2327142d5a8dd0ba1c4e68bce2469ec7a09fb 100644 (file)
@@ -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);
index 9f9484cd174915e182ab4786016d820f6d079ed1..34c1d8f1c92589e5f3d814673cd3a4424aa36f94 100644 (file)
@@ -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)
index fd1ad3abbe803b5bfa0f860f167b59a8b12eef9f..1fa97709c8c1b99d6a1d63965c026f3a58c40d73 100644 (file)
@@ -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)
index 1e976c8e635fb5e6af2ff3cfc5691b64f57366b0..bb206da05fa34622578cf7394faeba6acec37046 100644 (file)
@@ -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:
index b37f41cb2ea5d1412d0cb1884809eec594fea16f..b5e798173b7eb0b4dd2bcf69189f84eaa505da4f 100644 (file)
@@ -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;
index 0edbfa6b8a622658aa4de98cd775e57ab99fdd97..e33a4da9fa2a6b708f10301f523b312710b11ee8 100644 (file)
@@ -1569,8 +1569,6 @@ static int pci_e1000_init(PCIDevice *pci_dev)
 
     qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
 
-    add_boot_device_path(d->conf.bootindex, dev, "/ethernet-phy@0");
-
     d->autoneg_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, e1000_autoneg_timer, d);
     d->mit_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, e1000_mit_timer, d);
 
index fb9c944db7883af900a3309023657bf0d6a95be6..4877bfd4d37f21c765fc60aa6da5f937a691da2d 100644 (file)
@@ -1901,8 +1901,6 @@ static int e100_nic_init(PCIDevice *pci_dev)
     s->vmstate->name = qemu_get_queue(s->nic)->model;
     vmstate_register(&pci_dev->qdev, -1, s->vmstate, s);
 
-    add_boot_device_path(s->conf.bootindex, &pci_dev->qdev, "/ethernet-phy@0");
-
     return 0;
 }
 
index 62b86afb381dd66acd617666a939234582a1f2d6..3ab2d036961cdd5e150e2c0888c371e1d53a961a 100644 (file)
@@ -738,8 +738,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
                           object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
     qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
 
-    add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0");
-
     return 0;
 }
 
index 5299d52a8f6a56e06633c5252885203dcdcdf55e..d344c15da0f860e6462a852e9c6e75a443226c48 100644 (file)
@@ -1735,8 +1735,6 @@ int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
     s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s);
     qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
 
-    add_boot_device_path(s->conf.bootindex, dev, "/ethernet-phy@0");
-
     /* Initialize the PROM */
 
     /*
index 138a03af471124186e12b1b9486f1f08d325e9c3..8b8a1b18af491d3b1ad21cc0a1d7deafe4f62438 100644 (file)
@@ -3538,8 +3538,6 @@ static int pci_rtl8139_init(PCIDevice *dev)
     s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, rtl8139_timer, s);
     rtl8139_set_next_tctr_time(s, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
 
-    add_boot_device_path(s->conf.bootindex, d, "/ethernet-phy@0");
-
     return 0;
 }
 
index 0ff159bfc0f694b813578f8101eec06968a63c8b..2c8b0382274c86e2851c4622fc4fb54a0e03039f 100644 (file)
@@ -221,8 +221,6 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev)
                             object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev);
     qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
 
-    add_boot_device_path(dev->nicconf.bootindex, DEVICE(dev), "");
-
     return 0;
 }
 
index f5ead976bf308bbce33b30e54883c0461c1708fe..9b88775fac31f11bb2ac4cf2c6e97bc3558967b5 100644 (file)
@@ -1661,8 +1661,6 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
     n->qdev = dev;
     register_savevm(dev, "virtio-net", -1, VIRTIO_NET_VM_VERSION,
                     virtio_net_save, virtio_net_load, n);
-
-    add_boot_device_path(n->nic_conf.bootindex, dev, "/ethernet-phy@0");
 }
 
 static void virtio_net_device_unrealize(DeviceState *dev, Error **errp)
index 88e9d9c1f05418ec35f84d1b1f154d2cbba155ee..8eea58989b5a55416567df388502a75465719a00 100644 (file)
@@ -2172,8 +2172,6 @@ static int vmxnet3_pci_init(PCIDevice *pci_dev)
     register_savevm(dev, "vmxnet3-msix", -1, 1,
                     vmxnet3_msix_save, vmxnet3_msix_load, s);
 
-    add_boot_device_path(s->conf.bootindex, dev, "/ethernet-phy@0");
-
     return 0;
 }
 
index 9cd3445fe93ce28badb77ffa32fa2870c5f05a3f..ae9e08dd13912448a81a55c336e06be26c9b07a0 100644 (file)
@@ -2269,7 +2269,6 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
     bdrv_set_guest_block_size(s->qdev.conf.bs, s->qdev.blocksize);
 
     bdrv_iostatus_enable(s->qdev.conf.bs);
-    add_boot_device_path(s->qdev.conf.bootindex, &dev->qdev, NULL);
 }
 
 static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
index 03b980c44d69089ace4f8f69f7279d2a5112379c..84a1d5bfe30ebbb58ea54ff5d68d5f32e3f10e3c 100644 (file)
@@ -413,9 +413,6 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
     /* define device state */
     s->type = scsiid.scsi_type;
     DPRINTF("device type %d\n", s->type);
-    if (s->type == TYPE_DISK || s->type == TYPE_ROM) {
-        add_boot_device_path(s->conf.bootindex, &s->qdev, NULL);
-    }
 
     switch (s->type) {
     case TYPE_TAPE:
index f341b3317b402eaf82bef4841c4a87772dd1dd18..5b95d5c382a1be0c0bb22d7ae65175aa6c9a3a2d 100644 (file)
@@ -1371,8 +1371,6 @@ static void usb_net_realize(USBDevice *dev, Error **errrp)
              s->conf.macaddr.a[4],
              s->conf.macaddr.a[5]);
     usb_desc_set_string(dev, STRING_ETHADDR, s->usbstring_mac);
-
-    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/ethernet@0");
 }
 
 static void usb_net_instance_init(Object *obj)
index 906e4298e909545915803791c203addef9bdc5d9..d2d161bc6e2acb9dadcfe8f3495f57dda402341e 100644 (file)
@@ -978,7 +978,6 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     qemu_add_exit_notifier(&s->exit);
 
     QTAILQ_INSERT_TAIL(&hostdevs, s, next);
-    add_boot_device_path(s->bootindex, &udev->qdev, NULL);
     usb_host_auto_check(NULL);
 }
 
index 95f1aa249471b7d968dc1b73ea98ce70620f4622..9fbd59e5ee038172abf61067e4b6504a6d9a6cdb 100644 (file)
@@ -1401,7 +1401,6 @@ static void usbredir_realize(USBDevice *udev, Error **errp)
                           usbredir_chardev_read, usbredir_chardev_event, dev);
 
     qemu_add_vm_change_state_handler(usbredir_vm_state_change, dev);
-    add_boot_device_path(dev->bootindex, &udev->qdev, NULL);
 }
 
 static void usbredir_cleanup_device_queues(USBRedirDevice *dev)