
On Wed, May 09, 2012 at 10:00:47AM -0600, Eric Blake wrote:
On 05/09/2012 09:49 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Introduce a new syntax for filesystems to allow use of a RAM filesystem
<filesystem type='ram'> <source usage='1024'/> <target dir='/mnt'/> </filesystem>
The usasge is in KB to limit consumption of host memory.
Based on what we learned with <memory>, I think you really want:
<source unit='KiB' usage='1024'/>
on output, as well as allowing unit='...' for scaling of input such as <source unit='G' usage='1'/> for 2^30 bytes.
+++ b/docs/formatdomain.html.in @@ -1617,6 +1617,12 @@ format will be autodetected. Only used by LXC driver <span class="since">(since 0.9.5)</span>. </dd> + <dt><code>type='ram'</code></dt> + <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 kilobytes. + <span class="since"> (since 0.9.13)</span></dd> </dl>
The filesystem block has an optional attribute <code>accessmode</code> @@ -1656,7 +1662,8 @@ The resource on the host that is being accessed in the guest. The <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> + 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.
We've already cleaned up wording like this in the docs before; this should be 'kibibytes (units of 1024 bytes)'.
+ + case VIR_DOMAIN_FS_TYPE_RAM: + virBufferAsprintf(buf, " <source usage='%lld'/>\n", + def->usage); + break;
Where's the .h file change that adds def->usage?
Urgh, rebase screw up. I forgot to squash in the parent commit Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|