manager: use _LOGx() macros in nm-manager
They give each logging message a "manager: " prefix.
This commit is contained in:
@@ -68,8 +68,6 @@ static NMActiveConnection *_new_active_connection (NMManager *self,
|
|||||||
|
|
||||||
static void policy_activating_device_changed (GObject *object, GParamSpec *pspec, gpointer user_data);
|
static void policy_activating_device_changed (GObject *object, GParamSpec *pspec, gpointer user_data);
|
||||||
|
|
||||||
static void rfkill_change (const char *desc, RfKillType rtype, gboolean enabled);
|
|
||||||
|
|
||||||
static gboolean find_master (NMManager *self,
|
static gboolean find_master (NMManager *self,
|
||||||
NMConnection *connection,
|
NMConnection *connection,
|
||||||
NMDevice *device,
|
NMDevice *device,
|
||||||
@@ -2734,12 +2732,12 @@ active_connection_parent_active (NMActiveConnection *active,
|
|||||||
/* We can now proceed to disconnected state so that activation proceeds. */
|
/* We can now proceed to disconnected state so that activation proceeds. */
|
||||||
unmanaged_to_disconnected (device);
|
unmanaged_to_disconnected (device);
|
||||||
} else {
|
} else {
|
||||||
nm_log_warn (LOGD_CORE, "Could not realize device '%s': %s",
|
_LOGW (LOGD_CORE, "Could not realize device '%s': %s",
|
||||||
nm_device_get_iface (device), error->message);
|
nm_device_get_iface (device), error->message);
|
||||||
nm_active_connection_set_state (active, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
|
nm_active_connection_set_state (active, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nm_log_warn (LOGD_CORE, "The parent connection device '%s' depended on disappeared.",
|
_LOGW (LOGD_CORE, "The parent connection device '%s' depended on disappeared.",
|
||||||
nm_device_get_iface (device));
|
nm_device_get_iface (device));
|
||||||
nm_active_connection_set_state (active, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
|
nm_active_connection_set_state (active, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
|
||||||
}
|
}
|
||||||
@@ -3902,7 +3900,11 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed)
|
|||||||
static void
|
static void
|
||||||
_internal_sleep (NMManager *self, gboolean do_sleep)
|
_internal_sleep (NMManager *self, gboolean do_sleep)
|
||||||
{
|
{
|
||||||
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
|
NMManagerPrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (NM_IS_MANAGER (self));
|
||||||
|
|
||||||
|
priv = NM_MANAGER_GET_PRIVATE (self);
|
||||||
|
|
||||||
if (priv->sleeping == do_sleep)
|
if (priv->sleeping == do_sleep)
|
||||||
return;
|
return;
|
||||||
@@ -4017,15 +4019,19 @@ impl_manager_sleep (NMManager *self,
|
|||||||
static void
|
static void
|
||||||
sleeping_cb (NMSleepMonitor *monitor, gpointer user_data)
|
sleeping_cb (NMSleepMonitor *monitor, gpointer user_data)
|
||||||
{
|
{
|
||||||
nm_log_dbg (LOGD_SUSPEND, "Received sleeping signal");
|
NMManager *self = user_data;
|
||||||
_internal_sleep (NM_MANAGER (user_data), TRUE);
|
|
||||||
|
_LOGD (LOGD_SUSPEND, "Received sleeping signal");
|
||||||
|
_internal_sleep (self, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
resuming_cb (NMSleepMonitor *monitor, gpointer user_data)
|
resuming_cb (NMSleepMonitor *monitor, gpointer user_data)
|
||||||
{
|
{
|
||||||
nm_log_dbg (LOGD_SUSPEND, "Received resuming signal");
|
NMManager *self = user_data;
|
||||||
_internal_sleep (NM_MANAGER (user_data), FALSE);
|
|
||||||
|
_LOGD (LOGD_SUSPEND, "Received resuming signal");
|
||||||
|
_internal_sleep (self, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -4135,7 +4141,7 @@ done:
|
|||||||
/* Permissions */
|
/* Permissions */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_perm_add_result (NMAuthChain *chain, GVariantBuilder *results, const char *permission)
|
get_perm_add_result (NMManager *self, NMAuthChain *chain, GVariantBuilder *results, const char *permission)
|
||||||
{
|
{
|
||||||
NMAuthCallResult result;
|
NMAuthCallResult result;
|
||||||
|
|
||||||
@@ -4147,7 +4153,7 @@ get_perm_add_result (NMAuthChain *chain, GVariantBuilder *results, const char *p
|
|||||||
else if (result == NM_AUTH_CALL_RESULT_AUTH)
|
else if (result == NM_AUTH_CALL_RESULT_AUTH)
|
||||||
g_variant_builder_add (results, "{ss}", permission, "auth");
|
g_variant_builder_add (results, "{ss}", permission, "auth");
|
||||||
else {
|
else {
|
||||||
nm_log_dbg (LOGD_CORE, "unknown auth chain result %d", result);
|
_LOGD (LOGD_CORE, "unknown auth chain result %d", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4175,17 +4181,17 @@ get_permissions_done_cb (NMAuthChain *chain,
|
|||||||
} else {
|
} else {
|
||||||
g_variant_builder_init (&results, G_VARIANT_TYPE ("a{ss}"));
|
g_variant_builder_init (&results, G_VARIANT_TYPE ("a{ss}"));
|
||||||
|
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_SLEEP_WAKE);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_SLEEP_WAKE);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_NETWORK_CONTROL);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_NETWORK_CONTROL);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_WIFI_SHARE_OPEN);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_WIFI_SHARE_OPEN);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN);
|
||||||
get_perm_add_result (chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME);
|
get_perm_add_result (self, chain, &results, NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME);
|
||||||
|
|
||||||
g_dbus_method_invocation_return_value (context,
|
g_dbus_method_invocation_return_value (context,
|
||||||
g_variant_new ("(a{ss})", &results));
|
g_variant_new ("(a{ss})", &results));
|
||||||
@@ -4914,7 +4920,7 @@ struct rfkill_event {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rfkill_change (const char *desc, RfKillType rtype, gboolean enabled)
|
rfkill_change (NMManager *self, const char *desc, RfKillType rtype, gboolean enabled)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
struct rfkill_event event;
|
struct rfkill_event event;
|
||||||
@@ -4926,12 +4932,12 @@ rfkill_change (const char *desc, RfKillType rtype, gboolean enabled)
|
|||||||
fd = open ("/dev/rfkill", O_RDWR);
|
fd = open ("/dev/rfkill", O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (errno == EACCES)
|
if (errno == EACCES)
|
||||||
nm_log_warn (LOGD_RFKILL, "(%s): failed to open killswitch device", desc);
|
_LOGW (LOGD_RFKILL, "(%s): failed to open killswitch device", desc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) {
|
if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) {
|
||||||
nm_log_warn (LOGD_RFKILL, "(%s): failed to set killswitch device for "
|
_LOGW (LOGD_RFKILL, "(%s): failed to set killswitch device for "
|
||||||
"non-blocking operation", desc);
|
"non-blocking operation", desc);
|
||||||
close (fd);
|
close (fd);
|
||||||
return;
|
return;
|
||||||
@@ -4953,14 +4959,14 @@ rfkill_change (const char *desc, RfKillType rtype, gboolean enabled)
|
|||||||
|
|
||||||
len = write (fd, &event, sizeof (event));
|
len = write (fd, &event, sizeof (event));
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
nm_log_warn (LOGD_RFKILL, "(%s): failed to change WiFi killswitch state: (%d) %s",
|
_LOGW (LOGD_RFKILL, "(%s): failed to change WiFi killswitch state: (%d) %s",
|
||||||
desc, errno, g_strerror (errno));
|
desc, errno, g_strerror (errno));
|
||||||
} else if (len == sizeof (event)) {
|
} else if (len == sizeof (event)) {
|
||||||
nm_log_info (LOGD_RFKILL, "%s hardware radio set %s",
|
_LOGI (LOGD_RFKILL, "%s hardware radio set %s",
|
||||||
desc, enabled ? "enabled" : "disabled");
|
desc, enabled ? "enabled" : "disabled");
|
||||||
} else {
|
} else {
|
||||||
/* Failed to write full structure */
|
/* Failed to write full structure */
|
||||||
nm_log_warn (LOGD_RFKILL, "(%s): failed to change WiFi killswitch state", desc);
|
_LOGW (LOGD_RFKILL, "(%s): failed to change WiFi killswitch state", desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
close (fd);
|
close (fd);
|
||||||
@@ -5003,7 +5009,7 @@ manager_radio_user_toggled (NMManager *self,
|
|||||||
if (new_enabled != old_enabled) {
|
if (new_enabled != old_enabled) {
|
||||||
/* Try to change the kernel rfkill state */
|
/* Try to change the kernel rfkill state */
|
||||||
if (rstate->rtype == RFKILL_TYPE_WLAN || rstate->rtype == RFKILL_TYPE_WWAN)
|
if (rstate->rtype == RFKILL_TYPE_WLAN || rstate->rtype == RFKILL_TYPE_WWAN)
|
||||||
rfkill_change (rstate->desc, rstate->rtype, new_enabled);
|
rfkill_change (self, rstate->desc, rstate->rtype, new_enabled);
|
||||||
|
|
||||||
manager_update_radio_enabled (self, rstate, new_enabled);
|
manager_update_radio_enabled (self, rstate, new_enabled);
|
||||||
}
|
}
|
||||||
@@ -5149,8 +5155,8 @@ constructed (GObject *object)
|
|||||||
* changes to the WirelessEnabled/WWANEnabled properties which toggle kernel
|
* changes to the WirelessEnabled/WWANEnabled properties which toggle kernel
|
||||||
* rfkill.
|
* rfkill.
|
||||||
*/
|
*/
|
||||||
rfkill_change (priv->radio_states[RFKILL_TYPE_WLAN].desc, RFKILL_TYPE_WLAN, priv->radio_states[RFKILL_TYPE_WLAN].user_enabled);
|
rfkill_change (self, priv->radio_states[RFKILL_TYPE_WLAN].desc, RFKILL_TYPE_WLAN, priv->radio_states[RFKILL_TYPE_WLAN].user_enabled);
|
||||||
rfkill_change (priv->radio_states[RFKILL_TYPE_WWAN].desc, RFKILL_TYPE_WWAN, priv->radio_states[RFKILL_TYPE_WWAN].user_enabled);
|
rfkill_change (self, priv->radio_states[RFKILL_TYPE_WWAN].desc, RFKILL_TYPE_WWAN, priv->radio_states[RFKILL_TYPE_WWAN].user_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user