[Libosinfo] [PATCH 1/3] Add an optional 'snapshot' tag to OS entries
Daniel P. Berrange
berrange at redhat.com
Mon Oct 7 16:13:30 UTC 2013
On Fri, Oct 04, 2013 at 01:02:39AM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
>
> Applications can use this to determine if an OS is just a snapshot and
> not an actual released product yet. For example, gnome-continuous images
> for development snapshots of GNOME and pre-release and nightly build ISOs
> of Fedora etc.
> ---
> data/schemas/libosinfo.rng | 5 +++++
> osinfo/libosinfo.syms | 1 +
> osinfo/osinfo_loader.c | 1 +
> osinfo/osinfo_os.c | 18 ++++++++++++++++++
> osinfo/osinfo_os.h | 6 ++++--
> 5 files changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
> index 735ced0..1e572e2 100644
> --- a/data/schemas/libosinfo.rng
> +++ b/data/schemas/libosinfo.rng
> @@ -481,6 +481,11 @@
> <optional>
> <ref name='devices-rel'/>
> </optional>
> + <optional>
> + <element name='is-snapshot'>
> + <ref name='bool'/>
> + </element>
Urgh, this 'bool' data type is insanity as a way to model
bools in XML.
Rather than
<is-snapshot>true</is-snapshot>
it should be just
<is-snapshot/>
The non-existance of the element represents 'false'.
Sadly we can't kill it off from existing schema usage, but
we could deprecate it and make things look for the existance
of the element + back compat code for old docs.
> diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
> index ccd7c30..0537c58 100644
> --- a/osinfo/libosinfo.syms
> +++ b/osinfo/libosinfo.syms
> @@ -117,6 +117,7 @@ LIBOSINFO_0.0.1 {
> osinfo_os_add_device;
> osinfo_os_get_family;
> osinfo_os_get_distro;
> + osinfo_os_get_is_snapshot;
> osinfo_os_get_media_list;
> osinfo_os_add_media;
> osinfo_os_get_tree_list;
This should be added under a new version block. You should never add to
existing blocks once released.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the Libosinfo
mailing list