[PATCH 3/4] Automatically generate the hvsupport.html.in file from source files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The hvsupport.html.in file is forever out of date. By annotating
the driver struct tables in each driver with version information,
we can auto-generate the hvsupport.html.in file. Annotating the
drivers will be mandatory for new patches, ensuring hvsupport.html.in
is never out of date again.

* docs/hvsupport.html.in: Delete
* hvsupport.pl: Script to generate hvsupport.html.in
* Makefile.am: Autogenerate hvsupport.html.in
---
 docs/Makefile.am       |   10 +-
 docs/hvsupport.html.in |  801 ------------------------------------------------
 docs/hvsupport.pl      |  353 +++++++++++++++++++++
 3 files changed, 360 insertions(+), 804 deletions(-)
 delete mode 100644 docs/hvsupport.html.in
 create mode 100644 docs/hvsupport.pl

diff --git a/docs/Makefile.am b/docs/Makefile.am
index db4bc59..12b3fcd 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -60,7 +60,7 @@ gif = \
   architecture.gif \
   node.gif
 
-dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in \
+dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in hvsupport.html.in \
       $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
 dot_html = $(dot_html_in:%.html.in=%.html)
 
@@ -86,7 +86,7 @@ EXTRA_DIST=					\
   $(xml) $(fig) $(png) $(css) \
   $(patches) \
   sitemap.html.in \
-  todo.pl todo.cfg-example
+  todo.pl hvsupport.pl todo.cfg-example
 
 MAINTAINERCLEANFILES = \
   $(addprefix $(srcdir)/,$(dot_html)) \
@@ -113,6 +113,10 @@ todo:
 	rm -f todo.html.in
 	$(MAKE) todo.html
 
