summaryrefslogtreecommitdiffstats
path: root/inspector
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-03-23 16:00:48 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-03-23 16:00:48 +0000
commit3f1e3223c491aa057d02c1da418ed896d09fff7c (patch)
tree7859c338e4264acaa5656adc2ab67156de794c51 /inspector
parent0daf7e81a659bcdc1ce327151cc1207b124a35a1 (diff)
downloadlibguestfs-3f1e3223c491aa057d02c1da418ed896d09fff7c.tar.gz
libguestfs-3f1e3223c491aa057d02c1da418ed896d09fff7c.tar.xz
libguestfs-3f1e3223c491aa057d02c1da418ed896d09fff7c.zip
New API: guestfs_inspect_get_product_variant
This returns a product variant for inspected operating systems. In practice this is a useful way to distinguish between consumer and enterprise/server versions of Windows that otherwise have the same version number.
Notes
Notes: Labels: feature
Diffstat (limited to 'inspector')
-rw-r--r--inspector/example-windows.xml2
-rw-r--r--inspector/virt-inspector.c9
-rwxr-xr-xinspector/virt-inspector.pod3
-rw-r--r--inspector/virt-inspector.rng1
4 files changed, 13 insertions, 2 deletions
diff --git a/inspector/example-windows.xml b/inspector/example-windows.xml
index 346b2ed2..12c69560 100644
--- a/inspector/example-windows.xml
+++ b/inspector/example-windows.xml
@@ -6,9 +6,11 @@
<arch>i386</arch>
<distro>windows</distro>
<product_name>Microsoft Windows 7 Phony Edition</product_name>
+ <product_variant>Client</product_variant>
<major_version>6</major_version>
<minor_version>1</minor_version>
<windows_systemroot>/Windows</windows_systemroot>
+ <format>installed</format>
<mountpoints>
<mountpoint dev="/dev/sda2">/</mountpoint>
</mountpoints>
diff --git a/inspector/virt-inspector.c b/inspector/virt-inspector.c
index e7db5b9b..4d8e3adc 100644
--- a/inspector/virt-inspector.c
+++ b/inspector/virt-inspector.c
@@ -1,5 +1,5 @@
/* virt-inspector
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -373,6 +373,13 @@ output_root (xmlTextWriterPtr xo, char *root)
xmlTextWriterWriteElement (xo, BAD_CAST "product_name", BAD_CAST str));
free (str);
+ str = guestfs_inspect_get_product_variant (g, root);
+ if (!str) exit (EXIT_FAILURE);
+ if (STRNEQ (str, "unknown"))
+ XMLERROR (-1,
+ xmlTextWriterWriteElement (xo, BAD_CAST "product_variant", BAD_CAST str));
+ free (str);
+
i = guestfs_inspect_get_major_version (g, root);
snprintf (buf, sizeof buf, "%d", i);
XMLERROR (-1,
diff --git a/inspector/virt-inspector.pod b/inspector/virt-inspector.pod
index cd0e6175..26c61263 100755
--- a/inspector/virt-inspector.pod
+++ b/inspector/virt-inspector.pod
@@ -165,6 +165,7 @@ describe the operating system, its architecture, the descriptive
<arch>i386</arch>
<distro>windows</distro>
<product_name>Windows 7 Enterprise</product_name>
+ <product_variant>Client</product_variant>
<major_version>6</major_version>
<minor_version>1</minor_version>
<windows_systemroot>/Windows</windows_systemroot>
@@ -317,7 +318,7 @@ Matthew Booth L<mbooth@redhat.com>
=head1 COPYRIGHT
-Copyright (C) 2010 Red Hat Inc.
+Copyright (C) 2010-2011 Red Hat Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/inspector/virt-inspector.rng b/inspector/virt-inspector.rng
index 973bc3cc..8d54facd 100644
--- a/inspector/virt-inspector.rng
+++ b/inspector/virt-inspector.rng
@@ -33,6 +33,7 @@
<optional><element name="arch"><text/></element></optional>
<optional><element name="distro"><text/></element></optional>
<optional><element name="product_name"><text/></element></optional>
+ <optional><element name="product_variant"><text/></element></optional>
<element name="major_version"><text/></element>
<element name="minor_version"><text/></element>
<optional><element name="windows_systemroot"><text/></element></optional>