Re: [PATCH] Add support for RAM filesystems for LXC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > 
> > 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.

virParseScaleValue from "Filesystem limits for containers" might help
here.
Cheers,
 -- Guido

> 
> > +++ 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@xxxxxxxxxx    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 



> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]