maint: whitespace cleanup

* .dir-locals.el (html-mode): Let emacs help out.
* cfg.mk (sc_TAB_in_indentation): Check more files.
* docs/internals/command.html.in: Fix offenders.
* docs/formatdomain.html.in: Likewise.
* docs/internals.html.in: Likewise.
Reported by Jiri Denemark.
This commit is contained in:
Eric Blake 2011-02-04 11:16:35 -07:00
parent 7a4bc156c1
commit 1652fa2fd2
5 changed files with 136 additions and 133 deletions

View File

@ -5,4 +5,7 @@
(c-indent-level . 4) (c-indent-level . 4)
(c-basic-offset . 4) (c-basic-offset . 4)
)) ))
(html-mode . (
(indent-tabs-mode . nil)
))
) )

6
cfg.mk
View File

@ -322,13 +322,13 @@ sc_prohibit_ctype_h:
halt="don't use ctype.h; instead, use c-ctype.h" \ halt="don't use ctype.h; instead, use c-ctype.h" \
$(_sc_search_regexp) $(_sc_search_regexp)
# Ensure that no C source file or rng schema uses TABs for # Ensure that no C source file, docs, or rng schema uses TABs for
# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude # indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
# files in gnulib, since they're imported. # files in gnulib, since they're imported.
sc_TAB_in_indentation: sc_TAB_in_indentation:
@prohibit='^ * ' \ @prohibit='^ * ' \
in_vc_files='(\.(rng|[ch](\.in)?)|(daemon|tools)/.*\.in)$$' \ in_vc_files='(\.(rng|[ch](\.in)?|html.in)|(daemon|tools)/.*\.in)$$' \
halt='use spaces, not TAB, for indentation in C, sh, and RNG schemas' \ halt='use leading spaces, not TAB, in C, sh, html, and RNG schemas' \
$(_sc_search_regexp) $(_sc_search_regexp)
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\

View File

@ -317,20 +317,20 @@
omitted, it defaults to the OS provided defaults.</dd> omitted, it defaults to the OS provided defaults.</dd>
<dt><code>hard_limit</code></dt> <dt><code>hard_limit</code></dt>
<dd> The optional <code>hard_limit</code> element is the maximum memory <dd> The optional <code>hard_limit</code> element is the maximum memory
the guest can use. The units for this value are kilobytes (i.e. blocks the guest can use. The units for this value are kilobytes (i.e. blocks
of 1024 bytes)</dd> of 1024 bytes)</dd>
<dt><code>soft_limit</code></dt> <dt><code>soft_limit</code></dt>
<dd> The optional <code>soft_limit</code> element is the memory limit to <dd> The optional <code>soft_limit</code> element is the memory limit to
enforce during memory contention. The units for this value are enforce during memory contention. The units for this value are
kilobytes (i.e. blocks of 1024 bytes)</dd> kilobytes (i.e. blocks of 1024 bytes)</dd>
<dt><code>swap_hard_limit</code></dt> <dt><code>swap_hard_limit</code></dt>
<dd> The optional <code>swap_hard_limit</code> element is the maximum <dd> The optional <code>swap_hard_limit</code> element is the maximum
swap the guest can use. The units for this value are kilobytes swap the guest can use. The units for this value are kilobytes
(i.e. blocks of 1024 bytes)</dd> (i.e. blocks of 1024 bytes)</dd>
<dt><code>min_guarantee</code></dt> <dt><code>min_guarantee</code></dt>
<dd> The optional <code>min_guarantee</code> element is the guaranteed <dd> The optional <code>min_guarantee</code> element is the guaranteed
minimum memory allocation for the guest. The units for this value are minimum memory allocation for the guest. The units for this value are
kilobytes (i.e. blocks of 1024 bytes)</dd> kilobytes (i.e. blocks of 1024 bytes)</dd>
<dt><code>vcpu</code></dt> <dt><code>vcpu</code></dt>
<dd>The content of this element defines the maximum number of virtual <dd>The content of this element defines the maximum number of virtual
CPUs allocated for the guest OS, which must be between 1 and CPUs allocated for the guest OS, which must be between 1 and
@ -400,8 +400,8 @@
match the specification.</dd> match the specification.</dd>
</dl> </dl>
<span class="since">Since 0.8.5</span> the <code>match</code> <span class="since">Since 0.8.5</span> the <code>match</code>
attribute can be omitted and will default to <code>exact</code>. attribute can be omitted and will default to <code>exact</code>.
</dd> </dd>
<dt><code>model</code></dt> <dt><code>model</code></dt>
@ -449,8 +449,8 @@
CPU.</dd> CPU.</dd>
</dl> </dl>
<span class="since">Since 0.8.5</span> the <code>policy</code> <span class="since">Since 0.8.5</span> the <code>policy</code>
attribute can be omitted and will default to <code>require</code>. attribute can be omitted and will default to <code>require</code>.
</dd> </dd>
</dl> </dl>
@ -579,101 +579,101 @@
<dl> <dl>
<dt><code>clock</code></dt> <dt><code>clock</code></dt>
<dd> <dd>
<p>The <code>offset</code> attribute takes four possible <p>The <code>offset</code> attribute takes four possible
values, allowing fine grained control over how the guest values, allowing fine grained control over how the guest
clock is synchronized to the host. NB, not all hypervisors clock is synchronized to the host. NB, not all hypervisors
support all modes.</p> support all modes.</p>
<dl> <dl>
<dt><code>utc</code></dt> <dt><code>utc</code></dt>
<dd> <dd>
The guest clock will always be synchronized to UTC when The guest clock will always be synchronized to UTC when
booted</dd> booted</dd>
<dt><code>localtime</code></dt> <dt><code>localtime</code></dt>
<dd> <dd>
The guest clock will be synchronized to the host's configured The guest clock will be synchronized to the host's configured
timezone when booted, if any. timezone when booted, if any.
</dd> </dd>
<dt><code>timezone</code></dt> <dt><code>timezone</code></dt>
<dd> <dd>
The guest clock will be synchronized to the requested timezone The guest clock will be synchronized to the requested timezone
using the <code>timezone</code> attribute. using the <code>timezone</code> attribute.
<span class="since">Since 0.7.7</span> <span class="since">Since 0.7.7</span>
</dd> </dd>
<dt><code>variable</code></dt> <dt><code>variable</code></dt>
<dd> <dd>
The guest clock will have an arbitrary offset applied The guest clock will have an arbitrary offset applied
relative to UTC. The delta relative to UTC is specified relative to UTC. The delta relative to UTC is specified
in seconds, using the <code>adjustment</code> attribute. in seconds, using the <code>adjustment</code> attribute.
The guest is free to adjust the RTC over time an expect The guest is free to adjust the RTC over time an expect
that it will be honoured at next reboot. This is in that it will be honoured at next reboot. This is in
contrast to 'utc' mode, where the RTC adjustments are contrast to 'utc' mode, where the RTC adjustments are
lost at each reboot. <span class="since">Since 0.7.7</span> lost at each reboot. <span class="since">Since 0.7.7</span>
</dd> </dd>
</dl> </dl>
<p> <p>
A <code>clock</code> may have zero or more A <code>clock</code> may have zero or more
<code>timer</code>sub-elements. <span class="since">Since <code>timer</code>sub-elements. <span class="since">Since
0.8.0</span> 0.8.0</span>
</p> </p>
</dd> </dd>
<dt><code>timer</code></dt> <dt><code>timer</code></dt>
<dd> <dd>
<p> <p>
Each timer element requires a <code>name</code> attribute, Each timer element requires a <code>name</code> attribute,
and has other optional attributes that depend on and has other optional attributes that depend on
the <code>name</code> specified. Various hypervisors the <code>name</code> specified. Various hypervisors
support different combinations of attributes. support different combinations of attributes.
</p> </p>
<dl> <dl>
<dt><code>name</code></dt> <dt><code>name</code></dt>
<dd> <dd>
The <code>name</code> attribute selects which timer is The <code>name</code> attribute selects which timer is
being modified, and can be one of "platform", "pit", being modified, and can be one of "platform", "pit",
"rtc", "hpet", or "tsc". "rtc", "hpet", or "tsc".
</dd> </dd>
<dt><code>track</code></dt> <dt><code>track</code></dt>
<dd> <dd>
The <code>track</code> attribute specifies what the timer The <code>track</code> attribute specifies what the timer
tracks, and can be "boot", "guest", or "wall". tracks, and can be "boot", "guest", or "wall".
Only valid for <code>name="rtc"</code> Only valid for <code>name="rtc"</code>
or <code>name="platform"</code>. or <code>name="platform"</code>.
</dd> </dd>
<dt><code>tickpolicy</code></dt> <dt><code>tickpolicy</code></dt>
<dd> <dd>
The <code>tickpolicy</code> attribute determines how The <code>tickpolicy</code> attribute determines how
missed ticks in the guest are handled, and can be "delay", missed ticks in the guest are handled, and can be "delay",
"catchup", "merge", or "discard". If the policy is "catchup", "merge", or "discard". If the policy is
"catchup", there can be further details in "catchup", there can be further details in
the <code>catchup</code> sub-element. the <code>catchup</code> sub-element.
<dl> <dl>
<dt><code>catchup</code></dt> <dt><code>catchup</code></dt>
<dd> <dd>
The <code>catchup</code> element has three optional The <code>catchup</code> element has three optional
attributes, each a positive integer. The attributes attributes, each a positive integer. The attributes
are <code>threshold</code>, <code>slew</code>, are <code>threshold</code>, <code>slew</code>,
and <code>limit</code>. and <code>limit</code>.
</dd> </dd>
</dl> </dl>
</dd> </dd>
<dt><code>frequency</code></dt> <dt><code>frequency</code></dt>
<dd> <dd>
The <code>frequency</code> attribute is an unsigned The <code>frequency</code> attribute is an unsigned
integer specifying the frequency at integer specifying the frequency at
which <code>name="tsc"</code> runs. which <code>name="tsc"</code> runs.
</dd> </dd>
<dt><code>mode</code></dt> <dt><code>mode</code></dt>
<dd> <dd>
The <code>mode</code> attribute controls how The <code>mode</code> attribute controls how
the <code>name="tsc"</code> timer is managed, and can be the <code>name="tsc"</code> timer is managed, and can be
"auto", "native", "emulate", "paravirt", or "smpsafe". "auto", "native", "emulate", "paravirt", or "smpsafe".
Other timers are always emulated. Other timers are always emulated.
</dd> </dd>
<dt><code>present</code></dt> <dt><code>present</code></dt>
<dd> <dd>
The <code>present</code> attribute can be "yes" or "no" to The <code>present</code> attribute can be "yes" or "no" to
specify whether a particular timer is available to the guest. specify whether a particular timer is available to the guest.
</dd> </dd>
</dl> </dl>
</dd> </dd>
</dl> </dl>
@ -1503,7 +1503,7 @@ qemu-kvm -net nic,model=? /dev/null
</dd> </dd>
<dt><code>"spice"</code></dt> <dt><code>"spice"</code></dt>
<dd> <dd>
<p> <p>
Starts a SPICE server. The <code>port</code> attribute specifies the TCP Starts a SPICE server. The <code>port</code> attribute specifies the TCP
port number (with -1 as legacy syntax indicating that it should be port number (with -1 as legacy syntax indicating that it should be
auto-allocated), while <code>tlsPort</code> gives an alternative auto-allocated), while <code>tlsPort</code> gives an alternative
@ -1515,8 +1515,8 @@ qemu-kvm -net nic,model=? /dev/null
to use. It is possible to set a limit on the validity of the password to use. It is possible to set a limit on the validity of the password
be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code> be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
assumed to be in UTC. NB, this may not be supported by all hypervisors. assumed to be in UTC. NB, this may not be supported by all hypervisors.
</p> </p>
<p> <p>
When SPICE has both a normal and TLS secured TCP port configured, it When SPICE has both a normal and TLS secured TCP port configured, it
can be desirable to restrict what channels can be run on each port. can be desirable to restrict what channels can be run on each port.
This is achieved by adding one or more &lt;channel&gt; elements inside This is achieved by adding one or more &lt;channel&gt; elements inside
@ -1524,8 +1524,8 @@ qemu-kvm -net nic,model=? /dev/null
<code>main</code>, <code>display</code>, <code>inputs</code>, <code>main</code>, <code>display</code>, <code>inputs</code>,
<code>cursor</code>, <code>playback</code>, <code>record</code>; <code>cursor</code>, <code>playback</code>, <code>record</code>;
and <span class="since">since 0.8.8</span>: <code>smartcard</code>. and <span class="since">since 0.8.8</span>: <code>smartcard</code>.
</p> </p>
<pre> <pre>
&lt;graphics type='spice' port='-1' tlsPort='-1' autoport='yes'&gt; &lt;graphics type='spice' port='-1' tlsPort='-1' autoport='yes'&gt;
&lt;channel name='main' mode='secure'/&gt; &lt;channel name='main' mode='secure'/&gt;
&lt;channel name='record' mode='insecure'/&gt; &lt;channel name='record' mode='insecure'/&gt;
@ -1582,7 +1582,7 @@ qemu-kvm -net nic,model=? /dev/null
<dd> <dd>
The <code>model</code> element has a mandatory <code>type</code> The <code>model</code> element has a mandatory <code>type</code>
attribute which takes the value "vga", "cirrus", "vmvga", "qxl", attribute which takes the value "vga", "cirrus", "vmvga", "qxl",
"xen" or "vbox", depending on the hypervisor features available. "xen" or "vbox", depending on the hypervisor features available.
You can also provide the amount of video memory in kilobytes using You can also provide the amount of video memory in kilobytes using
<code>vram</code> and the number of screen with <code>heads</code>. <code>vram</code> and the number of screen with <code>heads</code>.
</dd> </dd>
@ -2180,8 +2180,8 @@ qemu-kvm -net nic,model=? /dev/null
<dd> <dd>
<p> <p>
The required <code>model</code> attribute specifies what type The required <code>model</code> attribute specifies what type
of balloon device is provided. Valid values are specific to of balloon device is provided. Valid values are specific to
the virtualization platform the virtualization platform
</p> </p>
<ul> <ul>
<li>'virtio' &mdash; default with QEMU/KVM</li> <li>'virtio' &mdash; default with QEMU/KVM</li>

View File

@ -10,10 +10,10 @@
<ul> <ul>
<li>Introduction to basic rules and guidelines for <a href="hacking.html">hacking<a> <li>Introduction to basic rules and guidelines for <a href="hacking.html">hacking<a>
on libvirt code</li> on libvirt code</li>
<li>Guide to adding <a href="api_extension.html">public APIs<a></li> <li>Guide to adding <a href="api_extension.html">public APIs<a></li>
<li>Approach for <a href="internals/command.html">spawning commands</a> from <li>Approach for <a href="internals/command.html">spawning commands</a> from
libvirt driver code</li> libvirt driver code</li>
</ul> </ul>
</body> </body>

View File

@ -20,27 +20,27 @@
<ul> <ul>
<li><code>fork+exec</code>: The lowest &amp; most flexible <li><code>fork+exec</code>: The lowest &amp; most flexible
level, but very hard to use correctly / safely. It level, but very hard to use correctly / safely. It
is easy to leak file descriptors, have unexpected is easy to leak file descriptors, have unexpected
signal handler behaviour and not handle edge cases. signal handler behaviour and not handle edge cases.
Furthermore, it is not portable to mingw. Furthermore, it is not portable to mingw.
</li> </li>
<li><code>system</code>: Convenient if you don't care <li><code>system</code>: Convenient if you don't care
about capturing command output, but has the serious about capturing command output, but has the serious
downside that the command string is interpreted by downside that the command string is interpreted by
the shell. This makes it very dangerous to use, because the shell. This makes it very dangerous to use, because
improperly validated user input can lead to exploits improperly validated user input can lead to exploits
via shell meta characters. via shell meta characters.
</li> </li>
<li><code>popen</code>: Inherits the flaws of <li><code>popen</code>: Inherits the flaws of
<code>system</code>, and has no option for bi-directional <code>system</code>, and has no option for bi-directional
communication. communication.
</li> </li>
<li><code>posix_spawn</code>: A half-way house between <li><code>posix_spawn</code>: A half-way house between
simplicity of system() and the flexibility of fork+exec. simplicity of system() and the flexibility of fork+exec.
It does not allow for a couple of important features It does not allow for a couple of important features
though, such as running a hook between the fork+exec though, such as running a hook between the fork+exec
stage, or closing all open file descriptors.</li> stage, or closing all open file descriptors.</li>
</ul> </ul>
<p> <p>