[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure |
Date: |
Wed, 27 Nov 2013 08:25:22 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 11/20/2013 07:38 PM, Igor Mammedov wrote:
> Provides framework for splitting host RAM allocation/
> policies into a separate backend that could be used
> by devices. It would allow to separate host specific
> options from device model like it's done for netdev & co.
Just an interface review:
> +++ b/hmp-commands.hx
> @@ -1719,3 +1719,16 @@ ETEXI
> STEXI
> @end table
> ETEXI
> +
> + {
> + .name = "memdev-add",
Typically, we've been naming HMP commands with underscore: memdev_add
> +++ b/qapi-schema.json
> @@ -4212,3 +4212,21 @@
> # Since: 1.7
> ##
> { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
> +
> +##
> +# @memdev_add:
Whereas QMP commands have a dash: memdev-add
> +#
> +# Add a host memory backend.
> +#
> +# @id: the name of the new memory backend
> +# @size: amount of memory backend should allocate
Maybe add "in bytes" somewhere in the phrase to make it clear
> +# @type: backend type. [default: compat-ram-host-memory]
That's the default, but what other types are valid? I'd much rather
have an enum of valid types than an open-coded string.
> +#
> +# Since: 1.8
> +#
> +# Returns: Nothing on success
> +##
> +{ 'command': 'memdev-add',
Ah, you did name the QMP command with dash, so it's the docs above that
are wrong.
> + 'data': {'id': 'str', 'size': 'size', '*type': 'str'},
> + 'gen': 'no'
> +}
> +Arguments:
> +
> +- "id": the device's ID, must be unique (json-string)
> +- "size": amount of memory backend should allocate (json-int)
> +- "type": backend type (json-string, optional), default:
> compat-ram-host-memory
> +
> +Example:
>
> +-> { "execute": "memdev-add",
> + "arguments": { "id": "memdev1",
> + "size": "1G",
I don't think this is valid QMP; you want to be passing sizes in bytes
as an integer, not as a string that requires further parsing.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor, (continued)
[Qemu-devel] [PATCH 06/27] get reference to /backend container via qemu_get_backend(), Igor Mammedov, 2013/11/20
[Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/20
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/27
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Paolo Bonzini, 2013/11/27
- Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure, Igor Mammedov, 2013/11/27
Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure,
Eric Blake <=
[Qemu-devel] [PATCH 08/27] dimm: implement dimm device abstraction, Igor Mammedov, 2013/11/20
[Qemu-devel] [PATCH 09/27] dimm: map DimmDevice into DimBus provided address space, Igor Mammedov, 2013/11/20
[Qemu-devel] [PATCH 10/27] dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2013/11/20
[Qemu-devel] [PATCH 11/27] dimm: add busy address check and address auto-allocation, Igor Mammedov, 2013/11/20
[Qemu-devel] [PATCH 13/27] acpi: memory hotplug ACPI hardware implementation, Igor Mammedov, 2013/11/20