[libvirt] [PATCH] Add support for RAM filesystems for LXC

Eric Blake eblake at redhat.com
Wed May 9 16:00:47 UTC 2012


On 05/09/2012 09:49 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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?

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120509/ebfeb32a/attachment-0001.sig>


More information about the libvir-list mailing list