search for: libhalcontext

Displaying 8 results from an estimated 8 matches for "libhalcontext".

2010 Mar 15
0
[PATCH] Updated the list of ignored files and fixed whitespace issues.
...s\n", dbus_error.name, dbus_error.message); - } + } } else { fprintf(stderr, "Unable to connect to system bus: %s : %s\n", dbus_error.name, dbus_error.message); @@ -75,9 +72,9 @@ char* get_uuid(LibHalContext *hal_ctx) int type = libhal_device_get_property_type(hal_ctx, udi, key, &dbus_error); if (type == LIBHAL_PROPERTY_TYPE_STRING) { - value = libhal_device_get_property_string(hal_ctx, - udi, -...
2010 Apr 26
2
Patch supercedes previous patch...
In looking at the code I realized that the last of the HAL depenencies were removed with this patch. So, I'm pushing an updated patch that contains none of the HAL code in it.
2010 Apr 26
0
[PATCH matahari] Created the NetworkDevice agent.
...mgmt_object->set_macaddr(macaddr); - mgmt_object->set_ipaddr(ipaddr); - mgmt_object->set_netmask(netmask); - mgmt_object->set_broadcast(broadcast); - mgmt_object->set_bandwidth(bandwidth); -} - -NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, - LibHalContext *hal_ctx, - char *nic_handle) -{ - // Used to get the data - char *macaddr_c; - char *interface_c; - int sock, ret; - struct ifreq ifr; - struct ethtool_cmd ecmd; - - // The data that we care about - NICWrapper *nic = NULL; - string macaddr; - string...
2010 Apr 19
1
[PATCH matahari] Replaces the existing HAL code for ProcessorAgent with udev.
...usError dbus_error; - void ProcessorsAgent::setup(ManagementAgent* agent, Manageable* parent) { @@ -43,17 +37,79 @@ ProcessorsAgent::setup(ManagementAgent* agent, Manageable* parent) management_object = new _qmf::Processors(agent, this, parent); agent->addObject(management_object); - LibHalContext* context = get_hal_ctx(); + int core_count = 0; + string model = "unknown"; + + struct udev* udev = udev_new(); + struct udev_enumerate* enumerator = udev_enumerate_new(udev); + + udev_enumerate_add_match_property(enumerator, "DRIVER", "processor"); + if(!udev_en...
2010 Apr 15
1
[PATCH matahari] Refactored the Host agent.
...terator iter = nics.begin(); - iter!= nics.end(); - iter++) { - output << **iter << endl; + management_object = new _qmf::Host(agent, this); + agent->addObject(management_object); + + // discover the aspects of the host + processors.setup(agent, this); + + LibHalContext *hal_ctx; + int ret; + + // Get our HAL Context or die trying + hal_ctx = get_hal_ctx(); + if (!hal_ctx) + throw runtime_error("Unable to get HAL Context Structure."); + + try { + NICWrapper::fillNICInfo(this->nics, agent, hal_ctx); + + // Host UUID + char *uuid_c = ge...
2010 Mar 16
0
[PATCH] Added the new Processors agent.
...+using namespace std; +namespace _qmf = qmf::com::redhat::matahari; + +extern DBusError dbus_error; + +void +ProcessorsAgent::setup(ManagementAgent* agent) +{ + // setup the management object + management_object = new _qmf::Processors(agent, this); + agent->addObject(management_object); + + LibHalContext* context = get_hal_ctx(); + + int num_results; + char** processors = libhal_find_device_by_capability(context,"processor", &num_results, &dbus_error); + + if (!processors) + throw runtime_error("Error: could not query processors via HAL."); + + // populate the man...
2010 Mar 22
1
Small change and resend...
This patch includes one small change: the Processors::get_load_average() method is now const since it does not change the object's state.
2010 Mar 22
1
Resend with loadavg as a statistic...
After some feedback from Slow, mainly about the load_average API being a method rather than an ongoing statistic. So I've converted the code over to instead update the load average statistic on a regular basis.