[libvirt] [PATCH] docs: Correct invalid hyperlinks

Since libvirt.h was split into multiple files and similarly docs/libvirt-libvirt.html, docs/hvsupport.html have bad hyperlinks. The same happens for all the html.in files that used <code class='docref'> tag, because page.xsl has no idea where to point the link that's found. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/Makefile.am | 4 +- docs/acl.html.in | 2 +- docs/api.html.in | 224 ++++++++++++++++++++++++++++++++++-------- docs/errors.html.in | 4 +- docs/formatdomain.html.in | 15 ++- docs/formatdomaincaps.html.in | 17 ++-- docs/hvsupport.pl | 79 ++++++++++----- docs/java.html.in | 6 +- docs/page.xsl | 5 - docs/python.html.in | 8 +- docs/uri.html.in | 12 ++- 11 files changed, 278 insertions(+), 98 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 5485ee9..684687d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -## Copyright (C) 2005-2013 Red Hat, Inc. +## Copyright (C) 2005-2014 Red Hat, Inc. ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -195,7 +195,7 @@ todo: hvsupport.html:: $(srcdir)/hvsupport.html.in -$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl \ +$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \ $(srcdir)/../src/libvirt_public.syms \ $(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/libvirt_lxc.syms \ $(srcdir)/../src/driver.h diff --git a/docs/acl.html.in b/docs/acl.html.in index 2d228e2..6d280c1 100644 --- a/docs/acl.html.in +++ b/docs/acl.html.in @@ -90,7 +90,7 @@ types in its API. Each object type, in turn, has a set of permissions defined. To determine what permissions are checked for specific API call, consult the - <a href="html/libvirt-libvirt.html">API reference manual</a> + <a href="html/index.html">API reference manual</a> documentation for the API in question. </p> diff --git a/docs/api.html.in b/docs/api.html.in index 68ffa0b..5c64db1 100644 --- a/docs/api.html.in +++ b/docs/api.html.in @@ -16,7 +16,7 @@ manipulated through the API is the <code>virConnectPtr</code>, which represents the connection to a hypervisor. Any application using libvirt is likely to start using the - API by calling one of <a href="html/libvirt-libvirt.html#virConnectOpen" + API by calling one of <a href="html/libvirt-libvirt-host.html#virConnectOpen" >the virConnectOpen functions</a>. You will note that those functions take a name argument which is actually a <a href="uri.html">connection URI</a> to select the right hypervisor to open. @@ -26,7 +26,10 @@ name will default to a preselected hypervisor, but it's probably not a wise thing to do in most cases. See the <a href="uri.html">connection URI</a> page for a full descriptions of the values allowed.</p> - <p> Once the application obtains a <code class='docref'>virConnectPtr</code> + <p> OnDevice the application obtains a + <a href="/html/libvirt-libvirt-host.html#virConnectPtr"> + <code>virConnectPtr</code> + </a> connection to the hypervisor it can then use it to manage the hypervisor's available domains and related virtualization resources, such as storage and networking. All those are @@ -38,33 +41,61 @@ </p> <p> The figure above shows the five main objects exported by the API:</p> <ul> - <li><code class='docref'>virConnectPtr</code> + <li> + <a href="html/libvirt-libvirt-host.html#virConnectPtr"> + <code>virConnectPtr</code> + </a> <p>Represents the connection to a hypervisor. Use one of the - <a href="html/libvirt-libvirt.html#virConnectOpen">virConnectOpen</a> + <a href="html/libvirt-libvirt-host.html#virConnectOpen">virConnectOpen</a> functions to obtain connection to the hypervisor which is then used as a parameter to other connection API's.</p></li> - <li><code class='docref'>virDomainPtr</code> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainPtr"> + <code>virDomainPtr</code> + </a> <p>Represents one domain either active or defined (i.e. existing as permanent config file and storage but not currently running on that - node). The function <code class='docref'>virConnectListAllDomains</code> + node). The function + <a href="html/libvirt-libvirt-domain.html#virConnectListAllDomains"> + <code>virConnectListAllDomains</code> + </a> lists all the domains for the hypervisor.</p></li> - <li><code class='docref'>virNetworkPtr</code> + <li> + <a href="html/libvirt-libvirt-network.html#virNetworkPtr"> + <code>virNetworkPtr</code> + </a> <p>Represents one network either active or defined (i.e. existing as permanent config file and storage but not currently activated). - The function <code class='docref'>virConnectListAllNetworks</code> + The function + <a href="html/libvirt-libvirt-network.html#virConnectListAllNetworks"> + <code>virConnectListAllNetworks</code> + </a> lists all the virtualization networks for the hypervisor.</p></li> - <li><code class='docref'>virStorageVolPtr</code> + <li> + <a href="html/libvirt-libvirt-storage.html#virStorageVolPtr"> + <code>virStorageVolPtr</code> + </a> <p>Represents one storage volume generally used as a block device available to one of the domains. The function - <code class="docref">virStorageVolLookupByPath</code> finds - the storage volume object based on its path on the node.</p></li> - <li><code class='docref'>virStoragePoolPtr</code> + <a href="html/libvirt-libvirt-storage.html#virStorageVolLookupByPath"> + <code>virStorageVolLookupByPath</code> + </a> + finds the storage volume object based on its path on the node.</p></li> + <li> + <a href="html/libvirt-libvirt-storage.html#virStoragePoolPtr"> + <code>virStoragePoolPtr</code> + </a> <p>Represents a storage pool, which is a logical area used to allocate and store storage volumes. The function - <code class='docref'>virConnectListAllStoragePools</code> lists - all of the virtualization storage pools on the hypervisor. The function - <code class="docref">virStoragePoolLookupByVolume</code> finds - the storage pool containing a given storage volume.</p></li> + <a href="html/libvirt-libvirt-storage.html#virConnectListAllStoragePools"> + <code>virConnectListAllStoragePools</code> + </a> + lists all of the virtualization storage pools on the hypervisor. + The function + <a href="html/libvirt-libvirt-storage.html#virStoragePoolLookupByVolume"> + <code>virStoragePoolLookupByVolume</code> + </a> + finds the storage pool containing a given storage volume.</p></li> </ul> <p> Most objects manipulated by the library can also be represented using XML descriptions. This is used primarily to create those object, but is @@ -101,42 +132,114 @@ <p>Used to perform lookups on objects by some type of identifier, such as:</p> <ul> - <li><code class='docref'>virDomainLookupByID</code></li> - <li><code class='docref'>virDomainLookupByName</code></li> - <li><code class='docref'>virDomainLookupByUUID</code></li> - <li><code class='docref'>virDomainLookupByUUIDString</code></li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainLookupByID"> + <code>virDomainLookupByID</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainLookupByName"> + <code>virDomainLookupByName</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainLookupByUUID"> + <code>virDomainLookupByUUID</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainLookupByUUIDString"> + <code>virDomainLookupByUUIDString</code> + </a> + </li> </ul> </li> <li><b>Enumeration</b> [virConnectList..., virConnectNumOf...] <p>Used to enumerate a set of object available to an given hypervisor connection such as:</p> <ul> - <li><code class='docref'>virConnectListDomains</code></li> - <li><code class='docref'>virConnectNumOfDomains</code></li> - <li><code class='docref'>virConnectListNetworks</code></li> - <li><code class='docref'>virConnectListStoragePools</code></li> + <li> + <a href="html/libvirt-libvirt-domain.html#virConnectListDomains"> + <code>virConnectListDomains</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virConnectNumOfDomains"> + <code>virConnectNumOfDomains</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-network.html#virConnectListNetworks"> + <code>virConnectListNetworks</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-storage.html#virConnectListStoragePools"> + <code>virConnectListStoragePools</code> + </a> + </li> </ul> </li> <li><b>Description</b> [...GetInfo] <p>Generic accessor providing a set of generic information about an object, such as: </p> <ul> - <li><code class='docref'>virNodeGetInfo</code></li> - <li><code class='docref'>virDomainGetInfo</code></li> - <li><code class='docref'>virStoragePoolGetInfo</code></li> - <li><code class='docref'>virStorageVolGetInfo</code></li> + <li> + <a href="html/libvirt-libvirt-host.html#virNodeGetInfo"> + <code>virNodeGetInfo</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainGetInfo"> + <code>virDomainGetInfo</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-storage.html#virStoragePoolGetInfo"> + <code>virStoragePoolGetInfo</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-storage.html#virStorageVolGetInfo"> + <code>virStorageVolGetInfo</code> + </a> + </li> </ul> </li> <li><b>Accessors</b> [...Get..., ...Set...] <p>Specific accessors used to query or modify data for the given object, such as: </p> <ul> - <li><code class='docref'>virConnectGetType</code></li> - <li><code class='docref'>virDomainGetMaxMemory</code></li> - <li><code class='docref'>virDomainSetMemory</code></li> - <li><code class='docref'>virDomainGetVcpus</code></li> - <li><code class='docref'>virStoragePoolSetAutostart</code></li> - <li><code class='docref'>virNetworkGetBridgeName</code></li> + <li> + <a href="html/libvirt-libvirt-host.html#virConnectGetType"> + <code>virConnectGetType</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainGetMaxMemory"> + <code>virDomainGetMaxMemory</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainSetMemory"> + <code>virDomainSetMemory</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainGetVcpus"> + <code>virDomainGetVcpus</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-storage.html#virStoragePoolSetAutostart"> + <code>virStoragePoolSetAutostart</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-network.html#virNetworkGetBridgeName"> + <code>virNetworkGetBridgeName</code> + </a> + </li> </ul> </li> <li><b>Creation</b> [...Create, ...CreateXML] @@ -144,18 +247,46 @@ the object based on an XML description, while the ...Create APIs will create the object based on existing object pointer, such as: </p> <ul> - <li><code class='docref'>virDomainCreate</code></li> - <li><code class='docref'>virDomainCreateXML</code></li> - <li><code class='docref'>virNetworkCreate</code></li> - <li><code class='docref'>virNetworkCreateXML</code></li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainCreate"> + <code>virDomainCreate</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainCreateXML"> + <code>virDomainCreateXML</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-network.html#virNetworkCreate"> + <code>virNetworkCreate</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-network.html#virNetworkCreateXML"> + <code>virNetworkCreateXML</code> + </a> + </li> </ul> </li> <li><b>Destruction</b> [...Destroy] <p>Used to shutdown or deactivate and destroy objects, such as: </p> <ul> - <li><code class='docref'>virDomainDestroy</code></li> - <li><code class='docref'>virNetworkDestroy</code></li> - <li><code class='docref'>virStoragePoolDestroy</code></li> + <li> + <a href="html/libvirt-libvirt-domain.html#virDomainDestroy"> + <code>virDomainDestroy</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-network.html#virNetworkDestroy"> + <code>virNetworkDestroy</code> + </a> + </li> + <li> + <a href="html/libvirt-libvirt-storage.html#virStoragePoolDestroy"> + <code>virStoragePoolDestroy</code> + </a> + </li> </ul> </li> </ul> @@ -170,7 +301,11 @@ <p>Drivers are the basic building block for libvirt functionality to support the capability to handle specific hypervisor driver calls. Drivers are discovered and registered during connection processing as - part of the <code class='docref'>virInitialize</code> API. Each driver + part of the + <a href="html/libvirt-libvirt-host.html#virInitialize"> + <code>virInitialize</code> + </a> + API. Each driver has a registration API which loads up the driver specific function references for the libvirt APIs to call. The following is a simplistic view of the hypervisor driver mechanism. Consider the stacked list of @@ -199,7 +334,10 @@ The libvirtd daemon service is started on the host at system boot time and can also be restarted at any time by a properly privileged user, such as root. The libvirtd daemon uses the same libvirt API - <code class='docref'>virInitialize</code> sequence as applications + <a href="html/libvirt-libvirt-host.html#virInitialize"> + <code>virInitialize</code> + </a> + sequence as applications for client-side driver registrations, but then extends the registered driver list to encompass all known drivers supported for all driver types supported on the host. </p> diff --git a/docs/errors.html.in b/docs/errors.html.in index df9aa7c..668d280 100644 --- a/docs/errors.html.in +++ b/docs/errors.html.in @@ -46,9 +46,9 @@ following fields:</p> <li>level: the error level, usually VIR_ERR_ERROR, though there is room for warnings like VIR_ERR_WARNING</li> <li>message: the full human-readable formatted string of the error</li> - <li>conn: if available a pointer to the <a href="html/libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> + <li>conn: if available a pointer to the <a href="html/libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a> connection to the hypervisor where this happened</li> - <li>dom: if available a pointer to the <a href="html/libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain + <li>dom: if available a pointer to the <a href="html/libvirt-libvirt-domain.html#virDomainPtr">virDomainPtr</a> domain targeted in the operation</li> </ul> <p>and then extra raw information about the error which may be initialized diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index d05912e..8fcbd29 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -190,7 +190,7 @@ "emulate" (let the hypervisor generate all values), "host" (copy all of Block 0 and Block 1, except for the UUID, from the host's SMBIOS values; - the <a href="html/libvirt-libvirt.html#virConnectGetSysinfo"> + the <a href="html/libvirt-libvirt-host.html#virConnectGetSysinfo"> <code>virConnectGetSysinfo</code></a> call can be used to see what values are copied), or "sysinfo" (use the values in the <a href="#elementsSysinfo">sysinfo</a> element). If not @@ -1196,9 +1196,16 @@ It is sometimes necessary to override the default actions taken on various events. Not all hypervisors support all events and actions. The actions may be taken as a result of calls to libvirt APIs - <code class='docref'>virDomainReboot</code>, - <code class='docref'>virDomainShutdown</code>, or - <code class='docref'>virDomainShutdownFlags</code>. + <a href="html/libvirt-libvirt-domain.html#virDomainReboot"> + <code>virDomainReboot</code> + </a>, + <a href="html/libvirt-libvirt-domain.html#virDomainShutdown"> + <code>virDomainShutdown</code> + </a>, + or + <a href="html/libvirt-libvirt-domain.html#virDomainShutdownFlags"> + <code>virDomainShutdownFlags</code> + </a>. Using <code>virsh reboot</code> or <code>virsh shutdown</code> would also trigger the event. </p> diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 6959dfe..7beb5a4 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -16,11 +16,14 @@ then it needs to be more recent to support VFIO, while legacy KVM is achievable just fine with older qemus.</p> - <p>The main difference between <code - class="docref">virConnectGetCapabilities</code> and the emulator - capabilities API is, the former one aims more on the host capabilities - (e.g. NUMA topology, security models in effect, etc.) while the latter one - specializes on the hypervisor capabilities.</p> + <p>The main difference between + <a href="/html/libvirt-libvirt-host.html#virConnectGetCapabilities"> + <code>virConnectGetCapabilities</code> + </a> + and the emulator capabilities API is, the former one aims more on + the host capabilities (e.g. NUMA topology, security models in + effect, etc.) while the latter one specializes on the hypervisor + capabilities.</p> <p>While the <a href="formatcaps.html">Driver Capabilities</a> provides the host capabilities (e.g NUMA topology, security models in effect, etc.), the @@ -41,7 +44,9 @@ 1.2.7</span>):</p> <pre> - <code class="docref">virConnectGetDomainCapabilities</code> + <a href="/html/libvirt-libvirt-domain.html#virConnectGetDomainCapabilities"> + <code>virConnectGetDomainCapabilities</code> + </a> </pre> <p>The root element that emulator capability XML document starts with has diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl index 6bbd44a..44a30ce 100755 --- a/docs/hvsupport.pl +++ b/docs/hvsupport.pl @@ -4,6 +4,8 @@ use strict; use warnings; use File::Find; +use XML::XPath; +use XML::XPath::XMLParser; die "syntax: $0 SRCDIR\n" unless int(@ARGV) == 1; @@ -52,6 +54,7 @@ open FILE, "<$symslibvirt" my $vers; my $prevvers; +my $apixpath = XML::XPath->new(filename => "$srcdir/../docs/libvirt-api.xml"); while (defined($line = <FILE>)) { chomp $line; next if $line =~ /^\s*#/; @@ -75,7 +78,10 @@ while (defined($line = <FILE>)) { $prevvers = $vers; $vers = undef; } elsif ($line =~ /\s*(\w+)\s*;\s*$/) { - $apis{$1} = $vers; + my $file = $apixpath->find("/api/symbols/function[\@name='$1']/\@file"); + $apis{$1} = {}; + $apis{$1}->{vers} = $vers; + $apis{$1}->{file} = $file; } else { die "unexpected data $line\n"; } @@ -91,6 +97,7 @@ open FILE, "<$symsqemu" $prevvers = undef; $vers = undef; +$apixpath = XML::XPath->new(filename => "$srcdir/../docs/libvirt-qemu-api.xml"); while (defined($line = <FILE>)) { chomp $line; next if $line =~ /^\s*#/; @@ -114,7 +121,10 @@ while (defined($line = <FILE>)) { $prevvers = $vers; $vers = undef; } elsif ($line =~ /\s*(\w+)\s*;\s*$/) { - $apis{$1} = $vers; + my $file = $apixpath->find("/api/symbols/function[\@name='$1']/\@file"); + $apis{$1} = {}; + $apis{$1}->{vers} = $vers; + $apis{$1}->{file} = $file; } else { die "unexpected data $line\n"; } @@ -130,6 +140,7 @@ open FILE, "<$symslxc" $prevvers = undef; $vers = undef; +$apixpath = XML::XPath->new(filename => "$srcdir/../docs/libvirt-lxc-api.xml"); while (defined($line = <FILE>)) { chomp $line; next if $line =~ /^\s*#/; @@ -153,7 +164,10 @@ while (defined($line = <FILE>)) { $prevvers = $vers; $vers = undef; } elsif ($line =~ /\s*(\w+)\s*;\s*$/) { - $apis{$1} = $vers; + my $file = $apixpath->find("/api/symbols/function[\@name='$1']/\@file"); + $apis{$1} = {}; + $apis{$1}->{vers} = $vers; + $apis{$1}->{file} = $file; } else { die "unexpected data $line\n"; } @@ -164,27 +178,27 @@ close FILE; # Some special things which aren't public APIs, # but we want to report -$apis{virConnectSupportsFeature} = "0.3.2"; -$apis{virDomainMigratePrepare} = "0.3.2"; -$apis{virDomainMigratePerform} = "0.3.2"; -$apis{virDomainMigrateFinish} = "0.3.2"; -$apis{virDomainMigratePrepare2} = "0.5.0"; -$apis{virDomainMigrateFinish2} = "0.5.0"; -$apis{virDomainMigratePrepareTunnel} = "0.7.2"; - -$apis{virDomainMigrateBegin3} = "0.9.2"; -$apis{virDomainMigratePrepare3} = "0.9.2"; -$apis{virDomainMigratePrepareTunnel3} = "0.9.2"; -$apis{virDomainMigratePerform3} = "0.9.2"; -$apis{virDomainMigrateFinish3} = "0.9.2"; -$apis{virDomainMigrateConfirm3} = "0.9.2"; - -$apis{virDomainMigrateBegin3Params} = "1.1.0"; -$apis{virDomainMigratePrepare3Params} = "1.1.0"; -$apis{virDomainMigratePrepareTunnel3Params} = "1.1.0"; -$apis{virDomainMigratePerform3Params} = "1.1.0"; -$apis{virDomainMigrateFinish3Params} = "1.1.0"; -$apis{virDomainMigrateConfirm3Params} = "1.1.0"; +$apis{virConnectSupportsFeature}->{vers} = "0.3.2"; +$apis{virDomainMigratePrepare}->{vers} = "0.3.2"; +$apis{virDomainMigratePerform}->{vers} = "0.3.2"; +$apis{virDomainMigrateFinish}->{vers} = "0.3.2"; +$apis{virDomainMigratePrepare2}->{vers} = "0.5.0"; +$apis{virDomainMigrateFinish2}->{vers} = "0.5.0"; +$apis{virDomainMigratePrepareTunnel}->{vers} = "0.7.2"; + +$apis{virDomainMigrateBegin3}->{vers} = "0.9.2"; +$apis{virDomainMigratePrepare3}->{vers} = "0.9.2"; +$apis{virDomainMigratePrepareTunnel3}->{vers} = "0.9.2"; +$apis{virDomainMigratePerform3}->{vers} = "0.9.2"; +$apis{virDomainMigrateFinish3}->{vers} = "0.9.2"; +$apis{virDomainMigrateConfirm3}->{vers} = "0.9.2"; + +$apis{virDomainMigrateBegin3Params}->{vers} = "1.1.0"; +$apis{virDomainMigratePrepare3Params}->{vers} = "1.1.0"; +$apis{virDomainMigratePrepareTunnel3Params}->{vers} = "1.1.0"; +$apis{virDomainMigratePerform3Params}->{vers} = "1.1.0"; +$apis{virDomainMigrateFinish3Params}->{vers} = "1.1.0"; +$apis{virDomainMigrateConfirm3Params}->{vers} = "1.1.0"; @@ -406,10 +420,23 @@ EOF $groups{$grp}->{apis}->{$b} } keys %{$groups{$grp}->{apis}}) { my $api = $groups{$grp}->{apis}->{$field}; - my $vers = $apis{$api}; + my $vers = $apis{$api}->{vers}; + my $htmlgrp = $apis{$api}->{file}; print <<EOF; <tr> -<td><a href=\"html/libvirt-libvirt.html#$api\">$api</a></td> +<td> +EOF + + if (defined $htmlgrp) { + print <<EOF; +<a href=\"html/libvirt-$htmlgrp.html#$api\">$api</a> +EOF + + } else { + print $api; + } + print <<EOF; +</td> <td>$vers</td> EOF diff --git a/docs/java.html.in b/docs/java.html.in index daa7b76..659c0b9 100644 --- a/docs/java.html.in +++ b/docs/java.html.in @@ -98,18 +98,18 @@ the code you can build the code with</p> <p>The bindings are articulated around a few classes in the <code>org/libvirt</code> package, notably the <code>Connect</code>, <code>Domain</code> and <code>Network</code> -ones. Functions in the <a href="html/libvirt-libvirt.html">C API</a> +ones. Functions in the <a href="html/index.html">C API</a> taking <code>virConnectPtr</code>, <code>virDomainPtr</code> or <code>virNetworkPtr</code> as their first argument usually become methods for the classes, their name is just stripped from the virConnect or virDomain(Get) prefix and the first letter gets converted to lower case, for example the C functions:</p> <p> - <code>int <a href="html/libvirt-libvirt.html#virConnectNumOfDomains">virConnectNumOfDomains</a> + <code>int <a href="html/libvirt-libvirt-domain.html#virConnectNumOfDomains">virConnectNumOfDomains</a> (virConnectPtr conn);</code> </p> <p> - <code>int <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a> + <code>int <a href="html/libvirt-libvirt-domain.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (virDomainPtr domain, unsigned long memory);</code> </p> <p>become</p> diff --git a/docs/page.xsl b/docs/page.xsl index 7de238e..80164dd 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -10,11 +10,6 @@ <!-- The sitemap.html.in page contains the master navigation structure --> <xsl:variable name="sitemap" select="document('sitemap.html.in')/html:html/html:body/html:div[@id='sitemap']"/> - <xsl:template match="html:code[@class='docref']" mode="content"> - <xsl:variable name="name"><xsl:value-of select="."/></xsl:variable> - <a href="html/libvirt-libvirt.html#{$name}"><code><xsl:value-of select="$name"/></code></a> - </xsl:template> - <xsl:template match="node() | @*" mode="content"> <xsl:copy> <xsl:apply-templates select="node() | @*" mode="content"/> diff --git a/docs/python.html.in b/docs/python.html.in index 3033337..36517fe 100644 --- a/docs/python.html.in +++ b/docs/python.html.in @@ -12,11 +12,11 @@ becomes methods for the classes, their name is just stripped from the virConnect or virDomain(Get) prefix and the first letter gets converted to lower case, for example the C functions:</p> <p> - <code>int <a href="html/libvirt-libvirt.html#virConnectNumOfDomains">virConnectNumOfDomains</a> + <code>int <a href="html/libvirt-libvirt-domain.html#virConnectNumOfDomains">virConnectNumOfDomains</a> (virConnectPtr conn);</code> </p> <p> - <code>int <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a> + <code>int <a href="html/libvirt-libvirt-domain.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (virDomainPtr domain, unsigned long memory);</code> </p> <p>become</p> @@ -31,10 +31,10 @@ in the file libvirtclass.txt present in the python dir or in the docs.There is a couple of function who don't map directly to their C counterparts due to specificities in their argument conversions:</p> <ul> - <li><code><a href="html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a></code> + <li><code><a href="html/libvirt-libvirt-domain.html#virConnectListDomains">virConnectListDomains</a></code> is replaced by <code>virDomain::listDomainsID(self)</code> which returns a list of the integer ID for the currently running domains</li> - <li><code><a href="html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a></code> + <li><code><a href="html/libvirt-libvirt-domain.html#virDomainGetInfo">virDomainGetInfo</a></code> is replaced by <code>virDomain::info()</code> which returns a list of <ol><li>state: one of the state values (virDomainState)</li><li>maxMemory: the maximum memory used by the domain</li><li>memory: the current amount of memory used by the domain</li><li>nbVirtCPU: the number of virtual CPU</li><li>cpuTime: the time used by the domain in nanoseconds</li></ol></li> </ul> diff --git a/docs/uri.html.in b/docs/uri.html.in index 73c3e88..7702ccc 100644 --- a/docs/uri.html.in +++ b/docs/uri.html.in @@ -19,7 +19,15 @@ documents libvirt URIs. <h2><a name="URI_libvirt">Specifying URIs to libvirt</a></h2> <p> -The URI is passed as the <code>name</code> parameter to <a href="html/libvirt-libvirt.html#virConnectOpen"><code>virConnectOpen</code></a> or <a href="html/libvirt-libvirt.html#virConnectOpenReadOnly"><code>virConnectOpenReadOnly</code></a>. For example: + The URI is passed as the <code>name</code> parameter to + <a href="html/libvirt-libvirt-host.html#virConnectOpen"> + <code>virConnectOpen</code> + </a> + or + <a href="html/libvirt-libvirt-host.html#virConnectOpenReadOnly"> + <code>virConnectOpenReadOnly</code> + </a>. + For example: </p> <pre> virConnectPtr conn = virConnectOpenReadOnly (<b>"test:///default"</b>); @@ -291,7 +299,7 @@ Notes: <ol> <li> The HTTP client does not fully support IPv6. </li> <li> Many features do not work as expected across HTTP connections, in - particular, <a href="html/libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>. + particular, <a href="html/libvirt-libvirt-host.html#virConnectGetCapabilities">virConnectGetCapabilities</a>. The <a href="remote.html">remote support</a> however does work correctly. </li> <li> XenD's new-style XMLRPC interface is not supported by -- 2.1.3

