qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use QMP command object-add instead of object_add for memory hotplugin
@ 2022-09-08  9:52 liuhaiwei
  2022-09-08 11:41 ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: liuhaiwei @ 2022-09-08  9:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, eduardo, eblake, armbru, liuhaiwei

From: liuhaiwei <liuhaiwei@inspur.com>

Signed-off-by: liuhaiwei <liuhaiwei@inspur.com>
---
 docs/memory-hotplug.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/memory-hotplug.txt b/docs/memory-hotplug.txt
index 6aa5e17e26..85ed4d8f3d 100644
--- a/docs/memory-hotplug.txt
+++ b/docs/memory-hotplug.txt
@@ -34,15 +34,15 @@ hotplugged by using any combination of the available memory slots.
 
 Two monitor commands are used to hotplug memory:
 
- - "object_add": creates a memory backend object
+ - "object-add": creates a memory backend object
  - "device_add": creates a front-end pc-dimm device and inserts it
                  into the first empty slot
 
 For example, the following commands add another 1GB to the guest
 discussed earlier:
 
-  (qemu) object_add memory-backend-ram,id=mem1,size=1G
-  (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
+  (qemu) object-add qom-type=memory-backend-ram id=mem1 size=1073741824
+  (qemu) device_add driver=pc-dimm id=dimm1 memdev=mem1
 
 Using the file backend
 ----------------------
@@ -55,7 +55,7 @@ For example, assuming that the host has 1GB hugepages available in
 the /mnt/hugepages-1GB directory, a 1GB hugepage could be hotplugged
 into the guest from the previous section with the following commands:
 
-  (qemu) object_add memory-backend-file,id=mem1,size=1G,mem-path=/mnt/hugepages-1GB
+  (qemu) object-add qom-type=memory-backend-file id=mem1  size=1073741824 mem-path=/mnt/hugepages-1GB 
   (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
 
 It's also possible to start a guest with memory cold-plugged into the
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Use QMP command object-add instead of object_add for memory hotplugin
  2022-09-08  9:52 [PATCH] Use QMP command object-add instead of object_add for memory hotplugin liuhaiwei
@ 2022-09-08 11:41 ` Markus Armbruster
  2022-09-08 11:52   ` liuhaiwei9699
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2022-09-08 11:41 UTC (permalink / raw)
  To: liuhaiwei; +Cc: qemu-devel, pbonzini, eduardo, eblake, armbru, liuhaiwei

liuhaiwei <liuhaiwei9699@126.com> writes:

> From: liuhaiwei <liuhaiwei@inspur.com>
>
> Signed-off-by: liuhaiwei <liuhaiwei@inspur.com>
> ---
>  docs/memory-hotplug.txt | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/docs/memory-hotplug.txt b/docs/memory-hotplug.txt
> index 6aa5e17e26..85ed4d8f3d 100644
> --- a/docs/memory-hotplug.txt
> +++ b/docs/memory-hotplug.txt
> @@ -34,15 +34,15 @@ hotplugged by using any combination of the available memory slots.
>  
>  Two monitor commands are used to hotplug memory:
>  
> - - "object_add": creates a memory backend object
> + - "object-add": creates a memory backend object
>   - "device_add": creates a front-end pc-dimm device and inserts it
>                   into the first empty slot
>  
>  For example, the following commands add another 1GB to the guest
>  discussed earlier:
>  
> -  (qemu) object_add memory-backend-ram,id=mem1,size=1G
> -  (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
> +  (qemu) object-add qom-type=memory-backend-ram id=mem1 size=1073741824
> +  (qemu) device_add driver=pc-dimm id=dimm1 memdev=mem1

This is HMP, where the command is spelled object_add.  Your patch is
wrong.

>  
>  Using the file backend
>  ----------------------
> @@ -55,7 +55,7 @@ For example, assuming that the host has 1GB hugepages available in
>  the /mnt/hugepages-1GB directory, a 1GB hugepage could be hotplugged
>  into the guest from the previous section with the following commands:
>  
> -  (qemu) object_add memory-backend-file,id=mem1,size=1G,mem-path=/mnt/hugepages-1GB

Likewise.

> +  (qemu) object-add qom-type=memory-backend-file id=mem1  size=1073741824 mem-path=/mnt/hugepages-1GB 
>    (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
>  
>  It's also possible to start a guest with memory cold-plugged into the



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:Re: [PATCH] Use QMP command object-add instead of object_add for memory hotplugin
  2022-09-08 11:41 ` Markus Armbruster
@ 2022-09-08 11:52   ` liuhaiwei9699
  2022-09-08 12:34     ` Markus Armbruster
  0 siblings, 1 reply; 5+ messages in thread
From: liuhaiwei9699 @ 2022-09-08 11:52 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, pbonzini, eduardo, eblake, liuhaiwei

[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]

why the hmp using the object_add , qmp using the object-add command?
can't we use the same command ?

















At 2022-09-08 19:41:33, "Markus Armbruster" <armbru@redhat.com> wrote:
>liuhaiwei <liuhaiwei9699@126.com> writes:
>
>> From: liuhaiwei <liuhaiwei@inspur.com>
>>
>> Signed-off-by: liuhaiwei <liuhaiwei@inspur.com>
>> ---
>>  docs/memory-hotplug.txt | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/docs/memory-hotplug.txt b/docs/memory-hotplug.txt
>> index 6aa5e17e26..85ed4d8f3d 100644
>> --- a/docs/memory-hotplug.txt
>> +++ b/docs/memory-hotplug.txt
>> @@ -34,15 +34,15 @@ hotplugged by using any combination of the available memory slots.
>>  
>>  Two monitor commands are used to hotplug memory:
>>  
>> - - "object_add": creates a memory backend object
>> + - "object-add": creates a memory backend object
>>   - "device_add": creates a front-end pc-dimm device and inserts it
>>                   into the first empty slot
>>  
>>  For example, the following commands add another 1GB to the guest
>>  discussed earlier:
>>  
>> -  (qemu) object_add memory-backend-ram,id=mem1,size=1G
>> -  (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
>> +  (qemu) object-add qom-type=memory-backend-ram id=mem1 size=1073741824
>> +  (qemu) device_add driver=pc-dimm id=dimm1 memdev=mem1
>
>This is HMP, where the command is spelled object_add.  Your patch is
>wrong.
>
>>  
>>  Using the file backend
>>  ----------------------
>> @@ -55,7 +55,7 @@ For example, assuming that the host has 1GB hugepages available in
>>  the /mnt/hugepages-1GB directory, a 1GB hugepage could be hotplugged
>>  into the guest from the previous section with the following commands:
>>  
>> -  (qemu) object_add memory-backend-file,id=mem1,size=1G,mem-path=/mnt/hugepages-1GB
>
>Likewise.
>
>> +  (qemu) object-add qom-type=memory-backend-file id=mem1  size=1073741824 mem-path=/mnt/hugepages-1GB 
>>    (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
>>  
>>  It's also possible to start a guest with memory cold-plugged into the

[-- Attachment #2: Type: text/html, Size: 2706 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Use QMP command object-add instead of object_add for memory hotplugin
  2022-09-08 11:52   ` liuhaiwei9699
@ 2022-09-08 12:34     ` Markus Armbruster
  2022-09-08 12:55       ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2022-09-08 12:34 UTC (permalink / raw)
  To: liuhaiwei9699
  Cc: qemu-devel, pbonzini, eduardo, eblake, liuhaiwei,
	David Alan Gilbert

liuhaiwei9699  <liuhaiwei9699@126.com> writes:

> why the hmp using the object_add , qmp using the object-add command?
> can't we use the same command ?

Command names differ between HMP and QMP for historical reasons.

QMP is a stable interface, and changing names there is no go.

HMP is not a stable interface, but changing names would still
inconvenience users.  We don't do that without really compelling
reasons.

I think HMP could fold '_' and '-' together in command names, so that
both object_add and object-add work.  Best to check with the HMP
maintainer before you start coding.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Use QMP command object-add instead of object_add for memory hotplugin
  2022-09-08 12:34     ` Markus Armbruster
@ 2022-09-08 12:55       ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 5+ messages in thread
From: Dr. David Alan Gilbert @ 2022-09-08 12:55 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: liuhaiwei9699, qemu-devel, pbonzini, eduardo, eblake, liuhaiwei

* Markus Armbruster (armbru@redhat.com) wrote:
> liuhaiwei9699  <liuhaiwei9699@126.com> writes:
> 
> > why the hmp using the object_add , qmp using the object-add command?
> > can't we use the same command ?
> 
> Command names differ between HMP and QMP for historical reasons.
> 
> QMP is a stable interface, and changing names there is no go.
> 
> HMP is not a stable interface, but changing names would still
> inconvenience users.  We don't do that without really compelling
> reasons.
> 
> I think HMP could fold '_' and '-' together in command names, so that
> both object_add and object-add work.  Best to check with the HMP
> maintainer before you start coding.

Yes, I'd be up for having folding on _/- - I never remember which I need
in any case.

Dave

-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-08 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08  9:52 [PATCH] Use QMP command object-add instead of object_add for memory hotplugin liuhaiwei
2022-09-08 11:41 ` Markus Armbruster
2022-09-08 11:52   ` liuhaiwei9699
2022-09-08 12:34     ` Markus Armbruster
2022-09-08 12:55       ` Dr. David Alan Gilbert

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).