[SeaBIOS] [RFC PATCH v4 19/30] Implement "info memory-total" and "query-memory-total"

Eric Blake eblake at redhat.com
Fri Jan 4 17:21:08 CET 2013


On 12/18/2012 05:41 AM, Vasilis Liaskovitis wrote:
> Returns total physical memory available to guest in bytes, including hotplugged
> memory. Note that the number reported here may be different from what the guest
> sees e.g. if the guest has not logically onlined hotplugged memory.
> 
> This functionality is provided independently of a balloon device, since a
> guest can be using ACPI memory hotplug without using a balloon device.
> 
> v3->v4: Moved qmp command implementation to vl.c. This prevents a circular
> header dependency problem.

Generally, patch change history should occur...

> 
> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis at profitbricks.com>
> ---

...here, after the --- divider.  It's useful in the email chain, but
does not need to be part of the final git history.

> +++ b/qapi-schema.json
> @@ -2903,6 +2903,17 @@
>  { 'command': 'query-target', 'returns': 'TargetInfo' }
>  
>  ##
> +# @query-memory-total:
> +#
> +# Returns total memory in bytes, including hotplugged dimms
> +#
> +# Returns: int
> +#
> +# Since: 1.4
> +##
> +{ 'command': 'query-memory-total', 'returns': 'int' }

Any reason you can't name this just 'query-memory', and return a JSON
dictionary instead of a single int, so that in the future you can add
other memory parameters into the same call?  For example, down the road
we may want to report some 'newstat' without adding a new QMP command:

{ 'type': 'MemoryInfo',
  'data': { 'total': 'int', 'newstat': 'int' } }
{ 'command': 'query-memory', 'returns': 'MemoryInfo' }

-- 
Eric Blake   eblake 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: 619 bytes
Desc: OpenPGP digital signature
URL: <http://www.seabios.org/pipermail/seabios/attachments/20130104/dc706f52/attachment-0001.sig>


More information about the SeaBIOS mailing list