On 01.12.2014 15:37, Martin Kletzander wrote:
Since libvirt.h was split into multiple files and similarly docs/libvirt-libvirt.html, docs/hvsupport.html have bad hyperlinks. The same happens for all the html.in files that used <code class='docref'> tag, because page.xsl has no idea where to point the link that's found.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/Makefile.am | 4 +- docs/acl.html.in | 2 +- docs/api.html.in | 224 ++++++++++++++++++++++++++++++++++-------- docs/errors.html.in | 4 +- docs/formatdomain.html.in | 15 ++- docs/formatdomaincaps.html.in | 17 ++-- docs/hvsupport.pl | 79 ++++++++++----- docs/java.html.in | 6 +- docs/page.xsl | 5 - docs/python.html.in | 8 +- docs/uri.html.in | 12 ++- 11 files changed, 278 insertions(+), 98 deletions(-)
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl index 6bbd44a..44a30ce 100755 --- a/docs/hvsupport.pl +++ b/docs/hvsupport.pl @@ -4,6 +4,8 @@ use strict; use warnings;
use File::Find; +use XML::XPath; +use XML::XPath::XMLParser;
So up till now we've used only File::Find which is in core perl. However, XML::XPath isn't. Therefore build on bare minimal rawhide fails: make[3]: Entering directory '/home/zippy/tmp/libvirt.git/docs' GEN hvsupport.html.in Can't locate XML/XPath.pm in @INC (you may need to install the XML::XPath module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./hvsupport.pl line 7. BEGIN failed--compilation aborted at ./hvsupport.pl line 7. Makefile:2327: recipe for target 'hvsupport.html.in' failed make[3]: *** [hvsupport.html.in] Error 1 make[3]: Leaving directory '/home/zippy/tmp/libvirt.git/docs' We must require XML::XPath in the specfile now. ACK with this squashed in: diff --git a/libvirt.spec.in b/libvirt.spec.in index 0959483..3edb7bd 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -427,6 +427,7 @@ BuildRequires: /usr/bin/pod2man %endif BuildRequires: git BuildRequires: perl +BuildRequires: perl-XML-XPath BuildRequires: python %if %{with_systemd} BuildRequires: systemd-units Of course this isn't the only thing I've found missing, but for that I'll post a separate patch. Michal

