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. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg