Best regards,
-Gonglei


> -----Original Message-----
> From: Eduardo Habkost [mailto:ehabk...@redhat.com]
> Sent: Friday, August 01, 2014 10:46 PM
> To: Gonglei (Arei)
> Cc: qemu-devel@nongnu.org; chenliang (T); Huangweidong (C);
> m...@redhat.com; a...@ozlabs.ru; hu...@cn.fujitsu.com;
> arm...@redhat.com; kra...@redhat.com; ak...@redhat.com;
> ag...@suse.de; aligu...@amazon.com; gaowanl...@cn.fujitsu.com;
> Luonengjun; Huangpeng (Peter); h...@linux.com; stefa...@redhat.com;
> pbonz...@redhat.com; lcapitul...@redhat.com; kw...@redhat.com;
> peter.crosthwa...@xilinx.com; imamm...@redhat.com; afaer...@suse.de
> Subject: Re: [Qemu-devel] [PATCH v4 4/8] bootindex: delete bootindex when
> device is removed
> 
> On Thu, Jul 31, 2014 at 05:47:29PM +0800, arei.gong...@huawei.com wrote:
> > From: Gonglei <arei.gong...@huawei.com>
> >
> > Device should be removed from global boot list when
> > it is hot-unplugged.
> >
> > Signed-off-by: Chenliang <chenlian...@huawei.com>
> > Signed-off-by: Gonglei <arei.gong...@huawei.com>
> > ---
> >  hw/block/virtio-blk.c    | 1 +
> >  hw/i386/kvm/pci-assign.c | 1 +
> >  hw/misc/vfio.c           | 1 +
> >  hw/net/e1000.c           | 1 +
> >  hw/net/eepro100.c        | 1 +
> >  hw/net/ne2000.c          | 1 +
> >  hw/net/rtl8139.c         | 1 +
> >  hw/net/virtio-net.c      | 1 +
> >  hw/net/vmxnet3.c         | 1 +
> >  hw/scsi/scsi-generic.c   | 1 +
> >  hw/usb/dev-network.c     | 1 +
> >  hw/usb/host-libusb.c     | 1 +
> >  hw/usb/redirect.c        | 1 +
> >  13 files changed, 13 insertions(+)
> 
> Grepping for add_boot_device_path, I don't see corresponding
> del_boot_device_path() calls in this patch for the following:
> 
>   hw/ide/qdev.c:    add_boot_device_path(dev->conf.bootindex,
> &dev->qdev,
>   hw/block/fdc.c:    add_boot_device_path(isa->bootindexA, dev,
> "/floppy@0");
>   hw/block/fdc.c:    add_boot_device_path(isa->bootindexB, dev,
> "/floppy@1");
>   hw/net/pcnet.c:    add_boot_device_path(s->conf.bootindex, dev,
> "/ethernet-phy@0");
>   hw/net/spapr_llan.c:    add_boot_device_path(dev->nicconf.bootindex,
> DEVICE(dev), "");
>   hw/scsi/scsi-disk.c:    add_boot_device_path(s->qdev.conf.bootindex,
> &dev->qdev, NULL);
> 
> Why we don't need del_boot_device_path() calls for those?
> 
I think those device don't support hot-plug/hot-unplug. So, needn't call 
del_boot_device_path(). But maybe I make a mistake for pcnet and scsi-disk.

I will adopt Gerd's suggestion in v5: 
call this from device_finalize() instead of placing it into each
individual device.

Thanks.

> These seem to be OK, and are handled by this patch:
> 
>   hw/i386/kvm/pci-assign.c:    add_boot_device_path(dev->bootindex,
> &pci_dev->qdev, NULL);
>   hw/block/virtio-blk.c:    add_boot_device_path(s->conf->bootindex, dev,
> "/disk@0,0");
>   hw/misc/vfio.c:    add_boot_device_path(vdev->bootindex, &pdev->qdev,
> NULL);
>   hw/net/rtl8139.c:    add_boot_device_path(s->conf.bootindex, d,
> "/ethernet-phy@0");
>   hw/net/e1000.c:    add_boot_device_path(d->conf.bootindex, dev,
> "/ethernet-phy@0");
>   hw/net/eepro100.c:    add_boot_device_path(s->conf.bootindex,
> &pci_dev->qdev, "/ethernet-phy@0");
>   hw/net/ne2000.c:    add_boot_device_path(s->c.bootindex,
> &pci_dev->qdev, "/ethernet-phy@0");
>   hw/net/virtio-net.c:    add_boot_device_path(n->nic_conf.bootindex, dev,
> "/ethernet-phy@0");
>   hw/net/vmxnet3.c:    add_boot_device_path(s->conf.bootindex, dev,
> "/ethernet-phy@0");
>   hw/scsi/scsi-generic.c:        add_boot_device_path(s->conf.bootindex,
> &s->qdev, NULL);
>   hw/usb/dev-network.c:    add_boot_device_path(s->conf.bootindex,
> &dev->qdev, "/ethernet@0");
>   hw/usb/host-libusb.c:    add_boot_device_path(s->bootindex,
> &udev->qdev, NULL);
>   hw/usb/redirect.c:    add_boot_device_path(dev->bootindex,
> &udev->qdev, NULL);
> 
> This one has dev==NULL, so it looks OK:
> 
>   hw/core/loader.c:    add_boot_device_path(bootindex, NULL, devpath);
> 
> This is modify_boot_device_path(), so it's OK:
> 
>   vl.c:    add_boot_device_path(bootindex, dev, old_entry->suffix);
> 
> --
> Eduardo

Reply via email to