On Mon, Dec 01, 2014 at 05:06:55PM +0100, Michal Privoznik wrote:
On 01.12.2014 15:37, Martin Kletzander wrote:
Since libvirt.h was split into multiple files and similarly docs/libvirt-libvirt.html, docs/hvsupport.html have bad hyperlinks. The same happens for all the html.in files that used <code class='docref'> tag, because page.xsl has no idea where to point the link that's found.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- docs/Makefile.am | 4 +- docs/acl.html.in | 2 +- docs/api.html.in | 224 ++++++++++++++++++++++++++++++++++-------- docs/errors.html.in | 4 +- docs/formatdomain.html.in | 15 ++- docs/formatdomaincaps.html.in | 17 ++-- docs/hvsupport.pl | 79 ++++++++++----- docs/java.html.in | 6 +- docs/page.xsl | 5 - docs/python.html.in | 8 +- docs/uri.html.in | 12 ++- 11 files changed, 278 insertions(+), 98 deletions(-)
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl index 6bbd44a..44a30ce 100755 --- a/docs/hvsupport.pl +++ b/docs/hvsupport.pl @@ -4,6 +4,8 @@ use strict; use warnings;
use File::Find; +use XML::XPath; +use XML::XPath::XMLParser;
So up till now we've used only File::Find which is in core perl. However, XML::XPath isn't. Therefore build on bare minimal rawhide fails:
make[3]: Entering directory '/home/zippy/tmp/libvirt.git/docs' GEN hvsupport.html.in Can't locate XML/XPath.pm in @INC (you may need to install the XML::XPath module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./hvsupport.pl line 7. BEGIN failed--compilation aborted at ./hvsupport.pl line 7. Makefile:2327: recipe for target 'hvsupport.html.in' failed make[3]: *** [hvsupport.html.in] Error 1 make[3]: Leaving directory '/home/zippy/tmp/libvirt.git/docs'
We must require XML::XPath in the specfile now. ACK with this squashed in:
diff --git a/libvirt.spec.in b/libvirt.spec.in index 0959483..3edb7bd 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -427,6 +427,7 @@ BuildRequires: /usr/bin/pod2man %endif BuildRequires: git BuildRequires: perl +BuildRequires: perl-XML-XPath BuildRequires: python %if %{with_systemd} BuildRequires: systemd-units
Of course this isn't the only thing I've found missing, but for that I'll post a separate patch.
Before sending that, make sure that BuildRequires are not applicable only when building from a tarball. I'll get to the reason below. I squashed that in and found out another issue (and then found out it's not caused by this patch) that we can't do "make dist" if running with enough threads (make -j9 always fails for me). The reason is that there is no rule to make all those html/libvirt-*.html files in docs/ because they are all built together with html/index.html. Simple solutions are usually the best, so I'm pushing another separate commit as a "build breaker", which fixes this issue: diff --git i/docs/Makefile.am w/docs/Makefile.am index 684687d..bb52c35 100644 --- i/docs/Makefile.am +++ w/docs/Makefile.am @@ -27,6 +27,9 @@ DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt apihtml = \ html/index.html \ + $(apihtml_generated) + +apihtml_generated = \ html/libvirt-libvirt-domain.html \ html/libvirt-libvirt-domain-snapshot.html \ html/libvirt-libvirt-event.html \ @@ -248,6 +251,8 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in -e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \ || { rm $(srcdir)/$@ && exit 1; }; fi +$(apihtml_generated): html/index.html + html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ -- That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it. Martin

