qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Alex Williamson <alex.williamson@redhat.com>,
	Gonglei <arei.gonglei@huawei.com>,
	"open list:sPAPR" <qemu-ppc@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Dmitry Fleytman <dmitry@daynix.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 32/34] bootindex: move calling add_boot_device_patch to bootindex setter function
Date: Wed, 15 Oct 2014 11:06:05 +0200	[thread overview]
Message-ID: <1413363967-2489-33-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1413363967-2489-1-git-send-email-kraxel@redhat.com>

From: Gonglei <arei.gonglei@huawei.com>

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>
---
 bootdevice.c             | 2 ++
 hw/block/fdc.c           | 3 ---
 hw/block/virtio-blk.c    | 2 --
 hw/i386/kvm/pci-assign.c | 2 --
 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     | 2 --
 hw/usb/host-libusb.c     | 1 -
 hw/usb/redirect.c        | 1 -
 18 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/bootdevice.c b/bootdevice.c
index 69cffd8..79c2327 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -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);
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 9f9484c..34c1d8f 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -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)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index fd1ad3a..1fa9770 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -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)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 1e976c8..bb206da 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/misc/vfio.c b/hw/misc/vfio.c
index b37f41c..b5e7981 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 0edbfa6..e33a4da 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, "/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);
 
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index fb9c944..4877bfd 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, "/ethernet-phy@0");
-
     return 0;
 }
 
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 62b86af..3ab2d03 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, "/ethernet-phy@0");
-
     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, "/ethernet-phy@0");
-
     /* Initialize the PROM */
 
     /*
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 138a03a..8b8a1b1 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, "/ethernet-phy@0");
-
     return 0;
 }
 
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index 0ff159b..2c8b038 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -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;
 }
 
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index f5ead97..9b88775 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 88e9d9c..8eea589 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, "/ethernet-phy@0");
-
     return 0;
 }
 
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 9cd3445..ae9e08d 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -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)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 03b980c..84a1d5b 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -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:
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index f341b33..5b95d5c 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -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)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 906e429..d2d161b 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -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);
 }
 
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 95f1aa2..9fbd59e 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -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)
-- 
1.8.3.1

  parent reply	other threads:[~2014-10-15  9:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  9:05 [Qemu-devel] [PULL 00/34] allow changing bootorder via monitor Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 01/34] bootdevice: move bootdevice related code to new file bootdevice.c Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 02/34] bootindex: add check bootindex function Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 03/34] bootindex: add del_boot_device_path function Gerd Hoffmann
2014-10-16 10:04   ` Peter Maydell
2014-10-16 10:11     ` Gonglei
2014-10-15  9:05 ` [Qemu-devel] [PULL 04/34] fw_cfg: add fw_cfg_machine_reset function Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 05/34] bootindex: rework add_boot_device_path function Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 06/34] bootindex: support to set a existent device's bootindex to -1 Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 07/34] bootindex: add a setter/getter functions wrapper for bootindex property Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 08/34] virtio-net: add bootindex to qom property Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 09/34] e1000: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 10/34] eepro100: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 11/34] ne2000: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 12/34] pcnet: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 13/34] rtl8139: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 14/34] spapr_lian: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 15/34] vmxnet3: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 16/34] usb-net: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 17/34] net: remove bootindex property from qdev to qom Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 18/34] virtio-net: alias bootindex property explicitly for virt-net-pci/ccw/s390 Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 19/34] host-libusb: remove bootindex property from qdev to qom Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 20/34] pci-assign: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 21/34] vfio: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 22/34] redirect: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 23/34] isa-fdc: remove bootindexA/B " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 24/34] scsi: add bootindex to qom property Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 25/34] ide: " Gerd Hoffmann
2014-10-15  9:05 ` [Qemu-devel] [PULL 26/34] virtio-blk: " Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 27/34] block: remove bootindex property from qdev to qom Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 28/34] virtio-blk: alias bootindex property explicitly for virt-blk-pci/ccw/s390 Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 29/34] usb-storage: add bootindex to qom property Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 30/34] nvma: ide: " Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 31/34] ide: add calling add_boot_device_patch in bootindex setter function Gerd Hoffmann
2014-10-15  9:06 ` Gerd Hoffmann [this message]
2014-10-15  9:06 ` [Qemu-devel] [PULL 33/34] bootindex: delete bootindex when device is removed Gerd Hoffmann
2014-10-15  9:06 ` [Qemu-devel] [PULL 34/34] bootindex: change fprintf to error_report Gerd Hoffmann
2014-10-16  8:25 ` [Qemu-devel] [PULL 00/34] allow changing bootorder via monitor Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413363967-2489-33-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dmitry@daynix.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).