From 9dfdeadc8aacf8443fac01f907632c9a8867ca06 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 2 Mar 2012 08:23:07 -0700 Subject: [PATCH] docs: use correct terminology for 1024 bytes Yes, I like kilobytes better than kibibytes (when I say kilobytes, I generally mean 1024). But since the term is ambiguous, it can't hurt to say what we mean, by using both the correct name and calling out the numeric equivalent. * src/libvirt.c (virDomainGetMaxMemory, virDomainSetMaxMemory) (virDomainSetMemory, virDomainSetMemoryFlags) (virNodeGetFreeMemory): Tweak wording. * docs/formatdomain.html.in: Likewise. * docs/formatstorage.html.in: Likewise. --- docs/formatdomain.html.in | 15 ++++++++------- docs/formatstorage.html.in | 12 ++++++++---- src/libvirt.c | 21 +++++++++++---------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 42f38d30b0..b7cfb388a0 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -424,7 +424,7 @@
memory
The maximum allocation of memory for the guest at boot time. - The units for this value are kilobytes (i.e. blocks of 1024 bytes)
+ The units for this value are kibibytes (i.e. blocks of 1024 bytes)
currentMemory
The actual allocation of memory for the guest. This value can be less than the maximum allocation, to allow for ballooning @@ -480,21 +480,21 @@ determine so one needs guess and try.
hard_limit
The optional hard_limit element is the maximum memory - the guest can use. The units for this value are kilobytes (i.e. blocks + the guest can use. The units for this value are kibibytes (i.e. blocks of 1024 bytes)
soft_limit
The optional soft_limit element is the memory limit to enforce during memory contention. The units for this value are - kilobytes (i.e. blocks of 1024 bytes)
+ kibibytes (i.e. blocks of 1024 bytes)
swap_hard_limit
The optional swap_hard_limit element is the maximum memory plus swap the guest can use. The units for this value are - kilobytes (i.e. blocks of 1024 bytes). This has to be more than + kibibytes (i.e. blocks of 1024 bytes). This has to be more than hard_limit value provided
min_guarantee
The optional min_guarantee element is the guaranteed minimum memory allocation for the guest. The units for this value are - kilobytes (i.e. blocks of 1024 bytes)
+ kibibytes (i.e. blocks of 1024 bytes)
@@ -774,7 +774,7 @@

Each cell element specifies a NUMA cell or a NUMA node. cpus specifies the CPU or range of CPUs that are part of - the node. memory specifies the node memory in kilobytes + the node. memory specifies the node memory in kibibytes (i.e. blocks of 1024 bytes). Each cell or node is assigned cellid or nodeid in the increasing order starting from 0.

@@ -2969,7 +2969,8 @@ qemu-kvm -net nic,model=? /dev/null attribute which takes the value "vga", "cirrus", "vmvga", "xen", "vbox", or "qxl" (since 0.8.6) depending on the hypervisor features available. - You can also provide the amount of video memory in kilobytes using + You can also provide the amount of video memory in kibibytes + (blocks of 1024 bytes) using vram and the number of screen with heads. diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 0dcf6df031..acb21faa81 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -234,11 +234,15 @@ to sparsely allocate a volume. It does not have to honour requests for sparse allocation though.

- By default this is specified in bytes, but an optional + By default this is specified in bytes, but an optional attribute unit can be specified to adjust the passed value. - Values can be: 'K' (kilobytes), 'M' (megabytes), 'G' (gigabytes), - 'T' (terabytes), 'P' (petabytes), or 'E' (exabytes). - Since 0.4.1 + Values can be: 'K' (kibibytes, 210 or 1024 bytes), + 'M' (mebibytes, 220 or 1,048,576 bytes), 'G' + (gibibytes, 230 or 1,073,741,824 bytes), 'T' + (tebibytes, 240 or 1,099,511,627,776 bytes), 'P' + (pebibytes, 250 or 1,125,899,906,842,624 bytes), or + 'E' (exbibytes, 260 or 1,152,921,504,606,846,976 + bytes). Since 0.4.1
capacity
Providing the logical capacity for the volume. This value is in bytes by default, but a unit attribute can be diff --git a/src/libvirt.c b/src/libvirt.c index c7e4673fe2..5de6e6800c 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -3582,7 +3582,8 @@ error: * domain. If domain is NULL, then this get the amount of memory reserved * to Domain0 i.e. the domain where the application runs. * - * Returns the memory size in kilobytes or 0 in case of error. + * Returns the memory size in kibibytes (blocks of 1024 bytes), or 0 in + * case of error. */ unsigned long virDomainGetMaxMemory(virDomainPtr domain) @@ -3619,7 +3620,7 @@ error: /** * virDomainSetMaxMemory: * @domain: a domain object or NULL - * @memory: the memory size in kilobytes + * @memory: the memory size in kibibytes (blocks of 1024 bytes) * * Dynamically change the maximum amount of physical memory allocated to a * domain. If domain is NULL, then this change the amount of memory reserved @@ -3674,7 +3675,7 @@ error: /** * virDomainSetMemory: * @domain: a domain object or NULL - * @memory: the memory size in kilobytes + * @memory: the memory size in kibibytes (blocks of 1024 bytes) * * Dynamically change the target amount of physical memory allocated to a * domain. If domain is NULL, then this change the amount of memory reserved @@ -3729,7 +3730,7 @@ error: /** * virDomainSetMemoryFlags: * @domain: a domain object or NULL - * @memory: the memory size in kilobytes + * @memory: the memory size in kibibytes (blocks of 1024 bytes) * @flags: bitwise-OR of virDomainMemoryModFlags * * Dynamically change the target amount of physical memory allocated to a @@ -6684,7 +6685,7 @@ error: * @conn: pointer to the hypervisor connection * * provides the free memory available on the Node - * Note: most libvirt APIs provide memory sizes in kilobytes, but in this + * Note: most libvirt APIs provide memory sizes in kibibytes, but in this * function the returned value is in bytes. Divide by 1024 as necessary. * * Returns the available free memory in bytes or 0 in case of error @@ -7605,11 +7606,11 @@ error: * @flags: bitwise-OR of virDomainBlockResizeFlags * * Resize a block device of domain while the domain is running. If - * @flags is 0, then @size is in kibibytes (blocks of 1024); since - * 0.9.11, if @flags includes VIR_DOMAIN_BLOCK_RESIZE_BYTES, @size is - * in bytes instead. @size is taken directly as the new size. - * Depending on the file format, the hypervisor may round up to the - * next alignment boundary. + * @flags is 0, then @size is in kibibytes (blocks of 1024 bytes); + * since 0.9.11, if @flags includes VIR_DOMAIN_BLOCK_RESIZE_BYTES, + * @size is in bytes instead. @size is taken directly as the new + * size. Depending on the file format, the hypervisor may round up + * to the next alignment boundary. * * The @disk parameter is either an unambiguous source name of the * block device (the sub-element, such as