
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 http://libvirt.org/git/?p=libvirt.git;a=blob;f=docs/formatstorage.html.in;h=... 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 consistency. Christophe