+ elif media_state is not None:
+ if media_state == '1':
+ harddiskmanager.removeHotplugPartition(dev)
+ harddiskmanager.addHotplugPartition(dev, physdevpath)
+ elif media_state == '0':
+ harddiskmanager.removeHotplugPartition(dev)
+
+ for callback in hotplugNotifier:
+ try:
+ callback(dev, action or media_state)
+ except AttributeError:
+ hotplugNotifier.remove(callback)