+hvsupport.html.in: hvsupport.pl $(srcdir)/../src/libvirt_public.syms \
+	 $(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/driver.h
+	$(AM_V_GEN)$(PERL) $(srcdir)/$< $(srcdir)/../src > $@ || { rm $@ && exit 1; }
+
 .PHONY: todo
 
 %.png: %.fig
@@ -183,7 +187,7 @@ clean-local:
 	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
 
 maintainer-clean-local: clean-local
-	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in
+	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
 
 rebuild: api all
 
diff --git a/docs/hvsupport.html.in b/docs/hvsupport.html.in
deleted file mode 100644
index 4cc2634..0000000
--- a/docs/hvsupport.html.in
+++ /dev/null
@@ -1,801 +0,0 @@
-<?xml version="1.0"?>
-<html>
-  <body>
-    <h1>Driver support matrix</h1>
-    <p>
-This page documents which <a href="html/">libvirt calls</a> work on
-which libvirt drivers / hypervisors, and which version the API appeared
-in.
-</p>
-    <p>
-This information changes frequently.  This page was last checked or
-updated on <i>2008-06-05</i>.
-</p>
-    <h3>Domain functions</h3>
-    <p> x = not supported; empty cell means no information </p>
-    <table class="top_table">
-      <tr>
-        <th> Function </th>
-        <th> Since </th>
-        <th><a href="drvxen.html">Xen</a></th>
-        <th><a href="drvqemu.html">QEMU</a></th>
-        <th><a href="drvkvm.html">KVM</a></th>
-        <th><a href="remote.html">Remote</a></th>
-        <th><a href="drvvbox.html">VirtualBox</a></th>
-        <th><a href="drvone.html">ONE</a></th>
-        <th><a href="drvesx.html">ESX</a></th>
-      </tr>
-      <tr>
-        <td> virConnectClose </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectGetCapabilities </td>
-        <td> 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.1 </td>
-      </tr>
-      <tr>
-        <td> virConnectGetHostname </td>
-        <td> 0.3.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.3.3 </td>
-        <td> &#x2265; 0.3.3 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectGetMaxVcpus </td>
-        <td> 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virConnectGetType </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectGetURI </td>
-        <td> 0.3.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectGetVersion </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectListDefinedDomains </td>
-        <td> 0.1.5 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectListDomains </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectNumOfDefinedDomains </td>
-        <td> 0.1.5 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectNumOfDomains </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectOpen </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virConnectOpenAuth </td>
-        <td>  </td>
-        <td>  </td>
-        <td>  </td>
-        <td>  </td>
-        <td>  </td>
-        <td>  </td>
-        <td>  </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectOpenReadOnly </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainAttachDevice </td>
-        <td> 0.1.9 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainBlockPeek </td>
-        <td> 0.4.3 </td>
-        <td> 0.4.3 </td>
-        <td> 0.4.3 </td>
-        <td> 0.4.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainBlockStats </td>
-        <td> 0.3.2 </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainCoreDump </td>
-        <td> 0.1.9 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainCreate </td>
-        <td> 0.1.5 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainCreateLinux </td>
-        <td> All </td>
-        <td> &#x2265; 0.0.5 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainDefineXML </td>
-        <td> 0.1.5 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.2 </td>
-      </tr>
-      <tr>
-        <td> virDomainDestroy </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainDetachDevice </td>
-        <td> 0.1.9 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainFree </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetAutostart </td>
-        <td> 0.2.1 </td>
-        <td> x </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainGetConnect </td>
-        <td> 0.3.0 </td>
-        <td colspan="7"> not a HV function </td>
-      </tr>
-      <tr>
-        <td> virDomainGetID </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetInfo </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetMaxMemory </td>
-        <td> All </td>
-        <td> All </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetMaxVcpus </td>
-        <td> 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetName </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetOSType </td>
-        <td> All </td>
-        <td> All </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetSchedulerParameters </td>
-        <td> 0.2.3 </td>
-        <td> &#x2265; 0.2.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetSchedulerType </td>
-        <td> 0.2.3 </td>
-        <td> &#x2265; 0.2.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetUUID </td>
-        <td> 0.1.10 </td>
-        <td> &#x2265; 0.1.10 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetUUIDString </td>
-        <td> 0.1.10 </td>
-        <td> &#x2265; 0.1.10 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainGetVcpus </td>
-        <td> 0.1.4 </td>
-        <td> &#x2265; 0.1.4 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainInterfaceStats </td>
-        <td> 0.3.2 </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainGetXMLDesc </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainLookupByID </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainLookupByName </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainLookupByUUID </td>
-        <td> 0.1.10 </td>
-        <td> &#x2265; 0.1.10 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainLookupByUUIDString </td>
-        <td> 0.1.10 </td>
-        <td> &#x2265; 0.1.10 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainMigrate </td>
-        <td> 0.3.2 </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> 0.3.2 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainPinVcpu </td>
-        <td> 0.1.4 </td>
-        <td> &#x2265; 0.1.4 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainReboot </td>
-        <td> 0.1.0 </td>
-        <td> &#x2265; 0.1.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainRestore </td>
-        <td> All </td>
-        <td> All </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainResume </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainSave </td>
-        <td> All </td>
-        <td> All </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.2 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainSetAutostart </td>
-        <td> 0.2.1 </td>
-        <td> x </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.2.1 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virDomainSetMaxMemory </td>
-        <td> All </td>
-        <td> All </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainSetMemory </td>
-        <td> 0.1.1 </td>
-        <td> &#x2265; 0.1.1 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainSetSchedulerParameters </td>
-        <td> 0.2.3 </td>
-        <td> &#x2265; 0.2.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainSetVcpus </td>
-        <td> 0.1.4 </td>
-        <td> &#x2265; 0.1.4 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainShutdown </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainSuspend </td>
-        <td> All </td>
-        <td> All </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virDomainUndefine </td>
-        <td> 0.1.5 </td>
-        <td> &#x2265; 0.1.9 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> &#x2265; 0.6.4 </td>
-        <td> &#x2265; 0.7.1 </td>
-      </tr>
-      <tr>
-        <td> virGetVersion </td>
-        <td> All </td>
-        <td> All </td>
-        <td colspan="6"> Returns -1 if HV unsupported. </td>
-      </tr>
-      <tr>
-        <td> virInitialize </td>
-        <td> 0.1.0 </td>
-        <td colspan="7"> not a HV function </td>
-      </tr>
-      <tr>
-        <td> virDomainMemoryPeek </td>
-        <td> 0.4.3 </td>
-        <td> x </td>
-        <td> 0.4.3 </td>
-        <td> 0.4.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-      <tr>
-        <td> virNodeGetInfo </td>
-        <td> 0.1.0 </td>
-        <td> &#x2265; 0.1.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.2.0 </td>
-        <td> &#x2265; 0.3.0 </td>
-        <td> &#x2265; 0.6.3 </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.0 </td>
-      </tr>
-      <tr>
-        <td> virNodeGetFreeMemory </td>
-        <td> 0.3.3 </td>
-        <td> &#x2265; 0.3.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> &#x2265; 0.7.2 </td>
-      </tr>
-      <tr>
-        <td> virNodeGetCellsFreeMemory </td>
-        <td> 0.3.3 </td>
-        <td> &#x2265; 0.3.3 </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-        <td> x </td>
-      </tr>
-    </table>
-    <h3>Network functions</h3>
-    <p>
-Network functions are not hypervisor-specific.They require the libvirtd
-daemon to be running. Most network functions first appeared in libvirt 0.2.0.
-</p>
-    <table class="top_table">
-      <tr>
-        <th> Function </th>
-        <th> Since </th>
-      </tr>
-      <tr>
-        <td> virConnectNumOfNetworks </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectListNetworks </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectNumOfDefinedNetworks </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virConnectListDefinedNetworks </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkCreate </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkCreateXML </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkDefineXML </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkDestroy </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkFree </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetAutostart </td>
-        <td> 0.2.1 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetConnect </td>
-        <td> 0.3.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetBridgeName </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetName </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetUUID </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetUUIDString </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkGetXMLDesc </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkLookupByName </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkLookupByUUID </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkLookupByUUIDString </td>
-        <td> 0.2.0 </td>
-      </tr>
-      <tr>
-        <td> virNetworkSetAutostart </td>
-        <td> 0.2.1 </td>
-      </tr>
-      <tr>
-        <td> virNetworkUndefine </td>
-        <td> 0.2.0 </td>
-      </tr>
-    </table>
-  </body>
-</html>
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
new file mode 100644
index 0000000..5cfb824
--- /dev/null
+++ b/docs/hvsupport.pl
@@ -0,0 +1,353 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find;
+
+die "syntax: $0 SRCDIR\n" unless int(@ARGV) == 1;
+
+my $srcdir = shift @ARGV;
+
+my $symslibvirt = "$srcdir/libvirt_public.syms";
+my $symsqemu = "$srcdir/libvirt_qemu.syms";
+my $drivertable = "$srcdir/driver.h";
+
+my %groupheaders = (
+    "virDriver" => "Hypervisor APIs",
+    "virNetworkDriver" => "Virtual Network APIs",
+    "virInterfaceDriver" => "Host Interface APIs",
+    "virDeviceMonitor" => "Host Device APIs",
+    "virStorageDriver" => "Storage Pool APIs",
+    "virSecretDriver" => "Secret APIs",
+    "virNWFilterDriver" => "Network Filter APIs",
+    );
+
+
+my @srcs;
+find({
+    wanted => sub {
+	if (m!$srcdir/.*/\w+_(driver|tmpl)\.c$!) {
+	    push @srcs, $_ if $_ !~ /vbox_driver\.c/;
+	}
+    }, no_chdir => 1}, $srcdir);
+my $line;
+
+# Get the list of all public APIs and their corresponding version
+
+my %apis;
+open FILE, "<$symslibvirt"
+    or die "cannot read $symslibvirt: $!";
+
+my $vers;
+my $prevvers;
+while (defined($line = <FILE>)) {
+    chomp $line;
+    next if $line =~ /^\s*#/;
+    next if $line =~ /^\s*$/;
+    next if $line =~ /^\s*(global|local):/;
+    if ($line =~ /^\s*LIBVIRT_(\d+\.\d+\.\d+)\s*{\s*$/) {
+	if (defined $vers) {
+	    die "malformed syms file";
+	}
+	$vers = $1;
+    } elsif ($line =~ /\s*}\s*;\s*$/) {
+	if (defined $prevvers) {
+	    die "malformed syms file";
+	}
+	$prevvers = $vers;
+	$vers = undef;
+    } elsif ($line =~ /\s*}\s*LIBVIRT_(\d+\.\d+\.\d+)\s*;\s*$/) {
+	if ($1 ne $prevvers) {
+	    die "malformed syms file $1 != $vers";
+	}
+	$prevvers = $vers;
+	$vers = undef;
+    } elsif ($line =~ /\s*(\w+)\s*;\s*$/) {
+	$apis{$1} = $vers;
+    } else {
+	die "unexpected data $line\n";
+    }
+}
+
+close FILE;
+
+
+# And the same for the QEMU specific APIs
+
+open FILE, "<$symsqemu"
+    or die "cannot read $symsqemu: $!";
+
+$prevvers = undef;
+$vers = undef;
+while (defined($line = <FILE>)) {
+    chomp $line;
+    next if $line =~ /^\s*#/;
+    next if $line =~ /^\s*$/;
+    next if $line =~ /^\s*(global|local):/;
+    if ($line =~ /^\s*LIBVIRT_QEMU_(\d+\.\d+\.\d+)\s*{\s*$/) {
+	if (defined $vers) {
+	    die "malformed syms file";
+	}
+	$vers = $1;
+    } elsif ($line =~ /\s*}\s*;\s*$/) {
+	if (defined $prevvers) {
+	    die "malformed syms file";
+	}
+	$prevvers = $vers;
+	$vers = undef;
+    } elsif ($line =~ /\s*}\s*LIBVIRT_QEMU_(\d+\.\d+\.\d+)\s*;\s*$/) {
+	if ($1 ne $prevvers) {
+	    die "malformed syms file $1 != $vers";
+	}
+	$prevvers = $vers;
+	$vers = undef;
+    } elsif ($line =~ /\s*(\w+)\s*;\s*$/) {
+	$apis{$1} = $vers;
+    } else {
+	die "unexpected data $line\n";
+    }
+}
+
+close FILE;
+
+
+
+# Now we want to get the mapping between public APIs
+# and driver struct fields. This lets us later match
+# update the driver impls with the public APis.
+
+open FILE, "<$drivertable"
+    or die "cannot read $drivertable: $!";
+
+# Group name -> hash of APIs { fields -> api name }
+my %groups;
+
+# XXX handle these better
+my %apisecret = qw(
+    DrvSupportsFeature  virConnectDrvSupportsFeature
+    DomainMigratePrepare  virDomainMigratePrepare
+    DomainMigratePerform  virDomainMigratePerform
+    DomainMigrateFinish  virDomainMigrateFinish
+    DomainMigratePrepare2  virDomainMigratePrepare2
+    DomainMigrateFinish2  virDomainMigrateFinish2
+    DomainMigratePrepareTunnel  virDomainMigratePrepareTunnel
+    );
+
+foreach my $field (keys %apisecret) {
+    my $api = $apisecret{$field};
+    $apis{$api} = "0.0.0";
+}
+
+my $ingrp;
+while (defined($line = <FILE>)) {
+    if ($line =~ /struct _(vir\w*Driver)/) {
+	my $grp = $1;
+	if ($grp ne "virStateDriver" &&
+	    $grp ne "virStreamDriver") {
+	    $ingrp = $grp;
+	    $groups{$ingrp} = { apis => {}, drivers => {} };
+	}
+    } elsif ($ingrp) {
+	if ($line =~ /^\s*virDrv(\w+)\s+(\w+);\s*$/) {
+	    my $field = $2;
+	    my $name = $1;
+
+	    my $api;
+	    if (exists $apis{"vir$name"}) {
+		$api = "vir$name";
+	    } elsif (exists $apis{"virConnect$name"}) {
+		$api = "virConnect$name";
+	    } else {
+		die "driver $name does not have a public API";
+	    }
+	    $groups{$ingrp}->{apis}->{$field} = $api;
+	} elsif ($line =~ /};/) {
+	    $ingrp = undef;
+	}
+    }
+}
+
+close FILE;
+
+
+# Finally, we read all the primary driver files and extract
+# the driver API tables from each one.
+
+foreach my $src (@srcs) {
+    open FILE, "<$src" or
+	die "cannot read $src: $!";
+
+    $ingrp = undef;
+    my $impl;
+    while (defined($line = <FILE>)) {
+	if (!$ingrp) {
+	    foreach my $grp (keys %groups) {
+		if ($line =~ /^\s*(?:static\s+)?$grp\s+(\w+)\s*=\s*{/ ||
+		    $line =~ /^\s*(?:static\s+)?$grp\s+NAME\(\w+\)\s*=\s*{/) {
+		    $ingrp = $grp;
+		    $impl = $src;
+		    $impl =~ s,.*/(\w+?)_((\w+)_)?(\w+)\.c,$1,;
+		    $groups{$ingrp}->{drivers}->{$impl} = {};
+		}
+	    }
+
+	} else {
+	    if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*\*/\s*)?$!) {
+		my $api = $1;
+		my $meth = $2;
+		my $vers = $3;
+
+		$vers = "Y" unless defined $vers;
+
+		die "Driver method for $api is NULL in $src" if $meth eq "NULL";
+
+		if (!exists($groups{$ingrp}->{apis}->{$api})) {
+		    die "Found unexpected driver $api in $ingrp\n";
+		}
+
+		$groups{$ingrp}->{drivers}->{$impl}->{$api} = $vers;
+	    } elsif ($line =~ /}/) {
+		$ingrp = undef;
+	    }
+	}
+    }
+
+    close FILE;
+}
+
+
+# The '.open' driver method is used for 3 public APIs, so we
+# have a bit of manual fixup todo with the per-driver versioning
+# and support matrix
+
+$groups{virDriver}->{apis}->{"openAuth"} = "virConnectOpenAuth";
+$groups{virDriver}->{apis}->{"openReadOnly"} = "virConnectOpenReadOnly";
+
+my $openAuthVers = (0 * 1000 * 1000) + (4 * 1000) + 0;
+
+foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
+    my $openVersStr = $groups{"virDriver"}->{drivers}->{$drv}->{"open"};
+    my $openVers;
+    if ($openVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
+	$openVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
+    }
+
+    # virConnectOpenReadOnly always matches virConnectOpen version
+    $groups{"virDriver"}->{drivers}->{$drv}->{"openReadOnly"} =
+	$groups{"virDriver"}->{drivers}->{$drv}->{"open"};
+
+    # virConnectOpenAuth is always 0.4.0 if the driver existed
+    # before this time, otherwise it matches the version of
+    # the driver's virConnectOpen entry
+    if ($openVersStr eq "Y" ||
+	$openVers >= $openAuthVers) {
+	$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = $openVersStr;
+    } else {
+	$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = "0.4.0";
+    }
+}
+
+
+# Another special case for the virDomainCreateLinux which was replaced
+# with virDomainCreateXML
+$groups{virDriver}->{apis}->{"domainCreateLinux"} = "virDomainCreateLinux";
+
+my $createAPIVers = (0 * 1000 * 1000) + (0 * 1000) + 3;
+
+foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
+    my $createVersStr = $groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateXML"};
+    next unless defined $createVersStr;
+    my $createVers;
+    if ($createVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
+	$createVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
+    }
+
+    # virCreateLinux is always 0.0.3 if the driver existed
+    # before this time, otherwise it matches the version of
+    # the driver's virCreateXML entry
+    if ($createVersStr eq "Y" ||
+	$createVers >= $createAPIVers) {
+	$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = $createVersStr;
+    } else {
+	$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = "0.0.3";
+    }
+}
+
+
+# Finally we generate the HTML file with the tables
+
+print <<EOF;
+<html>
+<head>
+<title>libvirt API support matrix</title>
+</head>
+<body>
+<h1>libvirt API support matrix</h1>
+
+<ul id="toc"></ul>
+
+<p>
+This page documents which <a href="html/">libvirt calls</a> work on
+which libvirt drivers / hypervisors, and which version the API appeared
+in.
+</p>
+
+EOF
+
+foreach my $grp (sort { $a cmp $b } keys %groups) {
+    print "<h2><a name=\"$grp\">", $groupheaders{$grp}, "</a></h2>\n";
+    print <<EOF;
+<table class="top_table">
+<thead>
+<tr>
+<th>API</th>
+<th>Version</th>
+EOF
+
+    foreach my $drv (sort { $a cmp $b } keys %{$groups{$grp}->{drivers}}) {
+	print "  <th>$drv</th>\n";
+    }
+
+    print <<EOF;
+</tr>
+</thead>
+<tbody>
+EOF
+
+    foreach my $field (sort {
+	$groups{$grp}->{apis}->{$a}
+	cmp
+	$groups{$grp}->{apis}->{$b}
+	} keys %{$groups{$grp}->{apis}}) {
+	my $api = $groups{$grp}->{apis}->{$field};
+	my $vers = $apis{$api};
+	print <<EOF;
+<tr>
+<td><a href=\"html/libvirt-libvirt.html#$api\">$api</a></td>
+<td>$vers</td>
+EOF
+
+        foreach my $drv (sort {$a cmp $b } keys %{$groups{$grp}->{drivers}}) {
+	    if (exists $groups{$grp}->{drivers}->{$drv}->{$field}) {
+		print "<td>", $groups{$grp}->{drivers}->{$drv}->{$field}, "</td>\n";
+	    } else {
+		print "<td></td>\n";
+	    }
+        }
+
+	print <<EOF;
+</tr>
+EOF
+    }
+
+    print <<EOF;
+</tbody>
+</table>
+EOF
+}
+
+print <<EOF;
+</body>
+</html>
+EOF
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]