On Tue, 2014-12-02 at 07:50 +0100, Martin Kletzander wrote:
That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it.
It's needed when building from the git tree to, Xen automated testing picked up on this overnight: http://www.chiark.greenend.org.uk/~xensrcts/logs/32083/build-amd64-libvirt/5... I'm not sure if things which are only needed to build the tarball are supposed to be checked for by configure or not. Ian.

On Fri, Dec 05, 2014 at 09:47:47AM +0000, Ian Campbell wrote:
On Tue, 2014-12-02 at 07:50 +0100, Martin Kletzander wrote:
That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it.
It's needed when building from the git tree to, Xen automated testing picked up on this overnight: http://www.chiark.greenend.org.uk/~xensrcts/logs/32083/build-amd64-libvirt/5...
I'm not sure if things which are only needed to build the tarball are supposed to be checked for by configure or not.
We didn't check for XHTML DTDs either, so I don't think so, but OTOH I'm fine with adding that there if majority agrees. Martin

On 12/05/2014 03:20 AM, Martin Kletzander wrote:
On Fri, Dec 05, 2014 at 09:47:47AM +0000, Ian Campbell wrote:
On Tue, 2014-12-02 at 07:50 +0100, Martin Kletzander wrote:
That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it.
It's needed when building from the git tree to, Xen automated testing picked up on this overnight: http://www.chiark.greenend.org.uk/~xensrcts/logs/32083/build-amd64-libvirt/5...
I'm not sure if things which are only needed to build the tarball are supposed to be checked for by configure or not.
We didn't check for XHTML DTDs either, so I don't think so, but OTOH I'm fine with adding that there if majority agrees.
Ideally, something that is required for building 'make dist' or 'make rpm' should be required by bootstrap (autogen.sh uses bootstrap.conf to require minimum versions of maintainer-only tools); but if they are optional when building from a tarball, then they should not be required by configure (but configure should still check for them, and we should do a better job of cleanly skipping rather than erroring if an optional build component is not present when building from tarball). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Dec 05, 2014 at 09:55:00AM -0700, Eric Blake wrote:
On 12/05/2014 03:20 AM, Martin Kletzander wrote:
On Fri, Dec 05, 2014 at 09:47:47AM +0000, Ian Campbell wrote:
On Tue, 2014-12-02 at 07:50 +0100, Martin Kletzander wrote:
That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it.
It's needed when building from the git tree to, Xen automated testing picked up on this overnight: http://www.chiark.greenend.org.uk/~xensrcts/logs/32083/build-amd64-libvirt/5...
I'm not sure if things which are only needed to build the tarball are supposed to be checked for by configure or not.
We didn't check for XHTML DTDs either, so I don't think so, but OTOH I'm fine with adding that there if majority agrees.
Ideally, something that is required for building 'make dist' or 'make rpm' should be required by bootstrap (autogen.sh uses bootstrap.conf to require minimum versions of maintainer-only tools); but if they are optional when building from a tarball, then they should not be required by configure (but configure should still check for them, and we should do a better job of cleanly skipping rather than erroring if an optional build component is not present when building from tarball).
How can you add a perl module in "buildreq"? I'm not familiar with how bootstrap works. Martin

