done
}
+function hotplug_propagate_all_zones() {
+ hotplug_assert_in_hotplug_event
+
+ local zone
+ for zone in $(zones_get_all); do
+ zone_hotplug_event "${zone}"
+ local ret="${?}"
+
+ # Log warning for crashed hooks
+ case "${ret}" in
+ ${EXIT_OK}|${EXIT_NOT_HANDLED})
+ : # do nothing
+ ;;
+ *)
+ log WARNING "Unknown exit code for zone '${zone}': ${ret}"
+ ;;
+ esac
+ done
+}
+
function hotplug_event_port_is_interface() {
hotplug_assert_in_hotplug_event
[ "${port}" = "${INTERFACE}" ]
}
-function hotplug_event_port_is_slave() {
+function hotplug_event_interface_is_slave_of_port() {
hotplug_assert_in_hotplug_event
local port="${1}"
isset INTERFACE || return ${EXIT_FALSE}
local slaves="$(port_get_slaves "${port}")"
- list_match "${INTERFACE}" ${SLAVES}
+ list_match "${INTERFACE}" ${slaves}
+}
+
+function hotplug_event_interface_is_port_of_zone() {
+ hotplug_assert_in_hotplug_event
+
+ local zone="${1}"
+ assert isset zone
+
+ # Return false if INTERFACE is not set
+ isset INTERFACE || return ${EXIT_FALSE}
+
+ local ports="$(zone_get_ports "${zone}")"
+ list_match "${INTERFACE}" ${ports}
}
function hotplug_event_port_uses_phy() {