2013-01-14 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.2.3 Fix `make syntax-check` * Add Yuri Chornoivan to AUTHORS file. * Remove osinfo/osinfo_install_config.c from translated sources. test: Distribute test DB data build: Add forgotten header file 2013-01-11 Daniel P. Berrange <berrange@redhat.com> Add ability to list install script config params & profiles When using 'osinfo-install-script' it is useful to know what profiles and config parameters are available. Add two new flags --list-configs and --list-profiles to output this information # osinfo-install-script --list-profiles win7 desktop: autounattend.xml jeos: autounattend.xml # osinfo-install-script --list-config winxp admin-password: optional user-realname: required reg-product-key: required 2013-01-11 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> fedora,installer: Adapt desktop script to F18 Package groups have changed in Fedora 18 yet again. This patch makes the desktop profile script work against Fedora 18 without breaking it against older releases. 2013-01-10 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> fedora,installer: Don't drop 'base' package group In commit e625641, we dropped 'base' package group from destkop profile script thinking that this essential package is pulled as dep by other groups. This turned out to be not true and Fedora 18 documentation states that this package must be explicitly requested. So instead, we now do the same as we do in jeos profile: Use 'standard' group if dealing with >= F18, 'base' otherwise. 2013-01-10 Daniel P. Berrange <berrange@redhat.com> Apply datamap to config parameters when generating install script When creating the XML to use in the install script XSL transform, apply any datamap associated with the config parameters. 2013-01-09 Daniel P. Berrange <berrange@redhat.com> Revert "Add OsinfoInstallConfig:config-params property" This reverts commit 36e5364c1a3e67f8656bfd2db570717b5d2e6e15. Revert "OsinfoInstallConfig: Use config-params if set" This reverts commit 72f00ce4673d1f3cc18f8dddd73f75a2a05a306a. Revert "Add osinfo_install_config_new_for_script" This reverts commit 82784b5f446e2b0cc47704df6ebddff804b4b667. Revert "Set OsinfoInstallConfig:config-params in osinfo_install_script_apply_template" This reverts commit 04f95d473865ed257a4d98a9f0ca17cdee3900f3. Revert "Use OS-specific config in OsinfoInstallScript" This reverts commit 99beb54c7b9a0cfa6285fb2988ed93c406c452a3. 2013-01-09 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add install script for RHEL 6.x The same script might work for other RHEL 6.x too but I have only tested it against RHEL 6.3 for now. Still some issues though: 1. For some reason user's avatar is ignored although according to the docs I could find*, copying the avatar to /home/${USER}/.face should be enough. 2. We don't set the keyboard layout properly yet and just hardcode it to 'us'. This will require the same kind of mapping as Fedora 17 and older. * http://projects.gnome.org/gdm/docs/2.14/configuration.html rhel: Specify resources for all RHEL 6 releases 2013-01-07 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> win7: Use a datamap for GETTEXT to ISO language mapping Lets make use of new datamaps to map GETTEXT language codes (that libosinfo expect from apps) to ISO language codes (that Windows expects). fedora: Use a datamap for GETTEXT->X11 layout mapping Lets make use of new datamaps to map GETTEXT language codes (that libosinfo expect from apps) to X11 keyboard layout codes (that Fedora 18 expects). install-config: Drop support for encoding in l10n params This doesn't just simplify existing scripts but will also make it easier to port these l10n mapping to datamaps. install-config: Correct docs about lang string format We don't really support variants in language/keyboard specifier strings so lets not claim its support in the docs. install-config: Correct default keyboard layout After commit 35a87594, format of keyboard layout string is the same as the language. 2013-01-07 Yuri Chornoivan <yurchor@ukr.net> debian,macos: Fix typos in OS names 2013-01-07 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> ubuntu: Correct required/recommended resources for 12.10 This is as based on "Getting Started with Ubuntu 12.10 - Ubuntu Manual" (page 11 in en_US version). 2013-01-04 Fabiano Fidêncio <fabiano@fidencio.org> opensuse: Add 12.2 information opensuse: Fix .iso URLs debian: Update volume-id for Squeeze 2013-01-02 Fabiano Fidêncio <fabiano@fidencio.org> opensuse: Fix kernel & initrd paths 2013-01-02 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> l10n: Add forgotten file to POTFILES.in Add forgotten osinfo_install_config.c file to po/POTFILES.in. Fixes `make check`. win7: Use product key in desktop profile as well Although optional, product key should be used when specifiedy by app. Before anyone asks, yes I have tested that win7 accepts empty product key node in installer script XML. l10n: Merge Ukrainian from transifex l10n: Merge Polish from transifex configure: Use LINGUAS file Setting ALL_LINGUAS in configure.in is obsolete according to po.m4 in favor of LINGUAS file. This is the reason why all (as far as I can see) GNOME modules use LINGUAS file. Also the rule in configure.ac creates broken Makefile if there is more than one translation files: [zeenix@z-laptop libosinfo]$ make Makefile:166: *** missing separator. Stop. [zeenix@z-laptop libosinfo]$ head -n 166 Makefile|tail -n 2 ALL_LINGUAS = pl uk 2013-01-02 Fabiano Fidêncio <fabiano@fidencio.org> opensuse: Fix 12.1 minimum & recommended resources According to http://en.opensuse.org/Hardware_requirements opensuse: Add missing kernel/initrd information opensuse: Fix indentation debian: Fix kernel/initrd path debian: Fix .iso URL for Squeeze 2012-12-29 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> rhel: Specify kernel/initrd paths for all 6.x media rhel: Set recommended RAM to 1G for RHEL 6.3 db: _identify_media() should also set media ID For the new _identify_media() method to be able to easily replace _db_guess_os_from_media() usage in apps as it intends to, it must provide the ID of the media in the DB. This fixes a recent regression in Boxes caused by switching to _identify_media(): https://bugzilla.gnome.org/show_bug.cgi?id=685826#c35 (and following comments) Osinfo:entity is no longer construct-only As you'll see in the following patch, we need to set ID on existing media instances now. rhel: Really correct minimum RAM for RHEL6 RHEL6 requires 512MB, not 256 as per documentation: http://www.redhat.com/resourcelibrary/articles/articles-red-hat-enterprise-linux-6-technology-capabilities-and-limit Thanks to Christophe Fergeau for pointing this one out as well. 2012-12-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> rhel: Correct minimum RAM for RHEL6 According to the docs, 256MB is required minimum: http://www.redhat.com/resourcelibrary/articles/articles-red-hat-enterprise-linux-6-technology-capabilities-and-limits Thanks to Christophe Fergeau for pointing this out. 2012-12-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> rhel: Specify min/recommended resources for 6.3 Its just a C&P from F18 and seems to work nicely in practice. rhel: Specify kernel/initrd paths in 6.3 media 2012-12-21 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> rhel: Fix a typo causing infinit loops/recursion RHEL 6.3 derives from 6.2, not 6.3 itself. 2012-12-21 Christophe Fergeau <cfergeau@redhat.com> test: Add test for param remapping in install scripts Use OS-specific config in OsinfoInstallScript When generating the unattended installation script, we can now use osinfo_install_config_get_param_list() to get OS-specific values when available. This will only work when an OsinfoInstallConfigParamList is associated with the OsinfoInstallConfig being processed. Set OsinfoInstallConfig:config-params in osinfo_install_script_apply_template This allows translation of generic config to OS-specific config if the install script XML specified some datamaps to transform these parameters. Add osinfo_install_config_new_for_script In order to be able to automatically transform configuration parameters set on OsinfoInstallConfig instances (ie translate from generic value to OS-specific value), we need to have access to the OsinfoInstallConfigParamList for the current OsinfoInstallScript as this is where the OsinfoDatamaps needed to do the remapping are stored. After the previous commits we can now associate an OsinfoInstallConfigParamList with an OsinfoInstallConfig instance, and we can get the OsinfoInstallConfigParamList corresponding to an OsinfoInstallScript instance, so this commit just adds a new osinfo_install_config_new_for_script which will create a new OsinfoInstallConfig instance associated with the OsinfoInstallConfigParamList for a given installation script. OsinfoInstallConfig: Use config-params if set Now that OsinfoInstallConfig has a 'config-params' property which describes the config parameters when it's set, we can use it when it's available. OsinfoInstallConfigParams can indeed contain a datamap to be used to translate generic libosinfo values to OS-specific values. This commit introduces an osinfo_install_config_get_param_value_list method that will be used in subsequent commits to get these OS-specific values when generating install scripts. 2012-12-20 Christophe Fergeau <cfergeau@redhat.com> Add OsinfoInstallConfig:config-params property This property lists the parameters that can be set for a given OsinfoInstallConfig. This is not enforced, it's only there for informative purpose. This will also be used in later commits in order to automatically apply transformations on values for parameters which have an associated OsinfoDatamap. OsinfoInstallScript: Use an OsinfoInstallConfigParamList Currently the install script config parameters are stored in a raw GList. However, OsinfoInstallScript ends up reimplementing part of the OsinfoList API, and the raw GList also does not make it convenient to pass the list of config parameters around. Replace the internal GList with an OsinfoInstallConfigParamList, which has the side-effect of nicely simplifying the code. Set id in osinfo_install_config_param_new OsinfoInstallConfigParam is an OsinfoEntity, but its _new method does not set an id when creating it. This is needed if we want to be able to use an OsinfoInstallConfigParamList. The "name" argument that is passed at creation time is expected to be unique, so we can use that as the entity id even though a full URI would have been nicer. Add OsinfoInstallConfigParamList loader: Parse OsinfoInstallConfigParam::value-map from XML Add OsinfoInstallConfigParam::value-map If set, this OsinfoDatamap value will be used to map generic values to OS-specific values. docs: Small improvements to API doc Improve the (short) description of the OsinfoInstallConfigParam and OsinfoInstallScript classes. docs: Improve osinfo_install_config_new API doc It was inaccurately saying that the newly created OsinfoInstallConfig is empty while it has some default values set. 2012-12-19 Fabiano Fidêncio <fabiano@fidencio.org> docs: add missing ":" for proper introspection docs: Add missing documentation Annotations for: - osinfo_install_script_generate_finish() - osinfo_install_script_generate_output_finish() docs: Fix typos - a -> an - to -> for - add a missing word (elements) - references: @param: an Osinfo* -> @param: an #Osinfo* syms: expose a forgotten method 2012-12-17 Christophe Fergeau <cfergeau@redhat.com> db: Fix gtk-doc name of 2 function for proper introspection This was causing warnings during generation of introspection information. 2012-12-14 Christophe Fergeau <cfergeau@redhat.com> Add missing NULL initialization In error cases, this 'ret' variable can be gfree'd before having been set, so it must be initialized to NULL at the beginning of the function. Issue spotted by Coverity. Add missing break; in switch() Issues spotted by Coverity 2012-12-13 Christophe Fergeau <cfergeau@redhat.com> test-isodetect: Add test for osinfo_media_get_languages By dropping a .lng file similar to: [general] l10n-language=fr_FR;en_EN; it's possible to specify which languages a given media is supposed to support. test-isodetect will then check that the languages for this media in the OsinfoDb match the expected ones. win: Add language information to Windows medias Now that libosinfo knows how to use the l10n-language OsinfoDB attribute, we can add this data to the various Windows <media> definitions in the database. Set language in osinfo_db_identify_media When an OsinfoMedia for OsinfoDb has a l10n-language property set, we are now able to turn it into a proper language list set on the media being identified. loader: Read media language information Getting language information can either be supplied through a series of <l10n-language> tag set on the <media> element or through a regex that will be applied on the media volume ID. The former should be all that is needed for most Linux distros while the latter will be useful to get the language of Windows images. media: Add OsinfoMedia::languages property This lists all the languages a given media can show its UI in. Deprecate osinfo_db_guess_os_from_media Add osinfo_db_identify_media Set OsinfoOs::media for OSes stored in an OsinfoDb Add OsinfoMedia::os property Add datamaps to rng for validation loader: Load datamaps 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. Add datamap classes These will be used to remap generic values set by libosinfo users to OS-specific values used by OS solution files for automatic installation. Based on a patch from Daniel P. Berrange. loader: Don't harcode '+ 9' in tree loading When loading <tree> elements, we want to skip the 'treeinfo-' part of entity property names. This is currently done by using a '+ 9', using sizeof("treeinfo-") instead will make things more obvious. Use G_PARAM_STATIC_STRINGS everywhere Remove the last uses of G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB Fix GObject property gtk-doc name They must be described as ClassName:property-name: or gtk-doc won't pick them up. There were some files where '::' was used instead of ':' as the class name/property name separator. build-sys: Build data/ before test/ Some test cases use the in-tree database data. Since some database files are transformed from .xml.in to .xml during build, it's better to build data/ first to ensure they are there when tests try to use this data. 2012-12-11 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Post release version bump 2012-12-10 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.2.2 data: Add forgotten macos.xml.in file This file got never added to Makefile.am so was never installed or distributed. 2012-12-10 Christophe Fergeau <cfergeau@redhat.com> loader: Use symbolic names in osinfo_loader_install_config_params osinfo_loader_install_config_params.h defines OSINFO_INSTALL_CONFIG_PARAMS_* constants, better to use these rather than string literals. 2012-12-07 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> fedora,win,installer: Assume full paths According to the documentation, we expect apps to specify full paths for disks and locations so we must assume they are so in the scripts. fedora,installer: Set keyboard config for >= F18 Now that we have established what kind of string to expect in 'l10n-keyboard' config, lets correctly set this for F18 and higher. For F17 and older, we hardcode the layout to 'us'. Those require layout to be a console layout so we'll need some complicated XSL magic to translate from X to console layout if we want to properly support those. 2012-12-07 Christophe Fergeau <cfergeau@redhat.com> syms: Alphabetically order osinfo_install_config_* This is ordered on the name of the property that is read/set list: Include osinfo_filter.h in osinfo_list.h osinfo_list.h uses OsinfoFilter so it must include osinfo_filter.h to be self-contained. Remove obsolete methods from OsinfoDeviceDriverList These methods were never part of a libosinfo release, so we can remove them without breaking ABI. Deprecate osinfo_*list_new_* The generic equivalent provided by OsinfoList should be used instead. Use new osinfo_list_new_* helpers everywhere We need to do that before deprecating all the derived class implementations of osinfo_xxxlist_new_*. Add osinfo_list_new_* Currently, every class inheriting from OsinfoList reimplements _new_copy, _new_filtered, _new_intersection and _new_union. This commit adds generic implementations of these methodes in OsinfoList which will allow us to deprecate all the other implementations. 2012-12-07 Michal Privoznik <mprivozn@redhat.com> osinfo_install_config.c: Describe function arguments This patch adds small description to each undocumented argument for each function within osinfo_install_config.c. Document OsinfoInstallConfigParamPolicy enum Document even more arguments These files were still missing function arguments description: * osinfo/osinfo_install_script.c * osinfo/osinfo_os.c Suppress gtk-doc warnings on missing field description 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. 2012-12-07 Christophe Fergeau <cfergeau@redhat.com> Fix internal function names in OsinfoInstallScript A few static methods were prefixed with osinfo_os_ instead of osinfo_install_script_ Add missing osinfo_install_script_get_config_param_list annotation Add Fabiano's copyright to some source files Fabiano made significant work in the installer code, this commit adds his copyright to the files where he is listed in the 'Authors' section, this makes things clearer. Fix osinfo_loader_root comment Some newly added tags were missing from the description syms: Remove duplicated symbol libosinfo.syms contains the osinfo_install_config_param_new symbol twice. Reorder the LIBOSINFO_0.2.0 section to make this obvious, and remove the duplicated symbol. loader: Fix one newly introduced leak This is a follow-up to my previous series fixing leaks as a similar one was just introduced. loader: Fix memory leaks in error paths loader: Fix leak in osinfo_loader_os loader: Don't leak 'arch' loader: Set GError on osinfo_loader_nodeset failures Most of the code in OsinfoLoader check if osinfo_loader_nodeset set a GError to see if it failed and never test if it returned -1. Better to make sure that we actually set the GError when this function fails. loader: Use xmlFree to free libxml2 strings As libxml2 and glib memory allocation functions can be overridden with custom functions, it's important to use the right free functions for allocated memory. build-sys: Fix circular make dependency osinfo_enum_types.h was depending on libosinfo_1_0_include_HEADERS, which contains osinfo_enum_types.h. This caused a build-time warning from make about a circular dependency. 2012-12-07 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> win7,installer: Setup pre-installation drivers install-config: API to specify drivers disk & location Add API for apps to be able to tell where pre- and post-installation drivers are available. winxp,win7,installer: Claim drivers pre-install capability install-script: Add driver install capability API Add API to query install scripts whether they can pre- and post-install drivers, meaning at the beginning and end of installation, respectively. win7,xp: Provide info on viostor drivers The drivers are currently availalable from my own webspace, we should probably put it in a more canonical location and update this patch once the approach taken here is agreed upon by everyone. loader: Load device drivers from DB Load device driver information from os nodes in database. schema: Allow driver info under os nodes This defines the XML we'll use to add device driver information to our XML database. os: API to add & list device drivers Add DeviceDriverList class OsinfoDeviceDriverList is a list specialization that stores only OsinfoDeviceDriver objects. Add DeviceDriver class install-config: Document expected kbd layout format 2012-12-05 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> loader: Fix media object leaks 2012-12-03 Christophe Fergeau <cfergeau@redhat.com> Fix OsinfoMedia::installer-reboots default value By default, we report 1 reboot during installation, not -1. This default value is not used at all (the property is not _CONSTRUCT), but it's better to be consistent with one the getter does. 2012-12-01 Christophe Fergeau <cfergeau@redhat.com> More Windows 8 coverage This covers the whole range of English Windows 8 ISOs available on MSDN. Hopefully this will extend to non-English win8 ISOs on MSDN, and to all non-MSDN win8 releases as well. Update .gitignore Add generated enumeration C/H files win: 2 trivial indentation fixes in XML file 2012-11-30 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Export osinfo_install_script_get_product_key_format This function was never added to libosinfo.syms and hence not exported in the so files. 2012-11-28 Christophe Fergeau <cfergeau@redhat.com> Remove duplicate EXTRA_DIST definition Add test case for handling int in entities This test case would have caught the bugs fixed by 14defe8e and 4e86e2bf 2012-11-28 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> fedora,installer: Fix against Fedora 18 'base' package group has been replaced by 'standard'. For jeos profile, we now use the right name of the group depending on the OS version. For desktop profile, we can simply drop this group from the list as its pulled-in by other groups anyways. 2012-11-28 Christophe Fergeau <cfergeau@redhat.com> Add RHEL 6.3 OS information Add RHEL 5.8 media information Add RHEL 5.5 media information Add RHEL data to test suite Remove extra blank spaces from .sym file win: Small indentation fix media: Use G_PARAM_STATIC_STRINGS media: Don't mark properties as _CONSTRUCT Marking them as _CONSTRUCT will cause the property setter to be called at object construction time to set the property default value. For the properties of OsinfoMedia, this causes the default value to be stored in the entity store as the property setters call osinfo_entity_set_param. However, as the getters are careful to use osinfo_entity_get_param_*_with_default, this is not useful, and wastes memory. This can even be harmful if the default gobject property value and the default value passed to osinfo_entity_get_param are different, the gobject default will be returned, which can be unexpected. Fix 'inirtd' typo Fix gint64 format string in osinfo_entity_set_param_int64 osinfo_entity_set_param_int64 printed gint64 values using G_GUINT64_FORMAT which is unwanted when the value is negative. This bug caused breakage after the changes in 84969ff9 and 4e86e2bf when trying to read the install-reboot value. Until these commits, we stored the textual representation of (guint64)-1 (GUINT_MAX) in the entity store, and when trying to convert it, g_ascii_strtod was returning -GINT64_MAX, and osinfo_entity_get_param_value_int64_with_default was returning the default value as this value is negative. After these commits, g_ascii_strtoll returns GINT64_MAX-1 when trying to parse the overlong string stored in the database, and the default value is not returned as the data was found in the database. Just using the right format (G_GINT64_FORMAT) to convert a gint64 to a string fixes this bug. 2012-11-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> install-config: Document format of 'l10n-language' Co-author & reviewer: Zeeshan Ali (Khattak) <zeeshanak@gnome.org> 2012-11-27 Fabiano Fidêncio <fabiano@fidencio.org> win7,installer: Translate l10n-language configuration The expected format of l10n_language string is the gettext locale names standard: https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Locale-Names.html, While Windows expect this to be in *the* standard format: http://www.ietf.org/rfc/rfc4646.txt So we need to translate the language code for windows. Co-author & reviewer: Zeeshan Ali (Khattak) <zeeshanak@gnome.org> 2012-11-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> win8: Add one more volume ID pattern win8: Remove 'EN' suffix from volume ID patterns xp: Add recommended resources for 64-bit arch as well 2012-11-26 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> xp: Bump recommended RAM and storage A RAM of 128 MiB and storage of 2 GiB might have been adequate in the days when XP came out but now a days its not a lot at all. So lets recommend at least 512 MiB RAM and 10 GiB storage. win7: Add one more volume ID to DB 2012-11-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> API to query required user avatar format Add a new API for apps to be able to query in which format do the user avatar file need to be in. Based on a patch from Fabiano Fidêncio <fabiano@fidencio.org>. 2012-11-23 Christophe Fergeau <cfergeau@redhat.com> entity: Fix osinfo_entity_get_param_value_int64_with_default The way it's currently implemented, osinfo_entity_get_param_value_int64_with_default will return the default value if the value which is being parsed is negative. This happens because it tries to reuse osinfo_entity_get_param_value_int64 to do the parsing, which returns -1 when the value could not be found. However, we have no way of knowing if the -1 means that the value could not be found, or if this means the value was found and its value is -1. This is made worse by the fact that we return the default value as soon as osinfo_entity_get_param_value_int64 returns a negative value, not just -1. By implementing osinfo_entity_get_param_value_int64 by calling osinfo_entity_get_param_value_int64_with_default rather than doing the contrary, we can avoid this issue. entity: Use g_ascii_strtoll to parse int64 strings osinfo_entity_get_param_value_int64 uses g_ascii_strod to parse strings to int64, better to use g_ascii_strtoll which is there for that purpose. 2012-11-21 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> More use of G_PARAM_STATIC_STRINGS 2012-11-20 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Correct RNG for install-script tree * Expect 'install-script' node at toplevel in XML * Interleave all child nodes of 'install-script' node * Remove duplicate entries for 'id' nodes * 'config' node has 'param' nodes under it and they have the attributes * Remove redundant nodes that probably got there due to c&p mistake * 'product-key-format' and 'config' nodes are optional Also validate install scripts Make 'filename' more consistent w/ other restrictions 'filename' should be toplevel node under 'install-script' rather than an attribute of its toplevel 'template' child. The reason this was previously put in the incorrect place was that the first idea was to have multiple files under one install script but we later decided to go for 1 file per install script. Also note that I'm naming the element to 'expected-filename'. This is to make it consistent with associated API and to simplify loading code. Separate root & user passwd setup in fedora installer Separate out root and user password setup in fedora installer so that root account is not made passwordless just because user password was not specified. Specify product key format for windows installers Document osinfo_install_script_get_product_key_format Document the format of the string returned by this function. win7 desktop installer can also use product key Product key is optional for win7 Remove now redundant code in InstallConfigParam Remove private structure and finalize implementation. This should have been part of commit ee9e797. Add a NULL check Allow apps to specify install script disk Allow apps to specify target disk Don't assume avatar location and disk Instead of hardcoding avatar path and disk, lets get those from application. Add InstallScript:path-format Inform the applications in which format the paths are expected by the installer. 2012-11-10 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Remove redundant install script defines Correct a C&P mistake in prop registration Minor indentation corrections Rename a function to better reflect its task osinfo_loader_install_config_param -> osinfo_loader_install_config_params. Correct InstallConfigParam:policy prop to enum type Although this means ABI "breakage", we must keep in mind: a. The property getter (the API used by apps) was treating the string value as enum, i-e it was broken for apps so if any app is using this API, they were totally screwed anyways. b. Its doubtful that this new API is used by any application out there. InstallConfigParam:policy should not be writable This actually not only breaks ABI but also the API: we remove one argument of _new() function. The prop getter is the main part of this API that an app will be using if its using this API at all so I think its worth it to correct this now (while we are causing other breakage here: See next patch in this series). I am also not certain that _new() should be part of the public API. InstallConfigParam props should map to entity params Without entity params usage, there is no real benefit of deriving from Entity class so this was very much intended from start. Add enum param getter/setter helpers Add: * osinfo_entity_get_param_value_enum * osinfo_entity_set_param_enum Minor syntax correction to windows-unattend.xml Use glib-mkenums to register enums with glib This commit adds the generation of osinfo_enum_types.[ch] using glib-mkenums. These files will register the various enums that will get added to osinfo header files with glib. Commit message shamelessly stolen from a similar commit to libvirt-glib by Christophe Fergeau <cfergeau@redhat.com>. 2012-11-08 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Bump version 2012-11-06 Eric Blake <eblake@redhat.com> maint: update to latest gnulib maint.mk * maint.mk: Resynchronize from gnulib. * cfg.mk (_gl_translatable_string_re): Reflect new gnulib naming. 2012-10-31 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Steal libvirt magic for picking translation files Since we don't keep a static LINGUAS file, we need to do this for intltool to pick-up our translation (.po) files. Translate all (potentially) user visible strings Make some strings more translator-friendly at the same time. 2012-10-30 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> autogen: Remove redundant intltoolize call gnome-autogen.sh calls this for us. Thanks to Christophe Fergeau <cfergeau@redhat.com> for pointing this out. Update .gitignore 2012-10-29 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Mark obvious strings in DB for translation Mark 'name' and 'vendor' in oses and hypervisor, and 'name' in devices for translation. This implies that now we generate the actual XML files to automatically get translations inserted into them. Co-author: Eric Blake <eblake@redhat.com> 2012-10-29 Eric Blake <eblake@redhat.com> maint.mk: Resync from gnulib. AUTHORS: Add myself. 2012-10-29 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Load localized values for entity params Attempt to use the localized values of entity params if available before using the non-localized values. This does not yet include custom (ones starting with 'x-') params as I haven't yet figured the right xpath magic to (cleanly) achieve that. Suggestions welcome! 2012-10-26 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add translation framework Note that we are calling bindtextdomain() from Loader's class init. AFAICT, its a common practice in libraries without any main _init() function to make this call in init of the most common/useful class (e.g gdk-pixbuf and gdbus). Update .gitignore 2012-10-19 Michal Privoznik <mprivozn@redhat.com> 95-osinfo.rules.in: drop empty line at EOF AUTHORS: Add David to the authors file as he contributed by fixing udev rule. 2012-10-16 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add data for Finnish windows 7 professional Although this is tested against only Finnish ISOs, I'm almost sure the volume IDs I added to DB are generic and should work for ISOs of other locales as well. 2012-10-12 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.2.1 2012-10-12 David Zeuthen <davidz@redhat.com> Fix udev rule The udev rules for detecting OS'es are too complicated and they also don't work when detecting OS'es on e.g. a loop device. For example, the stuff about DISK_MEDIA_CHANGE is kinda wrong. The latter is pretty annoying as the default action in F18 for an .ISO file is to loopback mount it - as a result the user is presented with "Open with Files" instead of "Open with Boxes". Fixes rhbz#863468 2012-10-11 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Specify relationship between gnome 3.6 & fedora 18 This is so that application know the supported devices. 2012-10-10 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> docs: Remove redundant .types file Since we pass --rebuild-types to gtkdoc scanner, .types file is generated for us and therefore we don't want to keep this in VCS. Add 'installer-reboots' attr. to RNG Last patches broke `make check`, this one fixes it. Correct 'installer-reboots' value for XP & win7 The default value of '1' is not correct for these OSs at least. Add 'installer-reboots' parameter to OsinfoMedia If media is an installer, this specifies the number of reboots the installer takes before installation is complete. Default value is '1'. This is mainly needed for applications like GNOME Boxes and virt-install to be able to tell when OS installation from a given media is complete so that they can take whatever post installation steps they may need to. 2012-10-07 Fabiano Fidêncio <fabiano@fidencio.org> config_param: add is_{required, optional} functions These functions help applications to check if a config_param is required or optional. install_script: add get_config_param function Return, if exists, the sought OsinfoInstallConfigParam from an OsinfoInstallScript. Otherwise, NULL is returned. differenciate between expected/output script name We need to differenciate between the expected filename and the output filename. While former always remains the same (as some operating systems expect it with a particular name), the latter is dependent on the output prefix (set by application) 2012-10-05 Fabiano Fidêncio <fabiano@fidencio.org> docs: remove type include twice 2012-10-02 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Bump version Add data on GNOME 3.6 Currently this is just so that apps can recognise GNOME live ISOs but later could be re-used when/if we need to treat GNOME as an OS: http://afaikblog.wordpress.com/2012/08/07/gnome-os/ Add data on Fedora 18 Most of this data is simply a modified copy of Fedora 17 data. Some of it (e.g ISO URLs) will not be valid until the actual release is out. 2012-09-28 Michal Privoznik <mprivozn@redhat.com> RNG: Add IDE and virtio bus types RNG: Adapt examples to updated schema Demo scripts and example database needs to be updated to reflect updated RNG schema. RNG: Adapt deployment to the code as it should contain one os, platform and multiple devices elements. RNG: Allow devices to have driver device: Introduce SUBSYSTEM property PCI IDs database allows devices to have subsystem so we should reflect this in our model as well under optional element <subsystem>. DB: convert <device> into <product> and <device-id> into <product-id> as they were mistakenly switch for the latter and hence not parsed at all. RNG: Move product-attr and product-content to interleave 2012-09-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Remove a redundant private function 2012-09-26 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> More type-specific entity value getters/setters Add: * osinfo_entity_get_param_value_boolean_with_default * osinfo_entity_get_param_value_int64 * osinfo_entity_get_param_value_int64_with_default * osinfo_entity_set_param_int64 Most of these methods already existed as private functions in media and resources subclasses. This patch puts them where they belong, exposes them in public API and renames them appropriately. 2012-09-11 Christophe Fergeau <cfergeau@redhat.com> Add ubuntu 12.10 data It's not released yet so may need some adjustments post-release, but most of this information should be accurate. It allows libosinfo to identify 12.10 beta isos already. 2012-09-04 Christophe Fergeau <cfergeau@redhat.com> osinfo-detect: ignore DB loading errors osinfo-detect is currently exiting with a failure when a DB loading error occurs. However, such errors should not be fatal as they can happen when the user put a malformed XML file in ~/.local/share/libosinfo. The worse that can happen when this function fails is that the OsinfoDB will not be populated, but this shouldn't cause memory corruption or crashes, so we can log the error and go on. loader: remove debug g_print When an error occurs in osinfo_loader_process_default_path, there's a g_print("Fail"); call. This commit removes this. fedora: fix min RAM requirements Fedora 16 and 17 need 768MB as a minimum as indicated in the release notes: http://docs.fedoraproject.org/en-US/Fedora/16/html/Release_Notes/sect-Release_Notes-Welcome_to_Fedora_16.html#sect-Release_Notes-Hardware_Overview http://docs.fedoraproject.org/en-US/Fedora/17/html/Release_Notes/sect-Release_Notes-Welcome_to_Fedora_17.html#sect-Release_Notes-Hardware_Overview 2012-08-31 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.2.0 2012-08-28 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add varirables for DB paths in pkg-config file For both system and local databases. These are paths where applications can put custom database files. Libosinfo will load from these paths after loading its default database so applications can also override information from default database and not just add more information. Check log of commit b12f417d3b568ac12cebecd8c439b51be7419393 for details about these paths. 2012-08-28 Fabiano Fidêncio <fabiano@fidencio.org> Fix typo in InstallConfigParam header 2012-08-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Remove bogus min storage info for Fedora This information was added by me in commit d0253b5a and was the result of me misreading the docs[1]. This 94 MiB is not actually the minimum required total disk space but minimum of *additional* disk space required by the installer itself. [1] http://docs.fedoraproject.org/en-US/Fedora/15/html/Release_Notes/sect-Release_Notes-Welcome_to_Fedora_15.html#sect-Release_Notes-Hardware_Overview 2012-08-23 Daniel P. Berrange <berrange@redhat.com> Bump version to 0.2.0 to recognise major new features 2012-08-23 Fabiano Fidêncio <fabiano@fidencio.org> Fix typo in win2k8 media architecture Fix missing ":" at comments Add desktop profile for Windows To create an user and set their avatar, we need to create 2 new files, that will be used in older Windows. (http://bugzilla-attachments.gnome.org/attachment.cgi?id=214681) Was discussed in the ML about don't create this files and put all information in only one script, separating each file in one template, as suggested in: https://www.redhat.com/archives/virt-tools-list/2012-June/msg00078.html In the implementation time, a limitation occurred, and I realized that I was doing the things in the wrong way. (if there is 1 script for all the files and _generate*() gives you 1 file as output, how we could generate different files from the unique file?) So, I would like to go back with the first implementation, creating different files for each file used by windows xp (e. g.) Add desktop profile for Fedora 15 and newer As talked on IRC, was decided to not install QXL drivers for older Fedora (16 or lesser). Why? We are keeping some hacks only to avoid broken QXL driver and, at least for now, we are removing these. install script: add config_param entity Now we need to set what are the configs that will be used in each script. To set it, just add, in the .xml's script file: <config> <param name="..." policy="mandatory"|"optional"/> </config> For manage these configs, a new entity was created, called: OsinfoInstallConfigParam. And the OsinfoInstallScript entity is, now, keeping an internal list of the OsinfoInstallConfigParam entity. With these changes, applications that uses/will use libosinfo can check if an install script has some config to be set using, consulting by: - ConfigParam entity: osinfo_install_script_has_config_param(OsinfoInstallScript *script, const OsinfoInstallConfigParameter config_param); - Parameter name: osinfo_install_script_has_config_param_name(OsinfoInstallScript *script, const gchar* name); install script: generates the output in a file Add variant of osinfo_install_script_generate() that outputs the script into a file in the given directory. Also add API to specify a custom prefix for generated file. Moreover, the "filename" attribute was added in the "template" element in the install script data, and it will be used as the output filename for each script and will be more detailed below. Also, support to this field was provided in the XML schema and in the osinfo_loader as well. About the osinfo-install-script tool: If the prefix argument is NULL, the output files will be written as set in data/install-scripts/*.xml (in filename attribute from template element): - Linuxes: fedora.ks - Windows 2k3r2 and older: windows.sif - Windows 2k8 and newer: windows.xml Otherwise, the prefix will be prepended in the filename as: <prefix>-<filename> If the dirname argument is NULL, the output files will be written in the current directory. It will be used to create, easily, multiple scripts, as used in: http://bugzilla-attachments.gnome.org/attachment.cgi?id=214681 Don't return a gboolean when a gchar * is expected Add "hostname" prop to install-script-config It is desirable to configure the hostname of the new virtual machine during initial automated provisioning Add win2k and win7 forgotten installers tag Expose forgotten APIs from install script config These APIs will be used, at least, by boxes Standardize function names Rename some functions' names to accord with the rest of API Fix function's name exposed by osinfo_db osinfo_db_get_install_script_list was being exposed with a wrong standard name (osinfo_db_get_install_scripts). Update README file Add dependencies needed by install scripts 2012-08-23 Daniel P. Berrange <berrange@redhat.com> Update git ignore rules Add data files for Fedora & Windows unattended installs For Fedora this adds a kickstart file template which self-adapts to all Fedora versions 1-> 16 For Windows this adds two file templates, one using the legacy SIF .ini file format for Win2k3 or earlier, and the other using the modern unattended XML format for Win2k8 or newer Add a command line tool for generating install scripts Add test suite for install script generation This test suite creates an OsinfoInstallConfig object and along with a demo XSL template, it generates some install scripts Associate install scripts with operating systems 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> Add APIs for dealing with installer automation scripts This introduces two new objects - OsinfoInstallConfig - stores configuration parameters which get substituted into the install script template. - OsinfoInstallScript - provides a template and the mechanism for turning it into an install script using XSLT Add helper APIs to OsinfoEntity for boolean params Misc Fedora review fixes to Mingw RPM specfile 2012-08-14 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> API for getting product logo URLs While we will be able to neither ship any product logos nor provide URLs to them for legal reasons, this patch simply adds API for easily fetch URLs from *a* libosinfo database. 2012-06-20 Daniel P. Berrange <berrange@redhat.com> Fix source URL for mingw-libosinfo.spec.in Convert to build with mingw64 toolchain 2012-06-14 Daniel P. Berrange <berrange@redhat.com> Add Wanlong Gao to AUTHORS file 2012-06-11 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Post release version bump Release 0.1.2 Add two Ubuntu 6.06 alternate ISOs This fixes the `make check` breakage from commit 2e4ceff. 2012-06-11 Christophe Fergeau <cfergeau@redhat.com> Add information about Ubuntu 12.04 Based on a patch from Wanlong Gao <gaowanlong@cn.fujitsu.com> 2012-06-08 Christophe Fergeau <cfergeau@redhat.com> Add Windows 7 Ultimate N identification This fixes https://bugzilla.gnome.org/show_bug.cgi?id=676248 Data provided by Vladimir Beneš <benesv@email.cz> build: allow building with newer glibc-headers and -O0 Commit log and autoconf snippet written by Eric Blake for libvirt. glibc 2.15 (on Fedora 17) coupled with explicit disabling of optimization during development dies a painful death: In file included from /usr/include/limits.h:27:0, from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,. from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7, from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34, from util/bitmap.c:26: /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] cc1: all warnings being treated as errors Work around this by only conditionally defining _FORTIFY_SOURCE, in the case where glibc can actually use it. The trick is using AH_VERBATIM instead of AC_DEFINE. * m4/libosinfo-compile-warnings.m4 (LIBOSINFO_COMPILE_WARNINGS): Squelch _FORTIFY_SOURCE when needed to avoid glibc #warnings. Add a few more Win 7 volume IDs This commit adds test case data for the Windows 7 ISOs I have available locally and updates the windows 7 volume ID list so that make check still passes after these additions. Add more Windows XP test cases and a new volume ID Add the output of isoinfo -d -i image.iso for the Windows XP I have available locally, this makes make check a bit more extensive. Since make check was failing after these additions, this commit also adds the missing volume ID for Windows XP 64 bit with debugging enabled to windows.xml Add missing VX2PRMFPP Windows XP volume ID The commit adding lots of Windows XP signatures inadvertantly dropped one preexisting volume ID. This causes a make check failure 2012-06-08 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Stricter volume ID regex for Ubuntu server spins Without this fix, we end-up getting destkop media wrongly matched to server media. 2012-06-05 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Fix osinfo_list_add_union() This function was adding the second list elements to new list first so the order of elements in the new list was contrary to what user will expect of this function (and all wrapper/using functions). 2012-06-05 Wanlong Gao <gaowanlong@cn.fujitsu.com> libosinfo: update the information of Fedora 17 2012-05-31 Christophe Fergeau <cfergeau@redhat.com> Rework udev rule some more Now that the rules to remove device properties when the CD is ejected have been fixed, another bug in these rules shows up: there are 2 rules very similar to the rules for disk insertion. One of them matches ID_FS_TYPE != "iso9660" and the other matches ID_FS_TYPE != "udf" which means that at least one of them will trigger and will remove the OSINFO_* properties that have been just set by the insertion rules. While attempting to fix them, I've noticed that these properties go away anyway when the disk is removed and this has been confirmed on #udev, so we can get rid of them. While at it, I've added a test to check that the 'change' events correspond to a media change. 2012-05-23 Fabiano Fidêncio <fabiano@fidencio.org> Import more Windows ISO signatures Based on: http://www.tacktech.com/Software.cfm 2012-05-15 Christophe Fergeau <cfergeau@redhat.com> Add missing % to %{rhel} macro This fixes the previous commit. Fix spec file for RHEL builds %fedora is not defined when building for RHEL, so we need to use %{?fedora} instead of %{fedora}. This commit also makes sure that newer RHELs will build libosinfo with introspection support. 2012-04-13 Christophe Fergeau <cfergeau@redhat.com> Fix Ubuntu 10.04 detection LTS Ubuntu versions are respinned several times throughout their lifetime to integrate all the updates on the iso. When this happens, the volume ID becomes "Ubuntu 10.04.4 LTS i386" for example. The additional 3rd digit is properly handled for 8.04 but not for 10.04. This commit fixes the 10.04 volume ID regexp so that it handles this case, and also adds the missing "LTS" to the regexp (rhbz#811871). This fixes detection of the ubuntu 10.04.4 iso, I couldn't get my hands on an older 10.04 iso to double check this doesn't cause a regression. 2012-04-12 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Post release version bump There is no libsoup-gnome-devel package 2012-04-12 Daniel P. Berrange <berrange@redhat.com> Don't generate man pages in source directory 2012-04-12 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release notes for 0.1.1 2012-04-06 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add information about Fedora 17 2012-03-27 Christophe Fergeau <cfergeau@redhat.com> configure.ac: don't error out when vala autodetection fails When --enable-vala or --disable-vala are not passed to configure, configure.ac automatically checks for vala availability. However, in this case, it's erroring out when vapigen cannot be found instead of silently disabling it. configure.ac: set VAPIGEN when --enable-vala is passed It was only set when the vala detection was automatic (ie no --enable-vala on the command line) 2012-03-26 Daniel P. Berrange <berrange@redhat.com> Fix schema compliance bugs in OS data Expand RNG schema to cover latest additions - Add 'distro' to RNG schema - Allow 'short-id', 'upgrades' and 'derives-from' to occur 1 or more times Rename test data files to match changed distro short-id 2012-03-23 Fabiano Fidêncio <fabiano@fidencio.org> Don't call memset() with zero length for padding Add missing initializers for OsinfoLabel structs 2012-03-22 Daniel P. Berrange <berrange@redhat.com> Disable vendor, distro & family display by default To make the output of osinfo-query more managable disable the display of vendor, distro & family fields. Only short-id, name, version & id are shown. Add 'distro' field to osinfo-query command Enable the osinfo-query command to display the contents of the 'distro' field Remove 'generic-linux' which are not an OS distro entries The 'generic-linux.xml' file was only present because virt-install had some generic entries. Compatibility for virt-install does not need to be in libosinfo itself. Standardize format for OS id, short-id, distro, version Standardize the format used for creating 'id' and 'short-id' fields, based on distro, version & vendor website URL - id: http://{VENDORSITE}/{DISTRONAME}/{VERSION} - short-id {DISTRONAME}{VERSION} eg, distro=rhel version=6.0 vendor=Red Hat Then short-id=rhel6.0 id=http://redhat.com/rhel/6.0 Also allow for a second short-id, which can be based on the codename {DISTRONAME}{CODENAME}, eg short-id=ubuntuedgy The exception is windows where the {VERSION} number isn't really a distro version, but rather a kernel version. Use the common distro suffix in short-id / id instead ie, 2k, 2k3, vista, me, 95 Add ancient Win16/NT operating systems For completness add in the 16-bit Windows OS and Win NT line of OS Rename 'vista' to 'winvista' All windows distros have a short name prefix of 'win' except for 'vista'. Fix that to be 'winvista' Add release/eol dates for windows Get rid of generic 'windows' template OS Make the OS database only contain real OS entries, no virtual ones like 'windows'. Create a diagram of the windows upgrade and derives paths, and apply this to the metadata correctly so we inherit in the same way the product code inherits Standardize OS family names as all lowercase The OS family names effectively refer to the kernel used. Switch them all to lowercase, and correct a few mistakes, MacOS -> darwin Windows -> win9x or winnt Other -> msdos or netware <family>darwin</family> <family>freebsd</family> <family>linux</family> <family>msdos</family> <family>netbsd</family> <family>netware</family> <family>openbsd</family> <family>solaris</family> <family>win9x</family> <family>winnt</family> Fill in '<distro>' element for everything The following distro names are used, all in lowercase for compatibility with libguestfs <distro>centos</distro> <distro>debian</distro> <distro>fedora</distro> <distro>freebsd</distro> <distro>mandrake</distro> <distro>mandriva</distro> <distro>mes</distro> <distro>msdos</distro> <distro>netbsd</distro> <distro>netware</distro> <distro>openbsd</distro> <distro>opensolaris</distro> <distro>opensuse</distro> <distro>osx</distro> <distro>rhel</distro> <distro>rhl</distro> <distro>sled</distro> <distro>sles</distro> <distro>solaris</distro> <distro>ubuntu</distro> <distro>windows</distro> 2012-03-21 Daniel P. Berrange <berrange@redhat.com> Fix handling of const path strings when loading files Handle short reads when extracting ISO headers You cannot assume that g_input_stream_read_async will return as many bytes as you requested. It is perfectly valid to get a short read. Code must be prepared to repeat the read operation multiple times until all data is read, or EOF/error occurs. Add support for loading extra local database files In addition to loading the system files from /usr/share/libosinfo/db, it will now also load files in /etc/libosinfo/db/ (if it exists) and $HOME/.local/config/libosinfo/db/ (if it exists) New APIs are also added to allow an application to load a subset of these locations, if they don't like the default behaviour Move database files into $datadir/db instead of $datadir/data 2012-03-15 Daniel P. Berrange <berrange@redhat.com> Add osinfo-query man page to RPMs 2012-03-14 Daniel P. Berrange <berrange@redhat.com> Remove obsolete scripts for PCI/USB id conversion The osinfo-pciids-convert and osinfo-usbids-convert scripts are no longer required, since we can load the data files natively. Remove them to avoid a runtime dep on Perl. Fix whitespace at end of file 2012-03-13 Daniel P. Berrange <berrange@redhat.com> Update entity test to cope with new 'id' parameter Move openbsd test data to take account of rename Add a 'osinfo-query' command line tool Enable end users to search the database with a new osinfo-query command. For example $ osinfo-query --fields=short-id,name os vendor="Fedora Project" Short ID | Name ----------------------+------------------ fedora1 | Fedora Core 1 fedora2 | Fedora Core 2 fedora3 | Fedora Core 3 fedora4 | Fedora Core 4 fedora5 | Fedora Core 5 fedora6 | Fedora Core 6 ... Update git ignore rules Add a dummy "ID" property for entities When querying/processing entities, it is useful if the 'id' field appears just like other properties. Add a special case to handle this Fix XML loader to correctly distinguish vendor/product names & IDs The loading of pci.ids/usb.ids was setting the 'product' and 'vendor' properties with ID values. The loading of devices from XML was setting 'product' and 'vendor' properties with name strings, but forgetting to parse ID values from the XML Flesh out FreeBSD & Mandriva distro data. Add NetBsd & Mandrake Add a 'distro' property for OS objects The OS 'family' property is used to refer to the kernel type of the OS. The new 'distro' property refers to the grouping of OS by a particular vendor. For example all Linux distros have a family of 'Linux', but their own distinct 'distro' value (Fedora, Ubuntu, etc). Debian is even more fun having alternate releases which use a Hurd of FreeBSD kernel, these variants will each have the 'hurd' or 'freebsd' family, with a common 'debian' distro. 2012-03-12 Daniel P. Berrange <berrange@redhat.com> Fix generation of docs in a VPATH builder The DOC_SOURCE_DIR variable was missing the $(top_srcdir) variable so it could not find the source files when run from a VPATH build. Empirically the previous comment saying that $(top_srcdir) was not needed is wrong. 2012-03-03 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Specify 'derives-from' relationship for openSUSE OSs 2012-03-02 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Proper/complete name of Canonical & Microsoft 2012-03-01 Daniel P. Berrange <berrange@redhat.com> Add Win8 previous ISO signature Import yet more Windows ISO signatures, including Windows 8 preview 2012-02-28 Daniel P. Berrange <berrange@redhat.com> Add yet more Windows ISO signatures Add openbsd.xml to the EXTRA_DIST list & sort it alphabeticaly Import OpenBSD ISO data 2012-02-24 Daniel P. Berrange <berrange@redhat.com> Import GNULIB's syntax checking rules Add libosinfo.rng to mingw32 spec Add <config.h> to all files & remove trailing blanks Normalize whitespace at end of file Fix 'the the' typo Fix Red Hat copyright line Fill out AUTHORS file Death to TABs Switch over to GNULIB's compiler warning code Don't jump over variable declarations Remove redundant 'packed' attribute since struct is fully aligned Rename 'link' variables to avoid clash with global symbol Add a man page for the osinfo-detect command Add a test case which validates all schemas in tree Add an osinfo-db-validate command for verifying XML files The osinfo-db-validate command takes a list of paths or URIs on the command line and validates them against the RNG schema Fix numerous schema non-compliance bugs in the XML database Add an RNG schema for the libosinfo XML documents Create an RNG schema that will be installed into /usr/share/libosinfo/schemas/libosinfo.rng and can be used to validate XML files Import more Ubuntu distro ISO tests 2012-02-23 Daniel P. Berrange <berrange@redhat.com> Remove bogus treeinfo data for Fedora <= 6 & replace with initrd/kernel/bootiso Add test for tree URIs Add Fedora tree URLs Add support for install tree metadata 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. Add tests for Debian distro signatures Fix regex matching for OS media The current regex match rule is If pattern is NULL and string is NULL -> accept media else if pattern is NULL or string is NULL -> reject media else -> do regex compare The regex match rules ought to be If pattern is NULL -> accept media Else if string is NULL -> reject media else -> do regex compare The idea is that if the Osinfo database pattern is NULL, then regardless of whether the string is NULL or not, then we should allow that match. In effect a pattern == NULL, should be treated as equivalent to a regex ".*" Update git ignore files Yet more ubuntu ISO file signatures 2012-02-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Proper/complete name of Canonical & Microsoft 2012-02-22 Daniel P. Berrange <berrange@redhat.com> Add yet more Windows ISO signatures Fix two RHEL-2.1 release dates 2012-02-22 Matthew Booth <mbooth@redhat.com> Separate win2k3/win2k3r2 and win2k8/win2k8r2 Import more Windows ISO signatures 2012-02-22 Daniel P. Berrange <berrange@redhat.com> Fix make dist * configure.ac: Require POSIX tar format for long filenames * test/Makefile.am: Include isodata/ in dist * test/test-isodetect.c: Fix VPATH builds * test/test-mediauris.c: Skip network tests unless LIBOSINFO_NETWORK_TESTS is set Add more Windows ISO image signatures Add codenames for Fedora & Ubuntu Add more RHEL distros, add RHL distros Add support for product codenames 2012-02-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Specify 'derives-from' relationship for Ubuntu & Debian OSs 2012-02-22 Daniel P. Berrange <berrange@redhat.com> Add Win7 enterprise edition ISO signatures Add release / end-of-life dates for Fedora, RHEL & Ubuntu distros Add support for filtering products based on release/eol dates Disable Debian/OpenSuse URIs Add test case for validating all URIs Add test case for Ubuntu distro media Fill out media for all Ubuntu distros Add remaining Ubuntu distro releases Add test data for Windows ISO detection Fill out more Windows ISO signatures 2012-02-21 Daniel P. Berrange <berrange@redhat.com> Add test case for validating ISO detection Fill out complete Fedora ISO/DVD metadata Also extract application ID from ISO PVD Add missing Fedora releases & fix name of those pre Core/Extras merge Add missing export of osinfo_entity_set_param 2012-02-11 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Post release version bump 2012-02-10 Christophe Fergeau <cfergeau@redhat.com> Add RHEL 6.2 2012-02-07 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.1.0 Put symbols into their corresponding versions in syms file Match substring regex in the end Sometimes volume-id expression of one architecture is a substring of volume-id expression of another architecture for the same OS. For example '.*G.*RMC.*' is volume-id expression for i386 media of win7, while '.*G.*RMC.*X.*' is for x86_64. To avoid incorrect matching, we need to ensure that matching is done against '.*G.*RMC.*X.*' first and then '.*G.*RMC.*'. 2012-01-27 Christophe Fergeau <cfergeau@redhat.com> Use ENV{} in udev rule There are only a handful of key names that can be directly assigned in an udev rule (through FOO=....), for device-specific properties, ENV{FOO} must be used. 2012-01-24 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Utility function to retrieve OS devices by property 2012-01-19 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add missing 'const' OsinfoList function params Post release version bump 2012-01-16 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.0.5 2012-01-10 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add osinfo_os_get_all_devices() Add a function to retreive all supported devices from an OS. Specify 'derives-from' relationship for Fedora OSs Bump version 2012-01-09 Christophe Fergeau <cfergeau@redhat.com> Check PrimaryVolumeDescriptor size at compile-time Eric Blake suggested on the mailing list that we can use a dummy array declaration to trigger a compile error if the PrimaryVolumeDescriptor structure size isn't 2048 bytes. 2012-01-06 Christophe Fergeau <cfergeau@redhat.com> Mark the volume descriptor structs as packed This tells gcc it shouldn't add some padding between the struct members. which is important because we rely on this structure size being exactly 2048. One of its members is guint8 ignored2[246]; (only a 2 byte multiple) so all the fields of the struct won't be aligned on a 8 byte boundary, so gcc could do some unexpected things on some arch. The 2 structs changed by this patch only use arrays whose elements have the same size as chars so gcc will probably don't try to change their alignment, but one never knows.. Use g_str_has_suffix instead of opencoding it 2011-12-27 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> List supported audio devices for Windows & Fedora 2011-12-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add all metadata from default path We were only loading OS XML files from default path. Distribute and install forgotten device XML files 2011-12-21 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add QXL to supported devices of windows & Fedora 2011-12-19 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.0.4 2011-12-18 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add mandatory commas to udev rules file 2011-12-16 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Release 0.0.3 2011-12-12 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Minor correction to win2k8 volume ID 2011-12-02 Christophe Fergeau <cfergeau@redhat.com> Handle NULL GError ** It's valid to pass NULL GError ** around when we are not interested in error reporting. This means we have to make sure the GError** is not NULL before dereferencing it. In particular, the right way of testing if GError **err; is set is to do if (err && *err) {} This commit adds a helper to do this check and uses it where needed. Fix OSINFO_MEDIA_ERROR_INSUFFIENT_METADATA typo This is an API change, but I don't think many application are checking error code values of libosinfo errors so I'd say we can do it a this point. A #define for the old symbolic name can be added if we don't want to break the API. Fix "insufficient metadata" test in on_pvd_read There are 2 issues with this test: 1) it's not using is_str_empty, which means it won't do what's expected on some ISOs where "empty" descriptors are read as a string full of blank space 2) it mandates the presence of a system or publisher descriptor in ISOs, which is not the case on ubuntu 11.10 ISOs. They only have a volume descriptor. Since on most ISOs, publisher is empty and system is "LINUX", they don't add much to discriminate between ISOs, so we don't really need to mandate the presence of one of these. Handle empty/NULL strings in is_str_empty 2011-11-30 Christophe Fergeau <cfergeau@redhat.com> Remove useless prototype The static function it declares is defined immediatly after it. Remove unused python gobject import Nothing in examples/demo.py uses this import, and having it causes a runtime error: Traceback (most recent call last): File "examples/demo.py", line 4, in <module> from gi.repository import Libosinfo as osinfo; File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 23, in <module> from ._gi import _API, Repository ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',)) Make sure we don't set a GError twice in OSInfoLoader When parsing OSInfo XML documents, the catchXMLError callback may be called for non fatal errors. When this happens, we get a pointer to a parsed document which we can use, but we may have set a GError during the parsing if a non fatal error was logged. This means we have to make sure the error is cleared after the parsing, otherwise we may attempt to set it twice which is forbidden This can be triggered by running examples/demo.py: $ python examples/demo.py /usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Incorrect root element return info.invoke(*args, **kwargs) Traceback (most recent call last): File "examples/demo.py", line 6, in <module> loader.process_path("./") File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function return info.invoke(*args, **kwargs) gi._glib.GError: at line 18: Namespace prefix xi on include is not defined Bug report and initial fix from Guido Günther <agx@sigxcpu.org> 2011-11-28 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add more OS metadata - More metadata on Debian, *SUSE, Ubuntu and Windows. - Correct some metadata. Based on a patch from Mateusz Kaplon <mateusz.kaplon@gmail.com>. Add some information about Apple OSs Based on a patch from Mateusz Kaplon <mateusz.kaplon@gmail.com>. 2011-11-24 Christophe Fergeau <cfergeau@redhat.com> Fix setting of property default value This commit reverts 4ba6a970dd4a6ba5e8efc49bb190c059f0d5b604. For the default value of a GObject to be set upon object construction, it needs to be marked as G_PARAM_CONSTRUCT or G_PARAM_CONSTRUCT_ONLY. This commit adds this flag for the "installer" and "live" properties ("installer" defaults to TRUE and we want this to be set when the object is created). 2011-11-24 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Correct flags for most Media properties Most properties are not supposed be construct-only. Initialize Media.installer to default value Don't entertain empty ID headers from ISOs Expose Media properties as gobject properties Detection tool should set env for media ID Detection tool now prints an environment variable 'OSINFO_MEDIA' with the value of the ID of the media in the OS that was positively matched against the media in question. This implies setting of a udev property for the device by the same name. Correct pattern matching logic If both pattern and string are NULL, they should match. API to indicate media is live and/or installer Add live and installer boolean getters to Media. Add live media data for Fedora 14-16 Return matched OS media 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. Don't match non-live Fedora ISOs against live ones 2011-11-24 Daniel P. Berrange <berrange@redhat.com> Update to newer COPYING.LIB file with correct FSF address Also include libosinfo.spec in tar.gz Update RPM spec with tweaks from Fedora submission 2011-11-24 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Bump version 2011-11-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Remove contributors list from NEWS file This release is out but doing this so I don't forget the rule of not including contributors' list in next release announcement. Release 0.0.2 2011-11-21 Christophe Fergeau <cfergeau@redhat.com> Add VolumeIDs for CentOS It doesn't seem to be possible to make the difference between a 32 or 64 bit CentOS iso just by looking at its headers so the iso type guessing will need to be improved Fix CentOS 6.1 entry There were a few copy and paste typos Add VolumeIDs for 2011 Ubuntu releases Note that due to a bug in libosinfo, the detection of 11.10 won't work. The 11.10 isos don't have a system id nor a publisher id, so they end up as NULL in the parsed database, but they are a string of N consecutive space when read from the iso. This prevents the match from working. Fix <volume-id> for RHEL 5.x The VolumeID for RHEL 5.x was RHEL/5.x, it was changed to RHEL_6.x for RHEL6. I checked this with ISOs straight from RHN. Fix <volume-id> for RHEL 4.x The VolumeID for RHEL 4.x was RHEL/4-Ux, it was changed to RHEL_6.x for RHEL6. I checked this with ISOs straight from RHN. Fix <version> for RHEL 5.4 There was a typo. Add openSUSE data 2011-11-21 Daniel P. Berrange <berrange@redhat.com> Add homepage/mailing list / download links to README 2011-11-21 Christophe Fergeau <cfergeau@redhat.com> Add #include <string.h> for strcmp 2011-11-16 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Recommend 9GiB for Fedora 14-16 Test for check if tests are enabled, not gir Slightly more linient volume IDs for Fedora Add Fedora 16 OS metadata 2011-11-01 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add forgotten new classes to docs Ask gtkdoc-scan to generate the sections file This frees us from maintaining the sections file. 2011-10-26 Christophe Fergeau <cfergeau@redhat.com> Improved volume ID regex for Windows 7 2011-10-25 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> First public release Generate ChangeLog from git history on dist Stole the Makefile.am rule and gitlog-to-changelog from libvirt. Don't ignore the whole build-aux directory Add a MAINTAINERS file Update AUTHORS file 2011-10-21 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Improved README file 2011-10-20 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Consistent properties enum naming Properties for Product attributes 2011-10-18 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add API to fetch paths to kernel and initrd images 2011-10-17 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Provide paths to kernel & initrd in the install tree 2011-10-13 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Minimum/recommended resources for F14 & F15 Set UDEV properties for UDF media as well 2011-10-05 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Let there be Vala bindings! Generate Vala bindings if vapigen tool is available, unless explicitly asked not to. Correct Cflags and Libs in .pc file 2011-10-04 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Include libxml2 in gir files Fix two small introspection annotations Stop using deprecated g-ir-scanner option 2011-10-03 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Properties for Resources attributes Add setters for Resources' attributes 2011-09-26 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Constant for Kibibytes 2011-09-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Media ID strings are now regular expressions Fix 2 small mistakes in syms and docs Better udev rule installation Provide a configure option to set the udev rule directory. If this option is not set, udev directory defaults to '$prefix/lib/udev/rules.d' unless $prefix is '/usr' in which case it defaults to '/lib/udev/rules.d'. 2011-09-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add udev rules file to RPM package 2011-09-19 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Make *.ids generation optional (failable) Just because one is hacking on git repo, doesn't mean he/she always have access to Internet so download of *.ids should not fail the entire build. They are not strictly needed anyways. 2011-09-15 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Don't worry on failure to install udev rule file This can easily fail (e.g if `make install` is run unprivileged) and its not a big deal if it does. Hard-code GIBIBYTES definition GIR scanner doesn't like it and its not like this value is going to ever change anyways. Load resources metadata from XML Implement loading of OS minimum and recommended resources from XML. Minor code clean-up API to add/list resources to/from Os Add API to add/list minimum and recommended resources to/from Os. Add ResourcesList class Add special list class to hold Resources instances. Add Resources class Add a new class to represent resource requirements/recommendations for OSs. Add resource data for windows OSs Add resource requirements and recommendations data for windows OSs. 2011-09-12 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Fix typos in OsinfoMedia doc comments 2011-09-02 Daniel P. Berrange <dan@berrange.com> Allow OSINFO_DATA_DIR env var to override default location for DB Avoid referencing NULL pointer if data dir does not exist Add osinfo-detect.exe to the mingw32 RPM spec 2011-09-02 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add Udev support If enabled, provide a udev rule to listen to insertion/removal of ISO9660 media and sets some helpful (to apps) properties on the device if media is bootable. 2011-09-01 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add utility app that detects OS given a media Given a path to a ISO9660 image/device, detects if media is bootable and the relavent OS if media is an installer for it. 2011-08-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Async variant of osinfo_media_create_from_location() 'new' -> 'create' in osinfo_media_new_from_location() Renaming osinfo_media_new_from_location() to osinfo_media_create_from_location() to emphasize the factory nature of this function. Also the convention in g* world is to keep _new() as only thin wrappers around g_object_new() calls. Replace OsinfoDb.guess_os_from_location() by guess_os_from_media() Add osinfo_media_new_from_location() 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() Add API to guess OS given an installation media location. 2011-08-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Explicitly reguire Gio GIR 2011-08-04 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add media metatadata to RHEL & some Windows OSs XML Add ISO metatadata to Fedora media XML Load media metadata from XML Add API to add/list medias to/from OS Add MediaList class Add special list class to hold Media instances. Add Media class Add a new class to represent installation media, typically an CD/DVD ISO or an online filesystem hierarchy. Correct a typo in OSinfoOS doc comment 2011-07-26 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Remove '-' from Fedora OSs' short ID This is to ensure compatibility with existing OS dictionary of python-virtinst and virt-manager. 2011-07-01 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Correct node name The 'derives' element in OS XML is supposed to be 'derives-from'. Use correct param names in Product getters 2011-06-29 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add a 'class' attribute to OS This is the generic family this OS belongs to, for example Linux, Windows, Solaris, UNIX etc. 2011-06-28 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> VBox USB Tablet is an 'input' device, not 'block' 2011-06-28 Daniel P. Berrange <berrange@redhat.com> Tricks to avoid gcc set-but-not-read-vars warning 2011-06-23 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Correct 2 small spelling mistakes in docs Add osinfo_loader_process_default_path() Add a method that enables applications to load the metadata osinfo provides without having to specify any paths. Micro coding-style fixes - Remove redundant newlines. - Add newlines where needed. Add some randome OS metadata Add MS-DOS and Novell Netware metadata. 2011-06-22 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add *BSD OS metadata Add Sun Solaris OS metadata 2011-06-17 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add Windows OS metadata Correct a typo in all XML files Add generic Linux OS metadata Add Ubuntu OS metadata Add Debian OS metadata Add Mandriva OS metadata Add Suse Linux Server OS metadata 2011-06-16 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add more Fedora OS metadata Now libosinfo knows every Fedora OS known to python-virtinst. Add media information for f13 & f14 Add more RHEL OS metadata Now libosinfo knows every RHEL OS known to python-virtinst. 2011-06-09 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add basic devices to RHEL OSes 2011-06-08 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Rename RHEL OS metadata file as par latest changes Add OS metadata for supported RHEL releases Also add last supported RHEL releases to allow upgrades to supported ones. Add XML for Qemu/KVM PS2 devices Add PS2 keyboard and mouse to Qemu/KVM device DB. 2011-06-03 Zeeshan Ali (Khattak) <zeeshanak@gnome.org> Add XML for Qemu/KVM USB devices Currently, it only has one device. 2011-06-01 Daniel P. Berrange <berrange@redhat.com> Fix some API docs to make introspection work again Add some more realistic data files Start on basic metadata for Fedora/RHEL and QEMU/Xen Only load DB files with a .xml extension To ensure we skip over random files, only load things ending with a '.xml' extension 2011-06-01 Zeeshan Ali <zeeshanak@gnome.org> Strip correct C namespace Fixes build against latest GIR. 2011-04-19 Daniel P. Berrange <berrange@redhat.com> Add some scripts for converting USB/PCI ID lists to XML Add some scripts which are able to convert from the raw USB and PCI device ID lists to the osinfo XML format. Do not actually use these scripts by default though, because the osinfo loader can read the native formats *much* faster than reading the XML variant Pull down USB and PCI device IDs from sourceforge Populate the database with all USB and PCI device IDs known to the master sourceforge databases Load all files in data directory in example scripts * examples/demo.js, examples/demo.py: Load all files from data/ Allow the DB loader to process sf.net PCI/USB id lists Allow the DB loader to process the master lists of PCI and USB device IDs, as downloadable from sourceforge. Improve scalability of object list lookups Looking up a entity by ID is O(n) due to iteration over an array. This is impossibly slow with the full set of PCI and USB device IDs loaded. Add in a hashtable to provide for O(1) lookups Remove TAB characters (again) Allow arbitrary custom xml attributes with an x- prefix * data/libosinfo-dummy-data.xml: Some example custom attrs * osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Add a method for setting a parameter, rather than just adding to it * osinfo/osinfo_loader.c: Allow custom xml attrs with an 'x-' prefix * demo.js, demo.py: Update to demo new capabilities Add constants and API accessors for common parameters There are some standard parameters for products, devices and devicelinks. Add static constants and API accessors for these 2010-09-02 Daniel P. Berrange <berrange@redhat.com> Add notes about possible data sources for populating the database Add notes about the possible sources for finding device info about operating systems and hypervisor platforms * docs/data-sources.txt: Note data sources for OS and hypervisors Remove some bogus symbols to fix Win32 Win32 linker does not like linker scripts containing symbols which do not exist * osinfo/libosinfo.syms: Remove bogus symbols Introduce a OsinfoDeployment object 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 class 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' 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 Expand example programs Expand the example programs to demonstrate how to obtain the the preferred device for an operating system/hypervisor pair * examples/demo.js, examples/demo.py: Demonstrate device filtering Turn internal device link into a public object To enable arbitrary parameters to be set on the association between the device & hypervisor/os objects, turn the internal device link struct into a formal managed OsinfoEntity called OsinfoDeviceLink. * data/libosinfo-dummy-data.xml: Make 'driver' into a entity parameter instead of link text content * docs/reference/Libosinfo-docs.xml, docs/reference/Libosinfo-sections.txt: Add OsinfoDeviceLink and OsinfoDeviceLinkList objects * docs/reference/Libosinfo-sections.txt, osinfo/libosinfo.syms, osinfo/osinfo.h, osinfo/osinfo_devicelink.c, osinfo/osinfo_devicelink.h, osinfo/osinfo_devicelinklist.c, osinfo/osinfo_devicelinklist.h: Add OsinfoDeviceLink and OsinfoDeviceLinkList objects. * osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_os.c, osinfo/osinfo_os.c: Convert internal device links to use OsinfoDeviceLink object * osinfo/osinfo_loader.c: Allow setting of 'driver' attribute on device links * test/test-hypervisor.c, test/test-os.c: Update for API change 2010-09-01 Daniel P. Berrange <berrange@redhat.com> Fix VPATH build for gtk-doc gtkdoc-scan is run from the source dir, so it the path must be relative to the source dir, not using $(top_srcdir) which is relative to the build dir. * docs/reference/Makefile.am: Fix docs path Add two examples using GObject introspection Add two example programs using GObject introspection bindings for Python (PyGObject) and Javascript (GJS) * examples/demo.js: Javascript demo * examples/demo.py: Python demo * Makefile.am, configure.ac: Add examples Makefile * examples/Makefile.am: Include demos in dist * libosinfo.spec.in: Include demo programs + docs * mingw32-libosinfo.spec.in: Kill docs Ensure args can be passed to autogen.sh Ensure that autogen.sh honours args passed to it, but passing them on down to gnome-autogen.sh, enabling usage such as ./autogen.sh --enable-coverage * autogen.sh: Pass command line args down to gnome-autogen.sh Remove list iterator & add API to retrieve a GList The OsinfoList iterator method does not play nicely with gobject introspection bindings. Remove it, and replace with a method that returns a GList of elements. This trivially maps to the language bindings native list/array classes which are natively iterable. * docs/reference/Libosinfo-sections.txt: Remove osinfo_list_foreach and add osinfo_list_get_elements * osinfo/osinfo_list.c, osinfo/osinfo_list.h: Remove osinfo_list_foreach and add osinfo_list_get_elements * osinfo/osinfo_db.c: Rewrite to use g_list_foreach and fix some GList annotations to specify element type correctly. * test/test-list.c: Rewrite to use g_list_foreach Add API docs for all public methods 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. 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 Integrate gtk-doc into the build for API docs * Makefile.am: Add docs subdir * autogen.sh: Enable gtk-doc build by default * configure.ac: Add check for gtk-doc * doc/api.txt, doc/overview.txt: Remove inaccurate, outdated docs * docs/Makefile.am: Add reference/ subdir * docs/reference/: bare template for gtk-doc content 2010-08-31 Daniel P. Berrange <berrange@redhat.com> Add emacs magic for indentation rules 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 OsinfoDb 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 2010-08-27 Daniel P. Berrange <berrange@redhat.com> Ensure all GList return values are duplicated To avoid exposing callers to the internal implementation, ensure all returned GList * values are shallow-copied. All callers must g_list_free the value. The elements are not copied. * osinfo/osinfo_db.c, osinfo/osinfo_db.c, osinfo/osinfo_filter.c, osinfo/osinfo_osfilter.c: Copy all GList return values. * test/test-entity.c, test/test-filter.c, test/test-osfilter.c: Free GList values Enable test suite during automated & RPM builds * autobuild.sh: Enable tests * configure.ac: Allow tests to be disabled for Win32 * libosinfo.spec.in: Enable tests * libosinfo.spec.in: Disable tests * test/test-loader.c, test/Makefile.am: Fix VPATH build Ignore more test programs Convert loader to use GIO Direct use of POSIX/stdc I/O is deprecated in favour of the GIO system. Re-write the OsinfoLoader to use GIO for loading XML from arbitrary paths/uris. * configure.ac: Check for GIO library * osinfo/Makefile.am: Link to GIO * osinfo/osinfo_loader.c, osinfo/osinfo_loader.h: Port to GIO * test/osinfo.suppression: Supress many GIO data types * test/test-loader.c: update for new GIO api. Pull XML loader into a separate class 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 Make OsinfoList typecheck the elements for compatibility To avoid have an OsinfoList with a mixture of hypervisor, os and device objects, associate an explicit type with each list. The list will validate the data type matches whenever adding elements to the list, or producing new lists via union/intersect/filter operations. * osinfo/osinfo_list.c, osinfo/osinfo_list.h: Add an element-type property * osinfo/osinfo_devicelist.c, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_oslist.c: Set the element-type when creating a new list Lots of code fixes based on results from testsuite 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 Comprehensive test suite This adds a comprehensive test suite. Each test case fulls covers a single class. Combined, they provide 100% function and 99% line coverage. All important code branches are also covered. * Makefile.am: Target to generate code coverage reports * osinfo/Makefile.am: Add code coverage flags * configure.ac: Enable use of 'check' for test suite and use of gcc coverage flags * test/test-*.c: One test suite per class * test/test-skeleton.c: Remove obsoleted test * test/osinfo.suppression: supress valgrind warning for static data in glib type system * test/Makefile.am: Link tests against libcheck library 2010-08-26 Daniel P. Berrange <berrange@redhat.com> Add missing AC_ARG_ENABLE declaration The configure.ac script was missing the AC_ARG_ENABLE declaration for the gobject introspection code * configure.ac: Add AC_ARG_ENABLE 2010-08-25 Daniel P. Berrange <berrange@redhat.com> Add LGPLv2+ header to all source files * 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 formal RPM build infrastructure * autogen.sh: Rewrite to use gnome-autogen.sh * autobuild.sh: Automated RPM build control script * configure.ac: Generate RPM specfiles * Makefile.am: Distribute RPM specfile templates * libosinfo.spec.in, mingw32-libosinfo.spec.in: RPM specs * osinfo/Makefile.am, osinfo/libosinfo.syms: Fix Win32 portability problem Fix Win32 portability problem in XML reader stpcpy is a non-standard extension and can be replaced with g_strdup_printf resulting in much clearer code. The d_type entry doesn't exist in readdir() for most platforms. * osinfo/osinfo_dataread.c: Fix Win32 portability Add support for GObject introspection 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 Add a pkg-config data file for building apps * configure.ac: Generate libosinfo.pc * osinfo/Makefile.am: Install pkg-config file * osinfo/libosinfo-1.0.pc.in: Master pkg-config template Use pkg-config for checking for libxml Rather than creating huge amounts of m4 logic, just use pkg-config to check for libxml2 library. Make libxml2 compulsory * configure.ac: Simplify libxml2 check Add proper ELF versioning Rename library to libosinfo-1.0.la to allow parallel install if we need to break ABI in the future. Add per-symbol version tagging to allow fine grained automatic RPM dependancies. Make version script portable to Win32 * configure.ac: Detect args for linker symbol file / format * osinfo/Makefile.am: Rename library and use symbol versioning * osinfo/libosinfo.syms: Symbol version script Run configure at end of autogen.sh It is usual practice to run configure at the end of autogen.sh to save having to manually run it afterwards * autogen.sh: Run configure Pull OS relationship filtering into a subclass The base filter object should only be concerned with filtering OsinfoEntity objects. Filtering OsinfoOs objects should be done by a sub-class. * osinfo/osinfo_filter.c, osinfo/osinfo_filter.h: Remove OS relationship filtering * osinfo/osinfo_osfilter.c, osinfo/osinfo_osfilter.h: New object to handle OS relationship filtering * osinfo/osinfo_entity.h, osinfo/osinfo_hypervisor.h, osinfo/osinfo_os.h: Tweak some typedefs to santize build ordering constraints * osinfo/osinfo.h: Re-arrange include ordering to match declaration usage Move filter matching code out of entity into filter object To eliminate a circular dependency, move the filter matching code out of the OsinfoEntity object and into OsinfoFilter object. * osinfo/osinfo_entity.c, osinfo/osinfo_entity.h, osinfo/osinfo_filter.c, osinfo/osinfo_filter.h, osinfo/osinfo_hypervisor.c, osinfo/osinfo_list.c, osinfo/osinfo_os.c: Move filter matching code into the OsinfoFilter object APIs Fix filter class/object inheritance & add constructor The OsinfoFilter structs mistakenly included the OsinfoEntity structs, even though the type inherits direct from GObject. * osinfo/osinfo_filter.c, osinfo/osinfo_filter.h: Fix struct parent, and add an explicit constructor Remove osinfo common module 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. Convert filter constraints from GTree to GHashTable Simply code and follow more normal GLib practice by using a GHashTable of GLists for filter property storage, instead of a GTree of GPtrArrays * osinfo/osinfo_filter.c, osinfo/osinfo_filter.h: Convert to use a GHashTable of GLists for filter properties * osinfo/osinfo_common.c, osinfo/osinfo_common.h: Remove unused int/string comparators * osinfo/osinfo_dataread.c: Remove unused variable Remove all remaining Hypervisor/Os structs out of common code Make OsinfoOsPrivate, OsinfoHypervisorPrivate structs private to their respective objects, and update all code which poked at private data to use formal APIs * osinfo/osinfo_common.h, osinfo/osinfo_common.c: Remove the OsinfoOsPrivate, OsinfoHypervisorPrivate structs and related helper methods * osinfo/osinfo_os.c: Add OsinfoOsPrivate struct & helper methods * osinfo/osinfo_hypervisor.c: Add OsinfoHypervisorPrivate struct & helper methods. * osinfo/osinfo_db.c, osinfo/osinfo_entity.c, osinfo/osinfo_filter.c: Convert to use APIs instead of accessing private data of OS/Hypervisor objects. Make entity object fully private Make the OsinfoEntityPrivate struct fully private to the OsinfoEntity object. * osinfo/osinfo_common.h: Remove OsinfoEntityPrivate * osinfo/osinfo_entity.c: Add OsinfoEntityPrivate * osinfo/osinfo_list.c: Use API instead of direct access to private data of OsinfoEntity objects Convert entity property data into a GHashTable of GLists Simply code and follow more normal GLib practice by using a GHashTable of GLists for entity property storage, instead of a GTree of GPtrArrays * osinfo/osinfo_common.h, osinfo/osinfo_dataread.c, osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Convert to use a GHashTable of GLists for properties Turn OS relationships into a GList structure Simplify storage of OS relationships by using a single GList instead of a pair of GTree objects. The data access patterns mean there is no change in access efficiency * osinfo/osinfo_common.h, osinfo/osinfo_dataread.c, osinfo/osinfo_db.c, osinfo/osinfo_entity.c, osinfo/osinfo_os.c, osinfo/osinfo_os.h: Replace GTree with GList for OS relationships. Remove sections from OS device list Arranging devices in sections against operating systems duplicates information already available via the 'class' attribute on the device object. Removing this unneccessary data simplifies the code, allowing a pair of GTree maps to be replaced by a single GList. * data/libosinfo-dummy-data.xml: Remove os sections * osinfo/osinfo_common.h, osinfo/osinfo_dataread.c, osinfo/osinfo_os.c, osinfo/osinfo_os.h: Model hypervisor devices in a GList instead of pair of GTrees * osinfo/osinfo_device.c, osinfo/osinfo_device.h, osinfo/osinfo_hypervisor.c: Update for API changes Remove sections from hypervisor device list Arranging devices in sections against hypervisors duplicates information already available via the 'class' attribute on the device object. Removing this unneccessary data simplifies the code, allowing a pair of GTree maps to be replaced by a single GList. * data/libosinfo-dummy-data.xml: Remove hypervisor sections * osinfo/osinfo_common.h, osinfo/osinfo_dataread.c, osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h: Model hypervisor devices in a GList instead of pair of GTrees Pass a GError all the way through the XML parser 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 Convert OS hypervisor sections from GTree to GHashTable Remove another GTree data structure in favour of GHashTable for simpler, more efficient code * osinfo/osinfo_common.h: Change OsinfoOsPrivate struct to use a GHashTable * osinfo/osinfo_common.c, osinfo/osinfo_dataread.c, osinfo/osinfo_device.c, osinfo/osinfo_os.c: Update to use hash table APIs Remove 2 unused struct definitions The __osinfoPopulateListArgs and __osinfoFilterPassArgs structs are not used anymore. * osinfo/osinfo_common.h: Remove unused structs Remove unused FREE_N macro The FREE_N macro is not used anywhere * osinfo/osinfo_common.h: Remove FREE_N Fix reference count handling in device list When adding an OsinfoEntity to an OsinfoList, an explicit reference should be taken on the entity, rather than relying on the caller to have done it. * osinfo/osinfo_list.c: Take an extra reference when adding an entity to the list * osinfo/osinfo_dataread.c: Release a reference after adding an entity to the list Turn filter matching functions into formal APIs Instead of having the osinfo_common.c module poking into the private parts of OsinfoFilter and OsinfoEntity objects, move the code into OsinfoEntity and use formal APIs for all data access * osinfo/osinfo_filter.c, osinfo/osinfo_filter.h, osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Add API for matching entities against filters * osinfo/osinfo_common.c, osinfo/osinfo_common.h: Remove all entity filtering code. * osinfo/osinfo_device.c, osinfo/osinfo_hypervisor.c, osinfo/osinfo_list.c, osinfo/osinfo_os.c: Update to use formal entity filtering APIs Replace some temporary GTree objects with GHashTable 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 Remove unused error strings Since most of the GError code was remove, the method __osinfoErrorToString is now unused, as are all the error strings. Remove them all * osinfo/osinfo_common.c, osinfo/osinfo_common.h: Remove __osinfoErrorToString and all strings Make device object struct fully private Classes should not expose their private bits to each other. Make the OsinfoDevice private struct truely private. * osinfo/osinfo_common.h: Remove OsinfoDevicePrivate * osinfo/osinfo_device.c: Add OsinfoDevicePrivate * osinfo/osinfo_devicelist.c, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_oslist.c: Change 'int tmp' to 'gboolean unsed' Make osinfo DB struct private & change to use a OsinfoList internally 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 object 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 'db' property from entity object to avoid circular reference The OsinfoDb object holds a reference to every OsinfoEntity. If the OsinfoEntity also holds a back-reference to OsinfoDb then no memory will ever be freed. The back-reference is not used in the code, so just remove it * osinfo/osinfo_common.h, osinfo/osinfo_dataread.c, osinfo/osinfo_entity.c: Remove back-reference to the OsinfoDb object from OsinfoEntity Remove GError from most APIs 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 Remove unused error variables from more iterators The iterators used in the OsinfoDb class pass around an GError object but none of the codepaths can ever fail, since all the ENOMEM code was remove. The GError variable is thus redundant * osinfo/osinfo_common.h, osinfo/osinfo_db.c: Remove GError from the iterators Remove many duplicate methods from device, hv & os list classes The OsinfoDeviceList, OsinfoHypervisorList and OsinfoOsList classes don't need to provide accessors for list elements, since those are all available via the superclass OsinfoList. Re-work list intersection, union & filter APIs so that they add to the current list. Add constructors that allow creation of new lists with intersections, unions and filtering. * osinfo/osinfo_devicelist.c, osinfo/osinfo_devicelist.h, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_oslist.c, osinfo/osinfo_oslist.h: Remove all list element accessors * osinfo/osinfo_list.c, osinfo/osinfo_list.h: Add constructors for union, filter & intersection operations. Remove unused error variable from db populate list iterator The GError object passed around when getting lists of OS, or Hypervisor objects from the DB, is never actually set, nor can failure ever occur in any of the codepaths. Since it is unused, it can be removed completely. * osinfo/osinfo_common.h: Remove errcode & err from struct __osinfoPopulateListArgs. * osinfo/osinfo_db.c: Don't pass around GError object when populating entity lists Make osinfo_list_add into a public API Make osinfo_list_add a public API on OsinfoList since apps should be allowed to manipulate objects at will if they're not using the XML loader. This also avoids compile warnings from other objects using this API without it being declared * osinfo/osinfo_list.h, osinfo/osinfo_list.c: Make osinfo_list_add a public API * osinfo/osinfo_db.c, osinfo/osinfo_filter.c, osinfo/osinfo_hypervisor.c, osinfo/osinfo_os.c: Update for changing API name Remove all bad signed/unsigned casts in XML handling libxml2 strings are all 'unsigned char*' but C world normally uses 'char *', or 'gchar *' in GLib. Add appropriate casts and change variable types to avoid compiler warnings about implicit signed/unsigned casts. * osinfo/osinfo_dataread.c: Fix compile warnings about signed/unsigned string casts Remove more malloc failure checks GLib will always abort() upon malloc failure, so there is no need to check return value of any g_object_new, g_new or g_strdup API call. Remove all this redundant ENOMEM checking * osinfo/osinfo_common.c, osinfo/osinfo_dataread.c, osinfo/osinfo_db.c, osinfo/osinfo_devicelist.c, osinfo/osinfo_entity.c, osinfo/osinfo_filter.c, osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_list.c, osinfo/osinfo_os.c, osinfo/osinfo_oslist.c: Remove all ENOMEM checks Sanitize naming of filter object 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/osinfo_filter.c, osinfo/osinfo_filter.h: Convert API naming to use lowercase + underscores. Add an explicit constructor. Sanitize naming of all list object 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/osinfo_devicelist.c, osinfo/osinfo_devicelist.h, osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h, osinfo/osinfo_list.c, osinfo/osinfo_list.h: Convert API naming to use lowercase + underscores. Add explicit constructors. * osinfo/osinfo_db.c, osinfo/osinfo_filter.c, osinfo/osinfo_hypervisor.c, osinfo/osinfo_os.c: Update for changing API naming Santize naming of device, hypervisor and os object 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/osinfo_device.c, osinfo/osinfo_device.h, osinfo/osinfo_hypervisor.c, osinfo/osinfo_hypervisor.h, osinfo/osinfo_os.c, osinfo/osinfo_os.h: Convert API naming to use lowercase + underscores. Add explicit constructors. Sanitize API naming for OsinfoEntity class The GObject naming conversion is lowercase, separated by underscores. This needs to be followed to allow gobject introspection to be auto-generated easily. * osinfo/osinfo_common.h: Remove declaration of methods that belong in osinfo_entity.h * osinfo/osinfo_entity.c, osinfo/osinfo_entity.h: Convert API naming to use lowercase + underscores. Add an explicit constructor. * osinfo/osinfo_filter.c, osinfo/osinfo_hypervisor.c: Update for changed API names Sanitize API naming for OsinfoDb class 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 Remove all redundant malloc failure checks GLib will always abort() upon malloc failure, so there is no need to check return value of any g_object_new, g_new or g_strdup API call. Remove all this redundant ENOMEM checking * osinfo/osinfo_common.c, osinfo/osinfo_db.c, osinfo/osinfo_device.c, osinfo/osinfo_entity.c, osinfo/osinfo_filter.c, osinfo/osinfo_os.c: Remove all ENOMEM checking Add decl for all _get_type() methods & enable warnings 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 Makefile.am into each sub-dir Move Makefile.am into each sub-dir so that built objects end up in the same directory as the sources, instead of polluting the top level. This will also enable the gobject introspection makefile rules to be imported later * .gitignore: test-skeleton & test-skeleton.sh * Makefile.am: Remove all build rules, add SUBDIRS * osinfo/Makefile.am: Add build rules for library * test/Makefile.am: Add build rules for tests * test/test-skeleton.c: Update to reflect changed current directory during test execution Move all source & headers into osinfo/ directory 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 2010-07-01 Arjun Roy <arroy@redhat.com> Moved over API to use glib/gobject. API definitions have changed, though functionality remains identical. Added new features to list classes. TODO: Extensive testing. Codebase compiles and simplest test of creating/destroying DB works, but more is required. 2010-02-03 Arjun Roy <arroy@redhat.com> Added autogen.sh 2010-02-03 Jim Meyering <meyering@redhat.com> avoid legitimate gcc used-before-set warning * test/test-filter.c (main): Initialize filter buffer before trying to free it. fix used-uninitialized bugs * src/osi_device.c (dev_property_all_values): Initialize "kv" to NULL to avoid using it uninitialized when there is no match. * src/osi_hv.c (osi_get_hv_property_all_values): Likewise. * src/osi_os.c (os_property_all_values): Likewise. * src/osi_hv.c (osi_get_hv_property_first_value): Likewise. * src/osi_os.c (osi_get_os_property_first_value): Likewise. * src/osi_device.c (osi_get_device_property_value): Likewise. include <string.h> for decl of strcmp, in test programs remove more declarations of unused variables avoid FP unused "osname" warning * test/sample.c (main): Print "osname", so that variable does not appear to be unused. tests: fix test-filter failure * test/test-filter.c (main): Don't reference "filter" after freeing it: remove the failing assertion. fix failing tests remove decls of unused variables avoid gcc warnings * src/osi_os.c: Avoid warnings: declaration of 'index' shadows a global declaration: s/index/idx/ unused variable 'cursor' unused variable 'i' * src/osi_device.c (osi_get_device_by_index): s/index/idx/ libraries must not call chdir; avoid getcwd, too * src/osi_dataread.c: Include <stdlib.h>. (osi_initialize_data): Don't call chdir. Use ".", rather than getcwd. Add a directory name parameter. Construct the dir-relative file name we'll read from. Adjust sole caller. autoconfiscate * Makefile.am: New file. * configure.ac: New file. * Makefile: Remove. * .gitignore: List ignorable files. 2010-01-28 Arjun Roy <arroy@redhat.com> Updated README. TODO: 1. Update docs 2. Better error handling and messages for reading XML data 3. More unit tests and more automation for unit tests. 2010-01-26 Arjun Roy <arroy@redhat.com> Changed tests to accept data dir as a command line parameter. Initial working codebase. 2009-11-09 Arjun Roy <arroy@redhat.com> Added a few unit tests to the API for initializing/closing the library and setting hypervisors. No implementation yet. Added dummy data for testing purposes. 2009-11-06 Arjun Roy <arroy@redhat.com> Initial commit with API definition, overview, and sample program. No implementation at all yet.