diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2010-08-13 16:32:06 -0400 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2010-08-25 15:40:39 +0100 |
commit | cb5bf8ba89e6b8f3362b44f3ba6dce2227268e20 (patch) | |
tree | a676ddbe538d53aac3d6adcd5cf8f131281547f5 /osinfo/osinfo_os.c | |
parent | de5cf59cbd05fa9230aa1db050cb447a9f470d97 (diff) | |
download | libosinfo-cb5bf8ba89e6b8f3362b44f3ba6dce2227268e20.tar.gz |
Turn filter matching functions into formal APIs
Instead of having the osinfo_common.c module poking into
the private parts of OsinfoFilter and OsinfoEntity
objects, move the code into OsinfoEntity and use formal
APIs for all data access
* osinfo/osinfo_filter.c, osinfo/osinfo_filter.h,
osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Add
API for matching entities against filters
* osinfo/osinfo_common.c, osinfo/osinfo_common.h: Remove
all entity filtering code.
* osinfo/osinfo_device.c, osinfo/osinfo_hypervisor.c,
osinfo/osinfo_list.c, osinfo/osinfo_os.c: Update to
use formal entity filtering APIs
Diffstat (limited to 'osinfo/osinfo_os.c')
-rw-r--r-- | osinfo/osinfo_os.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c index 53be431..cedeaac 100644 --- a/osinfo/osinfo_os.c +++ b/osinfo/osinfo_os.c @@ -257,8 +257,8 @@ OsinfoDevice *osinfo_os_get_preferred_device(OsinfoOs *self, OsinfoHypervisor *h struct __osinfoDeviceLink *deviceLink; for (i = 0; i < sectionList->len; i++) { deviceLink = g_ptr_array_index(sectionList, i); - if (__osinfoDevicePassesFilter(filter, deviceLink->dev)) - return deviceLink->dev; + if (osinfo_entity_matches_filter(OSINFO_ENTITY(deviceLink->dev), filter)) + return deviceLink->dev; } // If no devices pass filter, return NULL. @@ -319,7 +319,7 @@ OsinfoDeviceList *osinfo_os_get_devices(OsinfoOs *self, OsinfoHypervisor *hv, gc struct __osinfoDeviceLink *deviceLink; for (i = 0; i < sectionList->len; i++) { deviceLink = g_ptr_array_index(sectionList, i); - if (__osinfoDevicePassesFilter(filter, deviceLink->dev)) + if (osinfo_entity_matches_filter(OSINFO_ENTITY(deviceLink->dev), filter)) osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev)); } |