| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
|
|
|
|
| |
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
|
|
|
|
|
|
|
| |
Authors are not often updated and do not reflect the current state of
the code.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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 API to guess OS given an installation media location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
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
|