summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update NEWS for 1.10.0 releasev1.10.0Victor Toso2022-02-141-0/+16
| | | | Signed-off-by: Victor Toso <victortoso@redhat.com>
* loader: work around lstat()/EACCES regression in _g_local_file_info_get()Laszlo Ersek2022-02-112-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In glib commit 71e7b5800a31 ("Handle MLS selinux policy better", 2010-07-08), which was made for <https://bugzilla.gnome.org/show_bug.cgi?id=623692>, an lstat() failure with error code EACCES was *masked* in function _g_local_file_info_get(). Consequently, if osinfo_loader_find_files() calls g_file_query_info() on a file that is inaccessible due to (e.g.) a missing "x" (search) permission on a leading directory, then g_file_query_info() succeeds, our "skipMissing" branch is dead, g_file_info_get_attribute_uint32() is reached, and it returns G_FILE_TYPE_UNKNOWN. As a consequence, the outer osinfo_loader_process_default_path() function can fail, even though it passes skipMissing=TRUE to osinfo_loader_process_list(). Example: > $ HOME=/root \ > OSINFO_SYSTEM_DIR=/usr/share/osinfo \ > build/tools/osinfo-query os > Error loading OS data: Can't read path /root/.config/osinfo Arguably, this situation should be handled by simply skipping the inaccessible path, as if all leading directories could be searched, and only the last pathname compontent (the filename entry) didn't exist in its direct parent directory. The glib regression was reported in 2017: https://bugzilla.gnome.org/show_bug.cgi?id=777187 and then migrated to gitlab: https://gitlab.gnome.org/GNOME/glib/-/issues/1237 but it's still not solved today. Work around the issue by honoring "skipMissing" on the G_FILE_TYPE_UNKNOWN branch. Demonstration: > $ HOME=/root \ > OSINFO_SYSTEM_DIR=/usr/share/osinfo \ > build/tools/osinfo-query os > > ** (osinfo-query:9924): WARNING **: 13:23:12.776: Can't read path /root/.config/osinfo > Short ID | Name | Version | ID > ----------------+------------------+---------+---------------------------------------- > alpinelinux3.5 | Alpine Linux 3.5 | 3.5 | http://alpinelinux.org/alpinelinux/3.5 > ... Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2051559 Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* tools: add an --all flag to osinfo-detect to report all matchesDaniel P. Berrangé2022-02-041-14/+57
| | | | | | | | By default it still only displays the first operating system with matching media/tree, but if --all is given, all possible matches will be displayed Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: add API for resolving multiple tree matchesDaniel P. Berrangé2022-02-044-0/+130
| | | | | | | | A provided tree object might match multiple entries from the database. Add an API that allows for this possibility to let applications decide how to handle it. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: add API for resolving multiple media matchesDaniel P. Berrangé2022-02-048-0/+300
| | | | | | | | A provided media object might match multiple entries from the database. Add an API that allows for this possibility to let applications decide how to handle it. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: allow tree matching code to report multiple entriesDaniel P. Berrangé2022-02-041-11/+59
| | | | | | | | | Refactor the tree matching code so that it can be told to return all matching entries, rather than only the first. The original behaviour can be requested to short-circuit matching if the caller only requires the first match. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: allow media matching code to report multiple entriesDaniel P. Berrangé2022-02-041-12/+61
| | | | | | | | | Refactor the media matching code so that it can be told to return all matching entries, rather than only the first. The original behaviour can be requested to short-circuit matching if the caller only requires the first match. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: honour tree architecture when matchingDaniel P. Berrangé2022-02-044-10/+71
| | | | | | | | | | | The tree matching code currently ignores the tree architecture which is generally ok, since osinfo_tree_create_from_location will leave it set to NULL. None the less, if an architecture is provided for the unknown tree, we should only return results that match this architecture. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: honour media architecture when matchingDaniel P. Berrangé2022-02-043-4/+41
| | | | | | | | | | | The media matching code currently ignores the media architecture which is generally ok, since osinfo_media_create_from_location will leave it set to NULL. None the less, if an architecture is provided for the unknown media, we should only return results that match this architecture. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* guests: use a OsinfoTreeList when detecting tree matchesDaniel P. Berrangé2022-02-041-17/+15
| | | | | | | In preparation for returning multiple tree matches, pass a OsinfoTreeList object around. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: don't set the 'os' property on matched treeDaniel P. Berrangé2022-02-041-1/+0
| | | | | | | We just got the OsinfoTee list from the OsinfoOs object, thus we know that it already has the 'os' property set. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* guests: use a OsinfoMediaList when detecting media matchesDaniel P. Berrangé2022-02-041-13/+20
| | | | | | | In preparation for returning multiple media matches, pass a OsinfoMediaList object around. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: refactor tree guessing internal helperDaniel P. Berrangé2022-02-041-13/+23
| | | | | | | | We want the return value from the tree guessing helper to indicate whether any matches were used, and have the OsinfoOs as an output parameter which can now be optional. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: refactor media guessing internal helperDaniel P. Berrangé2022-02-041-13/+23
| | | | | | | | We want the return value from the media guessing helper to indicate whether any matches were used, and have the OsinfoOs as an output parameter which can now be optional. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: pull tree matching logic into public APIDaniel P. Berrangé2022-02-045-25/+117
| | | | | | | | The logic for matching an unidentified tree against a reference tree is potentially useful to applications and should be part of a public API, rather than hidden. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: pull media matching logic into public APIDaniel P. Berrangé2022-02-045-31/+150
| | | | | | | | The logic for matching an unidentified media against a reference media is potentially useful to applications and should be part of a public API, rather than hidden. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: add missing line break between methodsDaniel P. Berrangé2022-02-041-0/+1
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Translated using Weblate (German)masterEttore Atalan2022-01-181-35/+35
| | | | | | | | | | Currently translated at 81.8% (140 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/de/ Co-authored-by: Ettore Atalan <atalanttore@googlemail.com> Signed-off-by: Ettore Atalan <atalanttore@googlemail.com>
* Translated using Weblate (Finnish)Jan Kuparinen2022-01-181-14/+14
| | | | | | | | | | Currently translated at 73.0% (125 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/fi/ Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com> Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
* osinfo: use consistent include syntax for public headersDaniel P. Berrangé2022-01-1836-36/+36
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: switch to '#pragma once'Daniel P. Berrangé2022-01-1850-514/+361
| | | | | | | | | | | | | | | | The current include files use the pattern #ifndef __OOSINFO_BLAH_H__ # define __OOSINFO_BLAH_H__ #endif /* __OOSINFO_BLAH_H__ */ Since we already mandated GCC + CLang, we can replace this with a simpler incantation #pragma once Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: fix bad preprocessor indentationDaniel P. Berrangé2022-01-181-4/+4
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* loader: add check for unknown file typeVictor Toso2021-11-291-0/+5
| | | | | | | | | | | | | | | | | | | | So we can provide a meaningful error message in case the provided path is not accessible to running process. e.g: running HOME=/root osinfo-query os we would get `Error loading OS data: Unexpected file type` and now we get `Error loading OS data: Can't read path /root/.config/osinfo` This error was first hit with v2v [0] that was leaking $USER and $HOME of root user when osinfo-query as vsdm user with `sudo -c vdsm`. The example above is a simple way to show lack of permision of osinfo-query to read the root's $HOME. [0] https://bugzilla.redhat.com/show_bug.cgi?id=1901423 Related: https://bugzilla.redhat.com/show_bug.cgi?id=1902720 Signed-off-by: Victor Toso <victortoso@redhat.com>
* os: Add `_get_complete_firmware_list()`Fabiano Fidêncio2021-11-248-0/+296
| | | | | | | | | | After realising the mistake of only returning **supported** firmwares on `_get_firmware_list()`, let's work that limitation around by adding a new function, `osinfo_os_get_complete_firmware_list()`, which returns the complete list of firmwares, including both supported and unsupported ones. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
* os: _get_firmware_list() returns supported FWsFabiano Fidêncio2021-11-241-11/+11
| | | | | | | | | | | Let's make sure we document that `_get_firmware_list()` returns **only** supported firmwares, rather than returning **all** the firmwares avaiable for an OS. As part of the documentation change, let's also adapt the internal functions to reflect that. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
* os: Add missing docs for _add_firmware()Fabiano Fidêncio2021-11-241-0/+9
| | | | | | | osinfo_os_add_firmware() has been added as part of 1.7.0 release but, somehow, its documentation has been missing. Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
* ci: Add new targetsAndrea Bolognani2021-11-125-0/+215
| | | | | | lcitool now supports CentOS Stream 9, Debian 11 and Fedora 35. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* ci: Enable RPM jobs on CentOSAndrea Bolognani2021-11-122-12/+2
| | | | | | | | Now that we have a recent version of meson installed from distro packages instead of PyPI, RPM builds will no longer fail. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* ci: Refresh generated filesAndrea Bolognani2021-11-1212-48/+14
| | | | | | | | | | | | | | | | Notable differences: * meson is now installed from the distro repositories instead of PyPI on CentOS 8 and CentOS Stream 8. We can finally do this because the version they ship has been updated. * intltool and itstool (which are used to build osinfo-db as part of the CI pipeline) are no longer included in the container images. osinfo-db-tools moved away from the former and never adopted the latter. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* ci: Drop Fedora 33Andrea Bolognani2021-11-123-80/+0
| | | | | | | It's going to be EOL in a matter of days, and lcitool already dropped support for it. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* Skip over entity reference checks if loading failedDaniel P. Berrangé2021-10-101-2/+2
| | | | | | | | | | If we fail to parse one of the XML files, we abort loading the database. We then carry on to do an entity reference check which will almost certainly fail due to not having loaded many XML files. We need to skip over the entity reference check on failure to avoid spamming the user with bogus errors. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Warn about unexpected files in the databaseDaniel P. Berrangé2021-10-101-3/+12
| | | | | | | | | | | | | | | | To help remind users that files must end in .xml, warn about any unusually named files. There are a couple of files we should not warn about since we expect them to be present - VERSION - LICENSE The entire 'schema' sub-directory should be ignored. Common editor backups "~" and ".bak" should be ignored. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Fix hiding of database entriesDaniel P. Berrangé2021-10-101-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The osinfo-db documentation says that a local admin/user can hide an entity from the system location: [quote] If the file is zero-length or points to /dev/null, then this represents a black-out override. This indicates that the ENTITY-NAME.xml file from a lower priority directory MUST NOT be loaded. [/quote] This does not, however, work at all. If a zero length file is given, it tries to parse this as XML and fails, causing the entire DB loading process to be aborted. This leaves the DB with dangling references. If a symlink to /dev/null is given, it is entirely ignored because the file is a block device and we only try to load regular files. Instead of only loading regular files, we need to load any type of file that has a .xml extension. This appears to be broken since the very first impl of the new DB loading process, despite having written the spec at the same time. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tree, media: Soup.Session.send_async now takes an IO priority argumentFelipe Borges2021-10-062-0/+6
| | | | | | See https://libsoup.org/libsoup-3.0/SoupSession.html#soup-session-send-async Signed-off-by: Felipe Borges <felipeborges@gnome.org>
* tree, media: SoupMessage is a private struct in libsoup3Felipe Borges2021-10-063-7/+12
| | | | | | | | | You can no longer directly access various structs such as SoupMessage. These are now accessed by getters and setters. See https://libsoup.org/libsoup-3.0/ch02.html Signed-off-by: Felipe Borges <felipeborges@gnome.org>
* tree, media: SOUP_SESSION_USER_AGENT isn't defined in libosup3Felipe Borges2021-10-062-2/+2
| | | | | | Let's use the literal "user-agent" instead. Signed-off-by: Felipe Borges <felipeborges@gnome.org>
* build: Require libsoup3Felipe Borges2021-10-061-1/+5
| | | | | | | | See https://blog.tingping.se/2021/02/23/future-of-libsoup.html This will fallback to libsoup-2.4 when libsoup3 isn't available. Signed-off-by: Felipe Borges <felipeborges@gnome.org>
* build: don't set glib version constraints for g-ir-scannerDaniel P. Berrangé2021-09-274-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add_project_arguments() sets flags that apply to all invokations of the C compiler toolchain by meson. On the surface it sounds fine to use this for setting -DGLIB_VERSION_MIN_REQUIRED=VER -DGLIB_VERSION_MAX_ALLOWED=VER as we want all our code to be constrained by these declared glib versions to prevent us accidentally using APIS from newer glib by mistake. A subtle problem was revealed with the arrival of gobject-introspection version 1.70. The g-ir-scanner program auto-generates some glib code for handling introspection, and this generated code uses glib APIs that are newer than our declared version and this triggers compile failures tmp-introspectg6xadxkr/Libosinfo-1.0.c:251:3: error: ‘G_TYPE_FLAG_FINAL’ is deprecated: Not available before 2.70 [-Werror=deprecated-declarations] 251 | if (G_TYPE_IS_FINAL (type)) | ^~ In file included from /usr/include/glib-2.0/gobject/gobject.h:24, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:22, from tmp-introspectg6xadxkr/Libosinfo-1.0.c:30: /usr/include/glib-2.0/gobject/gtype.h:1050:3: note: declared here 1050 | G_TYPE_FLAG_FINAL GLIB_AVAILABLE_ENUMERATOR_IN_2_70 = (1 << 6) | ^~~~~~~~~~~~~~~~~ tmp-introspectg6xadxkr/Libosinfo-1.0.c:251:13: error: Not available before 2.70 [-Werror] 251 | if (G_TYPE_IS_FINAL (type)) | ^~~~~~~~~~~~~~~~~ This is actually harmless, because systems with an older glib will also have older g-ir-scanner and thus not be using these new APIs. We need to exclude the glib version constraints from code generated by glib tools, and thus means we have to stop using add_project_arguments() and set cflags explicitly on each target. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Translated using Weblate (Portuguese (Brazil))Rafael Fontenelle2021-09-061-6/+4
| | | | | | | | | | Currently translated at 100.0% (171 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/pt_BR/ Co-authored-by: Rafael Fontenelle <rafaelff@gnome.org> Signed-off-by: Rafael Fontenelle <rafaelff@gnome.org>
* Translated using Weblate (Finnish)Jan Kuparinen2021-09-061-2/+2
| | | | | | | | | | Currently translated at 65.4% (112 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/fi/ Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com> Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
* ci: remove obsolete refresh script and documentationDaniel P. Berrangé2021-09-032-43/+0
| | | | | | We now use lcitool's manifest feature to generate files. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* ci: re-generate containers/gitlab config from manifestDaniel P. Berrangé2021-09-0315-303/+462
| | | | | | | This uses the command "lcitool manifest ci/manifest.yml" to re-generate all existing dockerfiles and gitlab CI config. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* ci: define a CI manifest fileDaniel P. Berrangé2021-09-031-0/+53
| | | | | | | | | | | | This is to be used with the command "lcitool manifest ci/manifest.yml" to re-generate all existing dockerfiles and gitlab CI config. In a slight change to the existing config, the manifest will always use the pre-build osinfo-db-tools package. Nothing in the libosinfo CI tasks, has a need to exercise latest git master for osinfo-db-tools. The latter is covered fine by osinfo-db CI jobs. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: remove debian-9 build targetDaniel P. Berrangé2021-09-032-82/+0
| | | | | | This platform is no longer supported by libvirt-ci. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: remove centos-7 build targetDaniel P. Berrangé2021-09-032-70/+0
| | | | | | This platform is no longer supported by libvirt-ci. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Translated using Weblate (Sinhala)Hela Basa2021-08-251-4/+7
| | | | | | | | | | Currently translated at 0.5% (1 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/si/ Co-authored-by: Hela Basa <r45xveza@pm.me> Signed-off-by: Hela Basa <r45xveza@pm.me>
* Translated using Weblate (Indonesian)Andika Triwidada2021-08-251-7/+5
| | | | | | | | | | Currently translated at 100.0% (171 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/id/ Co-authored-by: Andika Triwidada <andika@gmail.com> Signed-off-by: Andika Triwidada <andika@gmail.com>
* Translated using Weblate (Finnish)Jan Kuparinen2021-08-251-57/+60
| | | | | | | | | | | | | | | | | Currently translated at 64.9% (111 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/fi/ Translated using Weblate (Finnish) Currently translated at 33.9% (58 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/fi/ Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com> Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
* Translated using Weblate (Korean)simmon2021-08-051-5/+3
| | | | | | | | | | Currently translated at 100.0% (171 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/ko/ Co-authored-by: simmon <simmon@nplob.com> Signed-off-by: simmon <simmon@nplob.com>
* Translated using Weblate (Turkish)Oğuz Ersen2021-08-051-6/+4
| | | | | | | | | | Currently translated at 100.0% (171 of 171 strings) Translation: libosinfo/libosinfo Translate-URL: https://translate.fedoraproject.org/projects/libosinfo/libosinfo/tr/ Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com> Signed-off-by: Oğuz Ersen <oguzersen@protonmail.com>