2007-12-27 Dan Williams <dcbw@redhat.com>

* src/nm-device-interface.c
	  src/nm-device-interface.h
		- (nm_device_interface_error_quark, nm_device_interface_error_get_type):
			normalize and expand errors
		- (nm_device_interface_init): register errors so they can be marshalled
			through dbus-glib
		- (nm_device_interface_activate): ensure that failure of activation
			returns an error

	* src/nm-device.c
	  src/nm-device.h
		- (device_activation_precheck): implementations of check_connection()
			now take a GError and must fill it in if the check fails.  Return
			more descriptive error if the requested connection is already
			activating
		- (nm_device_activate): actually try to return descriptive errors on
			failures

	* src/nm-device-802-11-wireless.c
	  src/nm-device-802-3-ethernet.c
	  src/nm-serial-device.c
	  src/nm-gsm-device.c
		- (real_check_connection): return more descriptive errors on failure

	* src/NetworkManagerPolicy.c
		- (nm_policy_device_change_check): print activation errors in the logs

	* src/nm-manager.c
		- (nm_manager_error_quark, nm_manager_error_get_type,
		   nm_manager_class_init): new errors
		- (nm_manager_activate_device): handle errors
		- (nm_manager_error_new): removed
		- (wait_for_connection_expired, connection_added_default_handler,
		   impl_manager_activate_device): better error handling



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3197 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2007-12-27 08:06:27 +00:00
parent dd8c546ff0
commit 7f88f52573
12 changed files with 230 additions and 76 deletions

View File

@@ -11,10 +11,10 @@ static gboolean impl_device_deactivate (NMDeviceInterface *device, GError **err)
GQuark
nm_device_interface_error_quark (void)
{
static GQuark quark = 0;
if (!quark)
quark = g_quark_from_static_string ("nm_device_interface_error");
return quark;
static GQuark quark = 0;
if (!quark)
quark = g_quark_from_static_string ("nm-device-interface-error");
return quark;
}
/* This should really be standard. */
@@ -27,7 +27,10 @@ nm_device_interface_error_get_type (void)
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_UNKNOWN_CONNECTION, "UnknownConnection"),
/* Connection is already activating. */
ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING, "ConnectionActivating"),
/* Connection is invalid for this device. */
ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMDeviceInterfaceError", values);
@@ -140,6 +143,10 @@ nm_device_interface_init (gpointer g_iface)
dbus_g_object_type_install_info (iface_type,
&dbus_glib_nm_device_interface_object_info);
dbus_g_error_domain_register (NM_DEVICE_INTERFACE_ERROR,
NULL,
NM_TYPE_DEVICE_INTERFACE_ERROR);
initialized = TRUE;
}
@@ -187,13 +194,20 @@ nm_device_interface_get_iface (NMDeviceInterface *device)
gboolean
nm_device_interface_activate (NMDeviceInterface *device,
NMActRequest *req)
NMActRequest *req,
GError **error)
{
gboolean success;
g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE);
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
nm_info ("Activating device %s", nm_device_interface_get_iface (device));
return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->activate (device, req);
success = NM_DEVICE_INTERFACE_GET_INTERFACE (device)->activate (device, req, error);
if (!success)
g_assert (*error);
return success;
}
void