[libosinfo PATCH v2 10/15] os: Add osinfo_os_get_all_device_links_internal()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The addition of this new function is basically preparing the ground for
the changes that are coming in the next commits where
osinfo_os_get_all_device_links() will have to deal with "removed"
devices.

https://gitlab.com/libosinfo/osinfo-db/issues/13

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 osinfo/osinfo_os.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index 217e62e..687e3ed 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -393,18 +393,10 @@ static void get_all_device_links_cb(OsinfoProduct *product, gpointer user_data)
     foreach_data->device_links = OSINFO_DEVICELINKLIST(tmp_list);
 }
 
-/**
- * osinfo_os_get_all_device_links:
- * @os: an operating system
- * @filter: (allow-none)(transfer none): an optional device property filter
- *
- * Get all devicelinks matching a given filter but unlike
- * osinfo_os_get_device_links this function also retrieves devices from all
- * derived and cloned operating systems.
- *
- * Returns: (transfer full): A list of OsinfoDeviceLink
- */
-OsinfoDeviceLinkList *osinfo_os_get_all_device_links(OsinfoOs *os, OsinfoFilter *filter)
+static OsinfoDeviceLinkList *
+osinfo_os_get_all_device_links_internal(OsinfoOs *os,
+                                        OsinfoFilter *filter,
+                                        gboolean include_removed)
 {
     struct GetAllDeviceLinksData foreach_data = {
         .filter = filter,
@@ -420,6 +412,22 @@ OsinfoDeviceLinkList *osinfo_os_get_all_device_links(OsinfoOs *os, OsinfoFilter
     return foreach_data.device_links;
 }
 
+/**
+ * osinfo_os_get_all_device_links:
+ * @os: an operating system
+ * @filter: (allow-none)(transfer none): an optional device property filter
+ *
+ * Get all devicelinks matching a given filter but unlike
+ * osinfo_os_get_device_links this function also retrieves devices from all
+ * derived and cloned operating systems.
+ *
+ * Returns: (transfer full): A list of OsinfoDeviceLink
+ */
+OsinfoDeviceLinkList *osinfo_os_get_all_device_links(OsinfoOs *os, OsinfoFilter *filter)
+{
+    return osinfo_os_get_all_device_links_internal(os, filter, FALSE);
+}
+
 /**
  * osinfo_os_add_device:
  * @os: an operating system
-- 
2.19.1

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux