Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1944985

Summary: [WRB][QEMU6.0 rc0]qmp command 'object-add' does not support 'props' parameter
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Yanan Fu <yfu>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
qemu-kvm sub component: QMP Monitor and CLI QA Contact: Yiqian Wei <yiwei>
Status: CLOSED NOTABUG Docs Contact:
Severity: high    
Priority: high CC: aliang, coli, jinzhao, juzhang, kwolf, lcheng, mrezanin, qinwang, virt-maint, xfu, xuwei, yfu, yisun, ymankad, yuhuang, zixchen
Version: 8.5Flags: pm-rhel: mirror+
Target Milestone: beta   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-06 09:56:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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"}