[libvirt] [PATCH 3/3] xml: allow scaled memory on input

Christophe Fergeau cfergeau at redhat.com
Thu Feb 23 09:51:33 UTC 2012

On Wed, Feb 22, 2012 at 09:59:47PM -0700, Eric Blake wrote:
> @@ -424,12 +424,27 @@
>      <dl>
>        <dt><code>memory</code></dt>
>        <dd>The maximum allocation of memory for the guest at boot time.
> -        The units for this value are kilobytes (i.e. blocks of 1024 bytes)</dd>
> +        The units for this value are determined by the optional
> +        atttribute <code>units</code>, which defaults to "KiB"
> +        (kibibytes, or blocks of 1024 bytes).  Valid units are "b" or
> +        "bytes" for bytes, "KB" for kilobytes (1,000), "k" or "KiB"
> +        for kibibytes (1024), "MB" for megabytes (1,000,000), "M" or
> +        "MiB" for mebibytes (1,048,576), "GB" for gigabytes
> +        (1,000,000,000), "G" or "GiB" for gibibytes (1,073,741,824),
> +        "TB" for terabytes (1,000,000,000,000), or "T" or "TiB" for
> +        tebibytes (1,099,511,627,776).  However, the value will be
> +        rounded up to the nearest kibibyte by libvirt, and may be
> +        further rounded to the granularity supported by the
> +        hypervisor.  As a sanity check, values less than 4000KiB are
> +        not permitted.  <span class='since'><code>units</code> since
> +        0.9.11</span></dd>

As mentioned in
https://www.redhat.com/archives/libvir-list/2012-February/msg00969.html ,
this differs from
which uses K for kilobytes (different from the 'k' used here, but would be
rather confusing to have k and K mean different things), M for megabytes
and so on. It would be nice to have the same meaning for the one-letter
versions, and to add support for MB/MiB/... to the storage code for

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120223/547a78d0/attachment-0001.sig>

More information about the libvir-list mailing list