From c1d3d3f2e905c96ed9b811d46d972f8b097f6cf8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 19 Jun 2013 14:56:26 -0400 Subject: [PATCH] device: queuing two transitions to the same state is not an error Just ignore this, since it happens in the current code and is harmless. While we're here, improve the warning in the case where it does occur to say whiich state we're overwriting. This should help debug any future cases. --- src/devices/nm-device.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 0d741c6234..dab951c7bf 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -5587,7 +5587,12 @@ nm_device_queue_state (NMDevice *self, /* We should only ever have one delayed state transition at a time */ if (priv->queued_state.id) { - g_warn_if_fail (priv->queued_state.id == 0); + if (priv->queued_state.state == state) + return; + nm_log_warn (LOGD_DEVICE, "(%s): overwriting previously queued state change to %s (%s)", + nm_device_get_iface (self), + state_to_string (priv->queued_state.state), + reason_to_string (priv->queued_state.reason)); nm_device_queued_state_clear (self); } @@ -5595,8 +5600,8 @@ nm_device_queue_state (NMDevice *self, priv->queued_state.reason = reason; priv->queued_state.id = g_idle_add (queued_set_state, self); - nm_log_dbg (LOGD_DEVICE, "(%s): queued state change to %s (id %d)", - nm_device_get_iface (self), state_to_string (state), + nm_log_dbg (LOGD_DEVICE, "(%s): queued state change to %s due to %s (id %d)", + nm_device_get_iface (self), state_to_string (state), reason_to_string (reason), priv->queued_state.id); }