>From ab22ffd804ba7e91bd6d064cbf5627ab03981c3b 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 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 0d741c6..dab951c 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); } -- 1.7.1