2008-04-29 Dan Williams <dcbw@redhat.com>

Handle HAL dropouts better; allow NM to start up even if HAL isn't up yet.

	* marshallers/nm-marshal.list
		- Add marshaller

	* src/NetworkManager.c
		- (main): let the NMManager handle the NMHalManager

	* src/nm-hal-manager.c
	  src/nm-hal-manager.h
		- convert to a GObject, and emit singals when stuff changes.  Let the
			NMManager handle the signals, instead of the NMHalManager calling
			into the NMManager.  

	* src/nm-manager.c
	  src/nm-manager.h
		- (remove_one_device): consolidate device removals here
		- (dispose): use remove_one_device()
		- (nm_manager_get_device_by_udi): make static
		- (deferred_hal_manager_query_devices): idle handler to query the HAL
			manager for devices at startup or wakeup time
		- (nm_manager_new): create and monitor the HAL manager
		- (hal_manager_udi_added_cb): new function; do what
			nm_manager_add_device() used to do when signalled by the hal manager
		- (hal_manager_udi_removed_cb): new function; do what
			nm_manager_remove_device() used to do when signalled by the hal
			manager
		- (hal_manager_rfkill_changed_cb): handle rfkill changes from the
			hal manager
		- (hal_manager_hal_reappeared_cb): when HAL comes back, remove devices
			in our device list that aren't known to HAL
		- (impl_manager_sleep): on wakeup, re-add devices from an idle handler;
			see comments on nm-hal-manager.c::nm_manager_state_changed() a few
			commits ago
		- (nm_manager_get_device_by_path, nm_manager_is_udi_managed,
		   nm_manager_activation_pending, nm_manager_wireless_enabled,
		   nm_manager_wireless_hardware_enabled,
		   nm_manager_set_wireless_hardware_enabled): remove, unused



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3619 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-04-29 23:03:00 +00:00
parent 9be3804c7f
commit 079f2bd560
7 changed files with 595 additions and 432 deletions

View File

@@ -43,7 +43,6 @@
#include "NetworkManagerUtils.h"
#include "nm-device-interface.h"
#include "nm-manager.h"
#include "nm-hal-manager.h"
#include "nm-device.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-device-802-11-wireless.h"
@@ -205,13 +204,6 @@ write_pidfile (const char *pidfile)
nm_warning ("Closing %s failed: %s", pidfile, strerror (errno));
}
static gboolean
start_hal (gpointer user_data)
{
nm_hal_manager_start ((NMHalManager *) user_data);
return FALSE;
}
/*
* main
*
@@ -225,7 +217,6 @@ main (int argc, char *argv[])
char * user_pidfile = NULL;
gboolean success;
NMPolicy *policy = NULL;
NMHalManager *hal_manager = NULL;
NMVPNManager *vpn_manager = NULL;
NMNamedManager *named_mgr = NULL;
NMDBusManager * dbus_mgr = NULL;
@@ -347,11 +338,6 @@ main (int argc, char *argv[])
goto done;
}
hal_manager = nm_hal_manager_new (manager);
if (!hal_manager)
goto done;
g_idle_add (start_hal, hal_manager);
/* Bring up the loopback interface. */
nm_system_enable_loopback ();
@@ -362,9 +348,6 @@ main (int argc, char *argv[])
g_main_loop_run (main_loop);
done:
if (hal_manager)
nm_hal_manager_destroy (hal_manager);
if (policy)
nm_policy_destroy (policy);