This patch series aim to have OSes properly dealing with removed devices. The path I've taken is: - Use OsinfoDeviceLink to store whether the device is removed; - Filter out the removed devices from _get_devices(), _get_device_links(), _get_all_devices() and _get_all_device_links() - A bunch of tests to ensure I'm not breaking anything, neither that something will end up broken in the future; Now, questions ... - Shall we do the same for platform and deployment? - I've introduced and exposed osinfo_os_get_all_device_links(), and the rationale for exposing it is basically for coherence with the osinfo_os_get_all_devices() .... However, it could to Changes since v1: https://www.redhat.com/archives/libosinfo/2018-November/msg00038.html - Dropped the patches dealing with "deprecated" devices; * osinfo-db: Fabiano Fidêncio (1): schema: Add "removed" attribute to devices element data/schema/osinfo.rng.in | 5 +++++ 1 file changed, 5 insertions(+) * libosinfo: Fabiano Fidêncio (14): devicelinklist: Fix _get_devices() tests: Add basic tests for devicelinklist test-devicelinklist: Add _get_devices() test tests-os: Add test_devices_inheritance_basic() loader: Deal with "removed" devices for an OS os: Add osinfo_os_get_all_device_links() os: Add osinfo_os_get_devices_internal() os: Add osinfo_os_get_device_links_internal() os: Add osinfo_os_get_all_device_links_internal() os: Use get_devices_internal in _get_all callback os: Use get_device_links_internal in _get_all callback os: Add add_entity_to_list_check() os: Deal with "removed" devices test-os: Add test_devices_inheritance_removal() osinfo/libosinfo.syms | 2 + osinfo/osinfo_devicelink.h | 1 + osinfo/osinfo_devicelinklist.c | 6 +- osinfo/osinfo_loader.c | 9 + osinfo/osinfo_os.c | 222 +++++++++++-- osinfo/osinfo_os.h | 1 + tests/Makefile.am | 5 + .../device/libosinfo.org/test-device-one.xml | 7 + .../libosinfo.org/test-os-devices-basic-1.xml | 13 + .../test-os-devices-basic-2-clone.xml | 10 + .../libosinfo.org/test-os-devices-basic-2.xml | 10 + .../test-os-devices-removed-1.xml | 14 + .../test-os-devices-removed-2-clone.xml | 10 + .../test-os-devices-removed-2.xml | 10 + .../test-os-devices-removed-3.xml | 14 + .../test-os-devices-removed-4-clone.xml | 10 + .../test-os-devices-removed-4.xml | 10 + tests/test-devicelinklist.c | 313 ++++++++++++++++++ tests/test-os.c | 169 ++++++++++ 19 files changed, 809 insertions(+), 27 deletions(-) create mode 100644 tests/dbdata/device/libosinfo.org/test-device-one.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-basic-1.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-basic-2-clone.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-basic-2.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-1.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-2-clone.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-2.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-3.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-4-clone.xml create mode 100644 tests/dbdata/os/libosinfo.org/test-os-devices-removed-4.xml create mode 100644 tests/test-devicelinklist.c -- 2.19.1 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo