mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
LXC: Fix handling of RAM filesystem size units
Since 76b644c when the support for RAM filesystems was introduced,
libvirt accepted the following XML:
<source usage='1024' unit='KiB'/>
This was parsed correctly and internally stored in bytes, but it
was formatted as (with an extra 's'):
<source usage='1024' units='KiB'/>
When read again, this was treated as if the units were missing,
meaning libvirt was unable to parse its own XML correctly.
The usage attribute was documented as being in KiB, but it was not
scaled if the unit was missing. Transient domains still worked,
because this was balanced by an extra 'k' in the mount options.
This patch:
Changes the parser to use 'units' instead of 'unit', as the latter
was never documented (fixing persistent domains) and some programs
(libvirt-glib, libvirt-sandbox) already parse the 'units' attribute.
Removes the extra 'k' from the tmpfs mount options, which is needed
because now we parse our own XML correctly.
Changes the default input unit to KiB to match documentation, fixing:
https://bugzilla.redhat.com/show_bug.cgi?id=1015689
This commit is contained in:
1 parent
fc9a416df7
commit
3f029fb531
9 files changed
+79
-11
No files matched your search
@@ -2213,7 +2213,8 @@
|
||||
<dd>
|
||||
An in-memory filesystem, using memory from the host OS.
|
||||
The source element has a single attribute <code>usage</code>
|
||||
which gives the memory usage limit in kibibytes. Only used
|
||||
which gives the memory usage limit in KiB, unless units
|
||||
are specified by the <code>units</code> attribute. Only used
|
||||
by LXC driver.
|
||||
<span class="since"> (since 0.9.13)</span></dd>
|
||||
<dt><code>type='bind'</code></dt>
|
||||
@@ -2279,7 +2280,8 @@
|
||||
<code>name</code> attribute must be used with
|
||||
<code>type='template'</code>, and the <code>dir</code> attribute must
|
||||
be used with <code>type='mount'</code>. The <code>usage</code> attribute
|
||||
is used with <code>type='ram'</code> to set the memory limit in KB.
|
||||
is used with <code>type='ram'</code> to set the memory limit in KiB,
|
||||
unless units are specified by the <code>units</code> attribute.
|
||||
</dd>
|
||||
|
||||
<dt><code>target</code></dt>
|
||||
|
||||
Reference in new issue
Block a user