On Sat, Dec 06, 2014 at 10:11:27AM +0100, Martin Kletzander wrote:
On Fri, Dec 05, 2014 at 09:55:00AM -0700, Eric Blake wrote:
On 12/05/2014 03:20 AM, Martin Kletzander wrote:
On Fri, Dec 05, 2014 at 09:47:47AM +0000, Ian Campbell wrote:
On Tue, 2014-12-02 at 07:50 +0100, Martin Kletzander wrote:
That said, I found out that that XML-XPath is only needed when creating the tarball, but (probably) not when building an RPM with it.
It's needed when building from the git tree to, Xen automated testing picked up on this overnight: http://www.chiark.greenend.org.uk/~xensrcts/logs/32083/build-amd64-libvirt/5...
I'm not sure if things which are only needed to build the tarball are supposed to be checked for by configure or not.
We didn't check for XHTML DTDs either, so I don't think so, but OTOH I'm fine with adding that there if majority agrees.
Ideally, something that is required for building 'make dist' or 'make rpm' should be required by bootstrap (autogen.sh uses bootstrap.conf to require minimum versions of maintainer-only tools); but if they are optional when building from a tarball, then they should not be required by configure (but configure should still check for them, and we should do a better job of cleanly skipping rather than erroring if an optional build component is not present when building from tarball).
How can you add a perl module in "buildreq"? I'm not familiar with how bootstrap works.
I had a look at that and posted a patch for gnulib [1] to work with perl modules and additional path for libvirt [2] which takes that into account. Let me see if that works for you. Martin [1] https://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00108.html [2] https://www.redhat.com/archives/libvir-list/2014-December/msg00399.html

On 12/08/2014 04:22 AM, Martin Kletzander wrote:
How can you add a perl module in "buildreq"? I'm not familiar with how bootstrap works.
I had a look at that and posted a patch for gnulib [1] to work with perl modules and additional path for libvirt [2] which takes that into account. Let me see if that works for you.
Martin
[1] https://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00108.html [2] https://www.redhat.com/archives/libvir-list/2014-December/msg00399.html
The gnulib update is now in place. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (4)
-
Eric Blake
-
Ian Campbell
-
Martin Kletzander
-
Michal Privoznik