summaryrefslogtreecommitdiff
path: root/osinfo/osinfo_db.h
Commit message (Collapse)AuthorAgeFilesLines
* osinfo: add API for resolving multiple tree matchesDaniel P. Berrangé2022-02-041-0/+2
| | | | | | | | 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-041-0/+2
| | | | | | | | 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: use consistent include syntax for public headersDaniel P. Berrangé2022-01-181-1/+1
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* osinfo: switch to '#pragma once'Daniel P. Berrangé2022-01-181-8/+4
| | | | | | | | | | | | | | | | 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>
* Use OSINFO_DECLARE_TYPE* macrosFabiano Fidêncio2020-04-131-38/+8
| | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* Update Copyright yearFabiano Fidêncio2020-04-131-1/+1
| | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* Remove AuthorsFabiano Fidêncio2020-04-131-4/+0
| | | | | | | Authors are not often updated and do not reflect the current state of the code. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
* Indent includes/definesFabiano Fidêncio2019-09-251-7/+7
| | | | | | | | By doing this, we can stop excluding files from sc_preprocessor_indentation check. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* db: deprecate osinfo_db_guess_os_from_tree()Fabiano Fidêncio2019-07-021-0/+1
| | | | | | | | | Let's deprecate osinfo_db_guess_os_from_tree() and "force" the apps to use the new/simpler API. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> Tested-by: Cole Robinson <crobinso@redhat.com>
* db: Add identify_tree() APIFabiano Fidêncio2019-07-021-0/+2
| | | | | | | | | | Similarly to identify_media() API, let's add a osinfo_db_identify_tree() API, which is going to simplify a bit tree detection code on the apps level. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> Tested-by: Cole Robinson <crobinso@redhat.com>
* Remove emacs 'Local variables' annotationsCole Robinson2019-03-071-7/+0
| | | | | | | | | No other virt projects have annotations like this, plus IMO .editorconfig handles this in a much nicer way and more flexible way. Ditch them Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
* Remove FSF address from source file headersChristophe Fergeau2013-03-121-2/+2
| | | | | | | The FSF moved a while ago which made the address we use in every source file header invalid. Follow the recommendation from http://www.gnu.org/licenses/gpl-howto.html and don't put any address in these headers, just a link to the fsf website.
* Deprecate osinfo_db_guess_os_from_mediaChristophe Fergeau2012-12-131-0/+1
|
* Add osinfo_db_identify_mediaChristophe Fergeau2012-12-131-0/+2
|
* loader: Load datamapsChristophe Fergeau2012-12-131-0/+3
| | | | | | | | | | | | | | | | | | Install scripts can add a 'datamap' attribute when they declare their config parameters. The value of this attribute is the ID of a datamap, which is an XML file containing key/value pairs: <?xml version="1.0" encoding="UTF-8"?> <libosinfo version="0.0.1"> <datamap id="http://example.com/osinfo/test"> <entry inval="generic-val1" outval="foo"/> <entry> inval="generic-val2" outval="bar"/> </datamap> </libosinfo> This commit adds support for loading these datamaps. The next patches will then make use of these datamaps when the libosinfo user set a value for the corresponding config parameter.
* Suppress gtk-doc warnings on missing field descriptionMichal Privoznik2012-12-071-0/+1
| | | | | | | Each public visible struct and enum must have documented items. If it hasn't, gtk-doc produces a lot of warnings. However, things it's complaining about doesn't have any interesting attributes, so mark them as private.
* Associate install scripts with operating systemsDaniel P. Berrange2012-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Operating systems now get a new element <installer> <script id='http://fedoraproject.org/scripts/fedora/jeos'/> </installer> And there is a new top level element to go along with this: <install-script id='http://fedoraproject.org/scripts/fedora/jeos'> <profile>jeos</profile> <template> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> ....template for install script... </xsl:template> </xsl:stylesheet> </template> </install-script> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix Red Hat copyright lineDaniel P. Berrange2012-02-241-1/+1
|
* Add support for install tree metadataDaniel P. Berrange2012-02-231-0/+4
| | | | | | | | The <media> element and OsinfoMedia class can be used to identify install media, ie ISO images. The <tree> element and OsinfoTree class are the same concept but used to identify installation trees.
* Return matched OS mediaZeeshan Ali (Khattak)2011-11-241-1/+3
| | | | | | | | | osinfo_db_guess_os_from_media() now has an out parameter that provides the caller a reference to returned OS's media that was matched against the passed media instance. WARNING: This commit breaks API but its not really an issue since we haven't yet promised API stability.
* Update to newer COPYING.LIB file with correct FSF addressDaniel P. Berrange2011-11-241-1/+1
|
* Replace OsinfoDb.guess_os_from_location() by guess_os_from_media()Zeeshan Ali (Khattak)2011-08-231-4/+1
|
* Add osinfo_media_new_from_location()Zeeshan Ali (Khattak)2011-08-231-24/+0
| | | | | | | | | | Add API to create a OsinfoMedia object, given an installation media location. This includes moving of installation media errors to osinfo_media module and rename from OsinfoInstallMediaError to OsinfoMediaError. Some application/libraries will want to be able to get basic information about an installation media without having to load the whole metadata DB.
* Add osinfo_db_guess_os_from_location()Zeeshan Ali (Khattak)2011-08-231-0/+30
| | | | Add API to guess OS given an installation media location.
* Introduce a OsinfoDeployment objectDaniel P. Berrange2010-09-021-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The supported devices for deploying an OS on a platform are tracked as part of the main OS device list. This is not sufficiently flexible because it does not allow for tracking extra metadata against a (os, platform) pair. Introduce a new "deployment" object to track the metadata for deploying an OS on a platform. * docs/object-model.fig: Illustrate the object model * data/libosinfo-dummy-data.xml: Introduce deployment metadata * examples/demo.py, examples/demo.js: Update for new APIs * osinfo/Makefile.am, osinfo/libosinfo.syms, osinfo/osinfo.h, osinfo/osinfo_db.c, osinfo/osinfo_db.h osinfo/osinfo_db.h, osinfo/osinfo_deployment.h, osinfo/osinfo_deploymentlist.c, osinfo/osinfo_deploymentlist.h, osinfo/osinfo_devicelink.c, osinfo/osinfo_loader.c: Introduce an explicit deployment object * osinfo/osinfo_os.c, osinfo/osinfo_os.h, test/test-db.c, test/test-os.c: Remove tracking of hypervisor preferred devices * osinfo/osinfo_devicelinkfilter.c, osinfo/osinfo_devicelinkfilter.h: Allow filtering against a link and its target device at the same time.
* Introduce a new OsinfoProduct abstract classDaniel P. Berrange2010-09-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is neccessary to track upgrades/clones/derives relationships for platforms as well as operating systems. Introduce a common parent class for both called OsinfoProduct * data/libosinfo-dummy-data.xml: Make platform XML use the common product XML attributes/relationships * docs/reference/Libosinfo-docs.xml, docs/reference/Libosinfo-sections.txt, docs/reference/Libosinfo.types: Update for new/renamed classes * osinfo/Makefile.am, osinfo/libosinfo.syms, osinfo/osinfo.h: New OsinfoProduct class * osinfo/osinfo_product.c, osinfo/osinfo_product.h, osinfo/osinfo_productlist.h, osinfo/osinfo_productlist.c: New classes * osinfo/osinfo_os.c, osinfo/osinfo_os.h, osinfo/osinfo_platform.c, osinfo/osinfo_platform.h: Change to inherit from OsinfoProduct * osinfo/osinfo_oslist.c, osinfo/osinfo_oslist.h, osinfo/osinfo_platformlist.c, osinfo/osinfo_platformlist.h: Change to inherit from OsinfoProductList * osinfo/osinfo_db.c, osinfo/osinfo_db.h, osinfo/osinfo_loader.c: Update for new class hierarchy * osinfo/osinfo_osfilter.c, osinfo/osinfo_osfilter.h, osinfo/osinfo_osfilter.h, osinfo/osinfo_productfilter.h: Rename filter class
* Rename 'OsinfoHypervisor' to 'OsinfoPlatform'Daniel P. Berrange2010-09-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | | Not all virtualization technologies are hypervisors. Rename the OsinfoHypervisor object to the more general term OsinfoPlatform. * data/libosinfo-dummy-data.xml: Rename 'hypervisor' element to 'platform' * docs/reference/Libosinfo-docs.xml, docs/reference/Libosinfo-docs.xml docs/reference/Libosinfo.types: Update docs for new object name * examples/demo.js, examples/demo.py: Update for object name * osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_platform.h, osinfo/osinfo_platformlist.c, osinfo/osinfo_platformlist.h, osinfo/osinfo_platform.c, osinfo/osinfo.h, osinfo/osinfo_db.c , osinfo/osinfo_db.h, osinfo/osinfo_device.c, osinfo/osinfo_devicelink.c, osinfo/osinfo_devicelink.c, osinfo/osinfo_os.h, osinfo/osinfo_loader.c, osinfo/libosinfo.syms, osinfo/Makefile.am: Rename OsinfoHypervisor to OsinfoPlatform * test/Makefile.am, test/test-os.c, test/test-hypervisor.c, test/test-platform.c, test/test-db.c: Update for object name
* Add API docs for all public methodsDaniel P. Berrange2010-09-011-16/+3
| | | | | | | | | | | Add GTK-DOC api docs for all public methods, signals, objects, enums, etc. Include annotations required for GObject Introspection to get reference counting / memory allocation correct when doing automatic language binding generation * osinfo/*.c: Add API docs for all methods / signals / objects / enums * osinfo/*.h: Ensure parameter names match those in the corresponding .c file implementation to avoid confusing gtk-doc
* Remove 'self' as a parameter name.Daniel P. Berrange2010-09-011-13/+13
| | | | | | | | | | | Using 'self' as a parameter name in methods makes the code feel more object-oriented, but it doesn't play nicely with gtk-doc because 'self' isn't a very descriptive name for docs. Replace all occurances of a 'self' with a short name for the object in question. * osinfo/*.c, osinfo/*.h: Remove use of 'self' as a parameter name
* Add emacs magic for indentation rulesDaniel P. Berrange2010-08-311-0/+7
| | | | | | | | Fix some files where tabs have crept in for indentation and add emacs magic to ensure they don't return. * osinfo/*.h, osinfo/*.c, tests/*c: Add footer setting emacs indentation rules. Re-indent to comply.
* Avoid directly exposing internal lists in OsinfoDbDaniel P. Berrange2010-08-311-0/+4
| | | | | | | | | | | | | | | | | Don't directly expose the OsinfoList objects used by the OsinfoDb class. Instead return a shallow copy of the lists. Add formal APIs for adding entities to the DB. * osinfo/osinfo_devicelist.c, osinfo/osinfo_devicelist.h, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_oslist.c, osinfo/osinfo_oslist.h: Add new constructor to copy an existing list * osinfo/osinfo_list.c, osinfo/osinfo_list.h: Add API to copy elements of an existing list * osinfo/osinfo_db.c, osinfo/osinfo_db.h: Shallow copy the lists before returning them. New APIs for adding entities to the DB. * test/test-list.c, test/test-db.c: Update for changed APIs
* Pull XML loader into a separate classDaniel P. Berrange2010-08-271-3/+1
| | | | | | | | | | | | | | | | | | Instead of having a method on the OsinfoDb class for loading XML, introduce a new object that can handle XML loading. This then gives back a DB when loading is finished * osinfo/osinfo_db.c, osinfo/osinfo_db.h: Remove backing-store property and xml loader methods * osinfo/osinfo_loader.c, osinfo/osinfo_loader.h: New class for loading XML files * osinfo/osinfo_dataread.c: Delete old loader * osinfo/libosinfo.syms, osinfo/osinfo.h, osinfo/Makefile.am: New loader class * test/Makefile.am, test/osinfo.suppression, test/test-db.c, test/test-loader.c: Update to use new loader class
* Lots of code fixes based on results from testsuiteDaniel P. Berrange2010-08-271-6/+6
| | | | | | | | | | | | | | | | | | This fixes numerous memory leaks throughout the code identified by valgrind. It also fixes the const-ness of many parameters * osinfo/osinfo_dataread.c: Rewrite from scratch using DOM APIs instead of streaming APIs * osinfo/osinfo_db.h, osinfo/osinfo_db.c: Remove 'libvirtVer' property and declare all gchar * parameters to be const. Fix some mem leaks * osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Remove some unnecessary strdup()s and fix some mem leaks * osinfo/osinfo_filter.c: Fix mem leaks * osinfo/osinfo_hypervisor.c, osinfo/osinfo_os.c: Allow some object parameters to be NULL. Fix some mem leaks * osinfo/osinfo_list.c: Fix some mem leaks * osinfo/osinfo_osfilter.c: Fix some mem leaks
* Add LGPLv2+ header to all source filesDaniel P. Berrange2010-08-251-3/+20
| | | | | | | * osinfo/*.h, osinfo/*.c: Add license header text * COPYING.LIB: LGPLv2+ license * libosinfo.spec.in, mingw32-libosinfo.spec.in, Makefile.am: Use COPYING.LIB instead of COPYING
* Add support for GObject introspectionDaniel P. Berrange2010-08-251-0/+8
| | | | | | | | | | | | | | Introspect the libosinfo API so that non-C language bindings can be automagically generated * osinfo/osinfo.h, osinfo/osinfo_dataread.c, osinfo/osinfo_db.h, osinfo/osinfo_device.h, osinfo/osinfo_devicelist.h, osinfo/osinfo_entity.h, osinfo/osinfo_filter.h, osinfo/osinfo_hypervisor.h, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_os.h, osinfo/osinfo_oslist.h: Add explicit includes to match build dependancies, to satisfy g-ir-scanner limitations. Rename enum values to allow them to be extracted with correct names
* Remove osinfo common moduleDaniel P. Berrange2010-08-251-3/+2
| | | | | | | | | | | | | | | | | | Finally all objects are fully private and the common code module can be banished. * osinfo/osinfo_common.c, osinfo/osinfo_common.h: Delete * osinfo/Makefile.am, osinfo/osinfo.h: Remove osinfo_common.h * configure.ac: Use osinfo/osinfo_db.c in CONFIG_SRCDIR * osinfo/osinfo_dataread.c, osinfo/osinfo_db.c, osinfo/osinfo_db.h, osinfo/osinfo_device.h, osinfo/osinfo_devicelist.h, osinfo/osinfo_entity.c, osinfo/osinfo_entity.h, osinfo/osinfo_filter.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_list.h, osinfo/osinfo_os.c, osinfo/osinfo_os.h, osinfo/osinfo_oslist.h: Add the main object typedefs, previously in the common module. Rename osinfoRelationship to OsinfoOsRelationship.
* Pass a GError all the way through the XML parserDaniel P. Berrange2010-08-251-1/+1
| | | | | | | | | | | | | | When reading the XML files, a GError should be passed all the way into the parser functions to enable more useful error reporting * osinfo/osinfo_dataread.c: Pass GError down into all XML parser APIs * osinfo/osinfo_db.c, osinfo/osinfo_db.h: Remove return value, since this can be detected from the GError status * test/test-skeleton.c: Pass in a GError & report on failures
* Replace some temporary GTree objects with GHashTableDaniel P. Berrange2010-08-251-3/+3
| | | | | | | | | | Using a GHashTable + GList combination instead of GTree and GPtrArray results in shorter, simpler code and is more inline with normal GLib practice. * osinfo/osinfo_common.h, osinfo/osinfo_db.c, osinfo/osinfo_db.h, osinfo/osinfo_list.c: Replace several GTree objects with GHashTable
* Make osinfo DB struct private & change to use a OsinfoList internallyDaniel P. Berrange2010-08-251-7/+3
| | | | | | | | | | | | | | | | Classes should expose their private bits to each other. Make the OsinfoDb private struct truely private. Switch from using a GTree in OsinfoDb over to a OsinfoList to simplify the code. * osinfo/osinfo_db.c, osinfo/osinfo_db.h: Add private data struct & convert from OsinfoList instead of GTree * osinfo/osinfo_common.h: Remove OsinfoDbPrivate * osinfo/osinfo_dataread.c, osinfo/osinfo_devicelist.h, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_oslist.h: Update for API changes * osinfo/osinfo_list.c, osinfo/osinfo_list.h: Add API for iterating over elements & finding an entity based on its id.
* Add constructors for all objects. Remove constructor for abstract list objectDaniel P. Berrange2010-08-251-4/+0
| | | | | | | | | | | | | | | | | | | While using g_object_new() is functionally fine, it is not type-safe/checked. It should generally only be used by bindings for non-C language. Add explicit constructors for every object and update all callers of g_object_new to use the new constructors. * osinfo/osinfo.h, osinfo/osinfo_dataread.c, osinfo/osinfo_db.c, osinfo/osinfo_db.h, osinfo/osinfo_device.c, osinfo/osinfo_device.h, osinfo/osinfo_devicelist.c, osinfo/osinfo_devicelist.h, osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_list.c, osinfo/osinfo_list.h, osinfo/osinfo_os.c, osinfo/osinfo_os.h, osinfo/osinfo_oslist.c, osinfo/osinfo_oslist.h: Add constructors for all objects & use them
* Remove GError from most APIsDaniel P. Berrange2010-08-251-10/+10
| | | | | | | | | | | | | | | | GLib documents that GError should only be used for recoverable runtime errors, not programmer errors. The latter should use g_return_val_if_fail / g_return_if_fail macros to display the programmer error * osinfo/osinfo_common.c, osinfo/osinfo_common.h, osinfo/osinfo_db.c, osinfo/osinfo_db.h, osinfo/osinfo_device.c, osinfo/osinfo_device.h, osinfo/osinfo_entity.c, osinfo/osinfo_entity.h, osinfo/osinfo_filter.c, osinfo/osinfo_filter.h, osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_os.c, osinfo/osinfo_os.h: Remove GError from most public APIs
* Sanitize API naming for OsinfoDb classDaniel P. Berrange2010-08-251-11/+18
| | | | | | | | | | | | | | | | The GObject naming conversion is lowercase, separated by underscores. This needs to be followed to allow gobject introspection to be auto-generated easily. * osinfo/Makefile.am: Add -Wl,-no-undefined to ensure any undefined symbols are caught * osinfo/osinfo_common.h: Remove declaration of methods that belong in osinfo_db.h * osinfo/osinfo_db.c, osinfo/osinfo_db.h: Convert API naming to use lowercase + underscores. Add an explicit constructor. * test/test-skeleton.c: Fix for changed API naming and use OsinfoDb constructor
* Add decl for all _get_type() methods & enable warningsDaniel P. Berrange2010-08-251-0/+2
| | | | | | | | | | | | | | | | | | | Eliminate compile warnings about undeclared XXX_get_type() methods, by adding declarations for all objects. Switch to using standard GNOME m4 magic for compile warnings. Force enablement of automake maintainer mode, so that Makefile is re-generated if Makefile.am ever changes. Enable silent build rules so that compile warnings can be more easily spotted. * Makefile.am: Whitespace tweak * configure.ac: Remove -Wall, -Werror. Add GNOME_COMPILE_WARNINGS, GNOME_MAINTAINER_MODE_DEFINES, AM_MAINTAINER_MODE, AM_SILENT_RULES * osinfo/*.h: Add XXX_get_type() declarations for all objects * osinfo/Makefile.am: Add $(WARN_CFLAGS) to build
* Move all source & headers into osinfo/ directoryDaniel P. Berrange2010-08-251-0/+87
The GLib/GObject standard practice is to have all source and header files in the same directory, named after the library prefix. Move all headers from api/ and inc/ into src/, then rename src/ to osinfo/ * src/*, api/*, inc/*: Move to osinfo/ * Makefile.am: Update build rules for changed locations * configure.ac: change AC_CONFIG_SRCDIR