On 05/21/2014 04:13 PM, Andreas Färber wrote:
Am 19.05.2014 17:57, schrieb Michael S. Tsirkin:
On Mon, May 19, 2014 at 05:31:43PM +0200, Andreas Färber wrote:
Hi,

Am 19.05.2014 17:03, schrieb Jun Li:
Add remove_boot_device_path() function to remove bootindex when hot-unplug
a device. This patch fixed virtio-blk/virtio-net/scsi-disk/scsi-generic device.

Signed-off-by: Jun Li <junm...@gmail.com>
---
This patch also fixed bug1086603, ref:
https://bugzilla.redhat.com/show_bug.cgi?id=1086603

This version of patch delete dev and suffix parameter from function 
remove_boot_device_path().
---
  hw/block/virtio-blk.c   |  1 +
  hw/net/virtio-net.c     |  1 +
  hw/scsi/scsi-disk.c     |  1 +
  hw/scsi/scsi-generic.c  |  1 +
On v1 I believe I reminded you of spapr_llan. Your patch is adding a new
remove_*() function, but is using it only for roughly half of the
devices that currently call add_boot_device_path(). Why? I can
understand that ISA devices will not be hot-unpluggable, but all PCI and
USB devices are.
Can we remove the device from boot path automatically
when it's going away?
I'm not familiar with that code myself; assuming that only one path gets
registered per device, I guess we could add a field to DeviceState and
if non-NULL call the unregistration from device_set_unrealize().

Jun, if that works it would save you some work.


Hi Andreas,

Add a field to DeviceState is another method to fix this issue. But when using this method, should delete add_boot_device_path() and add boot path in register per device. I can not estimate the potential issues. Could any guy give your opinion? I will do some researches this weekend. Thx.

Add remove_boot_device_path(), we can call this function where it needs. It's easy to realize. :-)


Best Regards,
Jun Li

Reply via email to