Bug 2001316

Summary: Unclear error message while hotplugging the same chardev
Product: Red Hat Enterprise Linux 9 Reporter: John Ferlan <jferlan>
Component: qemu-kvmAssignee: Marc-Andre Lureau <marcandre.lureau>
qemu-kvm sub component: General QA Contact: liunana <nanliu>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: chayang, jinzhao, juzhang, marcandre.lureau, mdeng, mrezanin, nanliu, virt-maint, yfu
Version: 9.0Keywords: Regression, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qem-kvm-6.1.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1984721 Environment:
Last Closed: 2022-05-17 12:24:17 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:
Bug Depends On: 1984721, 1997408    
Bug Blocks:    

Description John Ferlan 2021-09-05 13:53:23 UTC
+++ This bug was initially created as a clone of Bug #1984721 +++

Description of problem:
unclear error message while hotplugging the same chardev


Version-Release number of selected component (if applicable):
Host:    
    kernel-4.18.0-323.el8.x86_64 
    qemu-kvm-6.0.0-24.module+el8.5.0+11844+1e3017bd.x86_64
    



How reproducible: 100%


Steps to Reproduce:
1. Boot qemu with cmdline:
   /usr/libexec/qemu-kvm -monitor stdio -qmp tcp:0:4445,server=on,wait=off

2. Hotplug chardev:
  {"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
  {"return": {}}

3. Hotplug the same chardev again:
  {"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
  {"error": {"class": "GenericError", "desc": "duplicate yank instance"}}

Actual results:
Can't tell what's the reason that cause the failure of hotplugging.


Expected results:
We should have reported
that the "id" value for the two chardevs is clashing.


Additional info:

--- Additional comment from liunana on 2021-07-22 02:43:42 UTC ---

Slow train has no such issue:
    qemu-kvm-4.2.0-53.module+el8.5.0+11673+72138537.x86_64


{"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
{"return": {}}
{"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
{"error": {"class": "GenericError", "desc": "attempt to add duplicate property 'char2' to object (type 'container')"}}

--- Additional comment from Marc-Andre Lureau on 2021-07-28 11:34:05 UTC ---


Would this be good enough?

{"error": {"class": "GenericError", "desc": "Failed to open chardev 'char2': duplicate yank instance"}}


> {"error": {"class": "GenericError", "desc": "attempt to add duplicate property 'char2' to object (type 'container')"}}

wasn't very friendly either..

--- Additional comment from liunana on 2021-07-30 09:39:31 UTC ---

(In reply to Marc-Andre Lureau from comment #2)
> Would this be good enough?
> 
> {"error": {"class": "GenericError", "desc": "Failed to open chardev 'char2':
> duplicate yank instance"}}
> 

Hi,

It's good to contain the duplicate chardev id, thanks.
But seems 'open chardev' is not a match error log for duplicate hotplugging the same chardev.

How about:

{"error": {"class": "GenericError", "desc": "Failed to add chardev 'char2': duplicate yank instance"}}



Besides, would you please help to explain more about what's the 'yank' function in the error log? Thanks.


> 
> > {"error": {"class": "GenericError", "desc": "attempt to add duplicate property 'char2' to object (type 'container')"}}
> 
> wasn't very friendly either.


Seems clearer than "duplicate yank instance".




Best regards
Liu Nana

--- Additional comment from John Ferlan on 2021-08-09 13:25:32 UTC ---

Moving this to 8.6, in POST, and setting DTM=5 since this can be tested/validated using the weekly rebase as the fix has gone into qemu-6.1.

Decision was to not backport for AV 8.5 since it's really an error path for newer code (yank functionality) that isn't necessarily reachable via libvirt or other means at this point. Neither RHV nor OSP will use 8.5.

Comment 1 Yanan Fu 2021-10-12 06:48:41 UTC
Set 'Verified:Tested,SanityOnly' as gating test with qemu-kvm-6.1.0-1.el9 pass

Comment 2 liunana 2021-10-14 07:24:16 UTC
Test Env:
    5.14.0-4.el9.x86_64
    qemu-kvm-6.1.0-1.el9.x86_64

Test PASS with steps:

1. Boot qemu with: 
# /usr/libexec/qemu-kvm -monitor stdio -qmp tcp:0:4445,server=on,wait=off

2. hotplug same chardev twice, can get the clear error log.
{"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
{"return": {}}

{"execute":"chardev-add","arguments":{"id":"char2","backend":{"type":"socket","data":{"addr":{"type":"unix", "data": {"path": "/home/mm"}}}}}}
{"error": {"class": "GenericError", "desc": "Chardev with id 'char2' already exists"}}


I will move this bug to verified directly once it is ON_QA. Thanks.



Best regards
Liu Nana

Comment 6 liunana 2021-12-20 03:26:06 UTC
Move this bug to VERIRFIED according to Comment 2.

Comment 8 errata-xmlrpc 2022-05-17 12:24:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: qemu-kvm), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2307