Bug 1944985 - [WRB][QEMU6.0 rc0]qmp command 'object-add' does not support 'props' parameter
Summary: [WRB][QEMU6.0 rc0]qmp command 'object-add' does not support 'props' parameter
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.5
Hardware: All
OS: All
high
high
Target Milestone: beta
: ---
Assignee: Virtualization Maintenance
QA Contact: Yiqian Wei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-31 07:05 UTC by Yanan Fu
Modified: 2021-06-22 08:21 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-06 09:56:33 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yanan Fu 2021-03-31 07:05:24 UTC
Description of problem:
QEMU 6.0, does not support using 'props' to add multiple properties for qmp command 'object-add'

Version-Release number of selected component (if applicable):
qemu-kvm-6.0.0-14rc0.scrmod+el8.5.0+10480+a8e067ae.wrb210325
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1550013

How reproducible:
100%

Steps to Reproduce:
1. Create a luks image by command: 
# /usr/bin/qemu-img create --object secret,id=stg0_encrypt0,data=redhat -f luks -o key-secret=stg0_encrypt0 /home/kvm_autotest_root/images/storage0.luks 30G

2. Boot VM with a qmp monitor
    -chardev socket,id=qmp_id_qmpmonitor1,nowait,server,path=/tmp/avocado_fscgpw90/monitor-qmpmonitor1-20210331-023641-unuXWLx8  \
    -mon chardev=qmp_id_qmpmonitor1,mode=control \

3. Start to hotplug devices "stg0" by monitor qmpmonitor1
2021-03-31 02:37:50: {"execute": "object-add", "arguments": {"qom-type": "secret", "id": "stg0_encrypt0", "props": {"data": "redhat"}}, "id": "zjucmzTH"}
2021-03-31 02:37:50: {"id": "zjucmzTH", "error": {"class": "GenericError", "desc": "Parameter 'props' is unexpected"}}


Actual results:
hotplug failed as "Parameter 'props' is unexpected"

Expected results:
For the old version, props is a dict to handle multiple properties, it work well.


Additional info:
memory hotplug which use 'object-add' command failed as:
12:03:56: {"execute": "object-add", "arguments": {"qom-type": "memory-backend-ram", "id": "mem-plug1", "props": {"size": 1073741824, "policy": "default"}}, "id": "PpDR2Rg7"}
12:03:56: {"id": "PpDR2Rg7", "error": {"class": "GenericError", "desc": "Parameter 'size' is missing"}}


I think the root cause is same, 'props' was handled incorrectly cause it can't get the 'size'.
As the change from memory side, 'size' is must, so it raise the exception 'size is missing' before 'Parameter 'props' is unexpected'.

Comment 1 Yanan Fu 2021-03-31 07:18:56 UTC
After review the code change, i got:

commit 50243407457a9fb0ed17b9a9ba9fc9aee09495b1
Author: Kevin Wolf <kwolf>
Date:   Fri Nov 27 18:11:02 2020 +0100

    qapi/qom: Drop deprecated 'props' from object-add
    
    The option has been deprecated in QEMU 5.0, remove it.
    
    Signed-off-by: Kevin Wolf <kwolf>
    Acked-by: Paolo Bonzini <pbonzini>
    Acked-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>



So, this is the expected result ?

Hi Kevin,
Could you help check this, without the props, we need add all the properties one by one, is it ?

Comment 2 John Ferlan 2021-04-05 18:22:53 UTC
Move to RHEL-AV

Comment 3 Kevin Wolf 2021-04-06 09:56:33 UTC
(In reply to Yanan Fu from comment #1)
> So, this is the expected result ?

Yes, this is expected. It seems that you were manually sending QMP commands, so it's not a layered product that missed the change and is affected, right? I'm closing as NOTABUG now, but if a layered product can't handle the change, we would need to reopen and move it there.
 
> Hi Kevin,
> Could you help check this, without the props, we need add all the properties
> one by one, is it ?

You just need to specify all properties on the top level now, like this:

{"execute": "object-add", "arguments": {"qom-type": "memory-backend-ram", "id": "mem-plug1", "size": 1073741824, "policy": "default"}, "id": "PpDR2Rg7"}

Comment 4 Yanan Fu 2021-04-06 15:12:20 UTC
(In reply to Kevin Wolf from comment #3)
> (In reply to Yanan Fu from comment #1)
> > So, this is the expected result ?
> 
> Yes, this is expected. It seems that you were manually sending QMP commands,
> so it's not a layered product that missed the change and is affected, right?
> I'm closing as NOTABUG now, but if a layered product can't handle the
> change, we would need to reopen and move it there.
>  

Yes, i tested with qemu-kvm directly, will update our auto script accordingly.

Just tried with libvirt-7.0.0, it still use 'props' now:
{"execute":"object-add","arguments":{"qom-type":"memory-backend-ram","id":"memdimm0","props":{"size":524288000}},"id":"libvirt-380"}


This is a upstream QEMU testing, will pay attention to this issue when it be consumed
by downstream libvirt, thanks!


> > Hi Kevin,
> > Could you help check this, without the props, we need add all the properties
> > one by one, is it ?
> 
> You just need to specify all properties on the top level now, like this:
> 
> {"execute": "object-add", "arguments": {"qom-type": "memory-backend-ram",
> "id": "mem-plug1", "size": 1073741824, "policy": "default"}, "id":
> "PpDR2Rg7"}


Note You need to log in before you can comment on or make changes to this bug.