* [PATCH 0/2] qmp: Expose MachineClass::default_ram_id @ 2020-05-25 17:03 Michal Privoznik 2020-05-25 17:03 ` [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties Michal Privoznik 2020-05-25 17:03 ` [PATCH 2/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik 0 siblings, 2 replies; 6+ messages in thread From: Michal Privoznik @ 2020-05-25 17:03 UTC (permalink / raw) To: qemu-devel; +Cc: imammedo, ehabkost, armbru The important patch is 2/2. Michal Privoznik (2): qapi: Fix comment format for @CpuInstanceProperties qmp: Expose MachineClass::default_ram_id hw/core/machine-qmp-cmds.c | 1 + qapi/machine.json | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.26.2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties 2020-05-25 17:03 [PATCH 0/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik @ 2020-05-25 17:03 ` Michal Privoznik 2020-05-26 20:02 ` Eric Blake 2020-05-25 17:03 ` [PATCH 2/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik 1 sibling, 1 reply; 6+ messages in thread From: Michal Privoznik @ 2020-05-25 17:03 UTC (permalink / raw) To: qemu-devel; +Cc: imammedo, ehabkost, armbru In 176d2cda0de, the @die-id attribute was introduced to CpuInstanceProperties type. However, it mangled the comment. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- qapi/machine.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index ff7b5032e3..39caa1d914 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -824,7 +824,8 @@ # @node-id: NUMA node ID the CPU belongs to # @socket-id: socket number within node/board the CPU belongs to # @die-id: die number within node/board the CPU belongs to (Since 4.1) -# @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to +# @core-id: core number within die the CPU belongs to +# @thread-id: thread number within core the CPU belongs to # # Note: currently there are 5 properties that could be present # but management should be prepared to pass through other -- 2.26.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties 2020-05-25 17:03 ` [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties Michal Privoznik @ 2020-05-26 20:02 ` Eric Blake 0 siblings, 0 replies; 6+ messages in thread From: Eric Blake @ 2020-05-26 20:02 UTC (permalink / raw) To: Michal Privoznik, qemu-devel; +Cc: imammedo, ehabkost, armbru On 5/25/20 12:03 PM, Michal Privoznik wrote: > In 176d2cda0de, the @die-id attribute was introduced to > CpuInstanceProperties type. However, it mangled the comment. > > Signed-off-by: Michal Privoznik <mprivozn@redhat.com> > --- > qapi/machine.json | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake <eblake@redhat.com> > > diff --git a/qapi/machine.json b/qapi/machine.json > index ff7b5032e3..39caa1d914 100644 > --- a/qapi/machine.json > +++ b/qapi/machine.json > @@ -824,7 +824,8 @@ > # @node-id: NUMA node ID the CPU belongs to > # @socket-id: socket number within node/board the CPU belongs to > # @die-id: die number within node/board the CPU belongs to (Since 4.1) > -# @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to > +# @core-id: core number within die the CPU belongs to > +# @thread-id: thread number within core the CPU belongs to > # > # Note: currently there are 5 properties that could be present > # but management should be prepared to pass through other > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] qmp: Expose MachineClass::default_ram_id 2020-05-25 17:03 [PATCH 0/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik 2020-05-25 17:03 ` [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties Michal Privoznik @ 2020-05-25 17:03 ` Michal Privoznik 2020-05-25 18:06 ` Eduardo Habkost 1 sibling, 1 reply; 6+ messages in thread From: Michal Privoznik @ 2020-05-25 17:03 UTC (permalink / raw) To: qemu-devel; +Cc: imammedo, ehabkost, armbru If a management application (like Libvirt) want's to preserve migration ability and switch to '-machine memory-backend' it needs to set exactly the same RAM id as QEMU would. Since the id is machine type dependant, expose it under 'query-machines' result. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- hw/core/machine-qmp-cmds.c | 1 + qapi/machine.json | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 2c5da8413d..8333e674ce 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -234,6 +234,7 @@ MachineInfoList *qmp_query_machines(Error **errp) info->hotpluggable_cpus = mc->has_hotpluggable_cpus; info->numa_mem_supported = mc->numa_mem_supported; info->deprecated = !!mc->deprecation_reason; + info->default_ram_id = g_strdup(mc->default_ram_id); if (mc->default_cpu_type) { info->default_cpu_type = g_strdup(mc->default_cpu_type); info->has_default_cpu_type = true; diff --git a/qapi/machine.json b/qapi/machine.json index 39caa1d914..e5647c4031 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -352,6 +352,8 @@ # in future versions of QEMU according to the QEMU deprecation # policy (since 4.1.0) # +# @default-ram-id: the default name of initial RAM memory region (since 5.1) +# # @default-cpu-type: default CPU model typename if none is requested via # the -cpu argument. (since 4.2) # @@ -361,7 +363,8 @@ 'data': { 'name': 'str', '*alias': 'str', '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', - 'deprecated': 'bool', '*default-cpu-type': 'str' } } + 'deprecated': 'bool', 'default-ram-id': 'str', + '*default-cpu-type': 'str' } } ## # @query-machines: -- 2.26.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] qmp: Expose MachineClass::default_ram_id 2020-05-25 17:03 ` [PATCH 2/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik @ 2020-05-25 18:06 ` Eduardo Habkost 2020-05-26 8:06 ` Michal Privoznik 0 siblings, 1 reply; 6+ messages in thread From: Eduardo Habkost @ 2020-05-25 18:06 UTC (permalink / raw) To: Michal Privoznik; +Cc: imammedo, qemu-devel, armbru On Mon, May 25, 2020 at 07:03:28PM +0200, Michal Privoznik wrote: > If a management application (like Libvirt) want's to preserve > migration ability and switch to '-machine memory-backend' it > needs to set exactly the same RAM id as QEMU would. Since the id > is machine type dependant, expose it under 'query-machines' > result. > > Signed-off-by: Michal Privoznik <mprivozn@redhat.com> The code looks good, but documentation was a bit confusing: > --- [...] > +# @default-ram-id: the default name of initial RAM memory region (since 5.1) > +# Everywhere else in the commit message you call it "id", but here you say "name". Also, I don't think we have any references to a "memory region" abstraction in the docs for the QAPI schema, -machine options, or memory backend objects. I had to look it up in the code, to finally understand you were talking about the memory backend object ID. To make it consistent with terminology used for -machine and QAPI, I suggest: @default-ram-id: the default ID of initial RAM memory backend (since 5.1) I can change it before committing, if you agree. > # @default-cpu-type: default CPU model typename if none is requested via > # the -cpu argument. (since 4.2) > # > @@ -361,7 +363,8 @@ > 'data': { 'name': 'str', '*alias': 'str', > '*is-default': 'bool', 'cpu-max': 'int', > 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', > - 'deprecated': 'bool', '*default-cpu-type': 'str' } } > + 'deprecated': 'bool', 'default-ram-id': 'str', > + '*default-cpu-type': 'str' } } > > ## > # @query-machines: > -- > 2.26.2 > -- Eduardo ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] qmp: Expose MachineClass::default_ram_id 2020-05-25 18:06 ` Eduardo Habkost @ 2020-05-26 8:06 ` Michal Privoznik 0 siblings, 0 replies; 6+ messages in thread From: Michal Privoznik @ 2020-05-26 8:06 UTC (permalink / raw) To: Eduardo Habkost; +Cc: imammedo, qemu-devel, armbru On 5/25/20 8:06 PM, Eduardo Habkost wrote: > On Mon, May 25, 2020 at 07:03:28PM +0200, Michal Privoznik wrote: >> If a management application (like Libvirt) want's to preserve >> migration ability and switch to '-machine memory-backend' it >> needs to set exactly the same RAM id as QEMU would. Since the id >> is machine type dependant, expose it under 'query-machines' >> result. >> >> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> > > The code looks good, but documentation was a bit confusing: > >> --- > [...] >> +# @default-ram-id: the default name of initial RAM memory region (since 5.1) >> +# > > Everywhere else in the commit message you call it "id", but here > you say "name". Also, I don't think we have any references to a > "memory region" abstraction in the docs for the QAPI schema, > -machine options, or memory backend objects. > > I had to look it up in the code, to finally understand you were > talking about the memory backend object ID. > > To make it consistent with terminology used for -machine and > QAPI, I suggest: > > @default-ram-id: the default ID of initial RAM memory backend (since 5.1) > > I can change it before committing, if you agree. Thanks for the offer, but I will post a v2, because as I was developing patches for libvirt to consume this I found out that some machine types don't have the attribute set (riscv is one of them). Therefore I will have to make this optional. Michal ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-26 20:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-05-25 17:03 [PATCH 0/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik 2020-05-25 17:03 ` [PATCH 1/2] qapi: Fix comment format for @CpuInstanceProperties Michal Privoznik 2020-05-26 20:02 ` Eric Blake 2020-05-25 17:03 ` [PATCH 2/2] qmp: Expose MachineClass::default_ram_id Michal Privoznik 2020-05-25 18:06 ` Eduardo Habkost 2020-05-26 8:06 ` Michal Privoznik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).