Il 09/12/2013 14:41, Igor Mammedov ha scritto: >> > Please move the parts under the "if" to hotplug.c (something like >> > hotplug_handler_plug and hotplug_handler_unplug). Also, should this be > sure. > >> > moved up to generic code (e.g. bus_add_child/bus_remove_child)? > Current usage hints that it's more realize() related part. If handler > fails device might want to do same device specific failure handling > before returning from realize() with failure. > It will work in bus_add_child/bus_remove_child as well but it would > basically put handlers to nofail category.
Makes sense. realize() for the "plug" handler, and qdev_unplug for the unplug handler, I guess. Paolo