[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 27/28] bootindex: move calling add_boot_device_pa
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v7 27/28] bootindex: move calling add_boot_device_patch to bootindex setter function |
Date: |
Fri, 5 Sep 2014 16:37:35 +0800 |
From: Gonglei <address@hidden>
On this way, we can assure the new bootindex take effect
during vm rebooting.
Signed-off-by: Gonglei <address@hidden>
---
bootdevice.c | 2 ++
hw/block/fdc.c | 3 ---
hw/block/virtio-blk.c | 2 --
hw/i386/kvm/pci-assign.c | 2 --
hw/ide/qdev.c | 3 ---
hw/misc/vfio.c | 1 -
hw/net/e1000.c | 2 --
hw/net/eepro100.c | 2 --
hw/net/ne2000.c | 2 --
hw/net/pcnet.c | 2 --
hw/net/rtl8139.c | 2 --
hw/net/spapr_llan.c | 2 --
hw/net/virtio-net.c | 2 --
hw/net/vmxnet3.c | 2 --
hw/scsi/scsi-disk.c | 1 -
hw/scsi/scsi-generic.c | 3 ---
hw/usb/dev-network.c | 1 -
hw/usb/host-libusb.c | 1 -
hw/usb/redirect.c | 1 -
19 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/bootdevice.c b/bootdevice.c
index c669293..e95d085 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -241,6 +241,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);
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 51b1f08..970b7c3 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2142,9 +2142,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error
**errp)
error_propagate(errp, err);
return;
}
-
- add_boot_device_path(isa->bootindexA, dev, "/address@hidden");
- add_boot_device_path(isa->bootindexB, dev, "/address@hidden");
}
static void sysbus_fdc_initfn(Object *obj)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 4d05114..787955b 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -777,8 +777,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, "/address@hidden,0");
}
static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 56f387b..4159978 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -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:
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 8382f24..daf6992 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -185,9 +185,6 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
dev->serial = g_strdup(s->drive_serial_str);
}
- add_boot_device_path(dev->conf.bootindex, &dev->qdev,
- dev->unit ? "/address@hidden" : "/address@hidden");
-
return 0;
}
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index cdbaedf..d073304 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -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;
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 2e5dc41..34dde84 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -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, "/address@hidden");
-
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);
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index cc79f09..9acc8a3 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -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, "/address@hidden");
-
return 0;
}
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 6d31555..b6d8cb1 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -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, "/address@hidden");
-
return 0;
}
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index 5299d52..d344c15 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -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, "/address@hidden");
-
/* Initialize the PROM */
/*
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index d921ebd..5300fb8 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -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, "/address@hidden");
-
return 0;
}
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index c8b0978..052d00d 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -214,8 +214,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;
}
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 3e6d3fa..d529f1f 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1663,8 +1663,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, "/address@hidden");
}
static void virtio_net_device_unrealize(DeviceState *dev, Error **errp)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 56b22f3..a4e7e12 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -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, "/address@hidden");
-
return 0;
}
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index c37a8be..43e0220 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2285,7 +2285,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)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index a542d1a..fcd503c 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -431,9 +431,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:
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index f110ea7..5870478 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1372,7 +1372,6 @@ static int usb_net_initfn(USBDevice *dev)
s->conf.macaddr.a[5]);
usb_desc_set_string(dev, STRING_ETHADDR, s->usbstring_mac);
- add_boot_device_path(s->conf.bootindex, &dev->qdev, "/address@hidden");
return 0;
}
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index a2fa70e..50e3b21 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -975,7 +975,6 @@ static int usb_host_initfn(USBDevice *udev)
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);
return 0;
}
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 352ba80..de93a59 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1397,7 +1397,6 @@ static int usbredir_initfn(USBDevice *udev)
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);
return 0;
}
--
1.7.12.4
- [Qemu-devel] [PATCH v7 02/28] bootindex: add check bootindex function, (continued)
- [Qemu-devel] [PATCH v7 06/28] bootindex: support to set a existent device's bootindex to -1, arei.gonglei, 2014/09/05
- [Qemu-devel] [PATCH v7 01/28] bootdevice: move bootdevice related code to new file bootdevice.c, arei.gonglei, 2014/09/05
- [Qemu-devel] [PATCH v7 10/28] eepro100: add bootindex to qom property, arei.gonglei, 2014/09/05
- [Qemu-devel] [PATCH v7 12/28] pcnet: add bootindex to qom property, arei.gonglei, 2014/09/05
- [Qemu-devel] [PATCH v7 27/28] bootindex: move calling add_boot_device_patch to bootindex setter function,
arei.gonglei <=
- [Qemu-devel] [PATCH v7 05/28] bootindex: rework add_boot_device_path function, arei.gonglei, 2014/09/05