Bug 970551 - failed pci-serial hotplug leaves the chardev busy
failed pci-serial hotplug leaves the chardev busy
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Gerd Hoffmann
Min Deng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-04 06:05 EDT by Paolo Bonzini
Modified: 2016-09-14 05:13 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu-2.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-14 05:13:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paolo Bonzini 2013-06-04 06:05:10 EDT
The following commands reproduce the issue:

chardev-add file,path=foo2,id=foo2
chardev-add file,path=foo3,id=foo3
device_add id=gg,driver=pci-serial-2x,chardev1=foo2,chardev2=foo2
device_add id=gg,driver=pci-serial-2x,chardev1=foo2,chardev2=foo3

The third command reports

Property 'pci-serial-2x.chardev1' can't take value 'foo2', it's in use

The fourth command then fails, but it should work because foo2 is not in use.  Note that "device_del gg" also fails.
Comment 2 Min Deng 2013-06-05 07:12:38 EDT
Hi Paolo,
  QE reproduce the issue via QMP
  Build info,
  qemu-kvm-common-1.5.0-2.el7.x86_64
  qemu-kvm-tools-1.5.0-2.el7.x86_64
  qemu-kvm-1.5.0-2.el7.x86_64
   qemu-kvm-debuginfo-1.5.0-2.el7.x86_64
Steps,
1.Boot up guest with the following CLI,
/usr/libexec/qemu-kvm -cpu SandyBridge -M pc-i440fx-1.5 -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo-test -uuid a5fd4bfe-ccbf-403d-9a26-41b1b3843729 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet0,id=rtl8139-net-pci0,mac=08:2e:5f:0a:0d:a1,bus=pci.0,addr=0x5,bootindex=2 -monitor stdio -vnc :3 -qmp tcp:0:4444,server,nowait

2.{"execute":"chardev-add","arguments":{"id":"bar7","backend":{"type":"file","data":{"out":"/tmp/log7"}}}}

3.{"execute":"chardev-add","arguments":{"id":"bar8","backend":{"type":"file","data":{"out":"/tmp/log8"}}}}

4.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":"bar7","chardev2":"bar7","id":"gate7"}}

5.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":"bar7","chardev2":"bar8","id":"gate8"}}

Actual results,
  At step 5,it prompts that the chardev named bar7 is in use.I didn't reproduce it via the following steps.

a.{"execute":"chardev-add","arguments":{"id":"bar9","backend":{"type":"file","data":{"out":"/tmp/log9"}}}}
{"return": {}}

b.{"execute":"chardev-add","arguments":{"id":"bar10","backend":{"type":"file","data":{"out":"/tmp/log10"}}}}

c.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":"bar9","chardev2":"bar10","id":"gate10"}}
{"return": {}}

Expected results,
There is not any improper error message.

  Any issues please let me know,thanks

Best Regards,
Min
Comment 3 Min Deng 2013-06-05 23:44:29 EDT
(In reply to dengmin from comment #2)
> Hi Paolo,
>   QE reproduce the issue via QMP
>   Build info,
>   qemu-kvm-common-1.5.0-2.el7.x86_64
>   qemu-kvm-tools-1.5.0-2.el7.x86_64
>   qemu-kvm-1.5.0-2.el7.x86_64
>    qemu-kvm-debuginfo-1.5.0-2.el7.x86_64
> Steps,
> 1.Boot up guest with the following CLI,
> /usr/libexec/qemu-kvm -cpu SandyBridge -M pc-i440fx-1.5 -enable-kvm -m 4G
> -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -usb -device
> usb-tablet,id=input0 -name sluo-test -uuid
> a5fd4bfe-ccbf-403d-9a26-41b1b3843729 -rtc
> base=localtime,clock=host,driftfix=slew -device
> virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,
> addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait
> -device
> virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-
> serial0.0,id=port1 -chardev
> socket,id=channel2,path=/tmp/helloworld2,server,nowait -device
> virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-
> serial0.0,id=port2 -drive
> file=RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-system-disk,
> format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device
> virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-disk,
> bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device
> rtl8139,netdev=hostnet0,id=rtl8139-net-pci0,mac=08:2e:5f:0a:0d:a1,bus=pci.0,
> addr=0x5,bootindex=2 -monitor stdio -vnc :3 -qmp tcp:0:4444,server,nowait
> 
> 2.{"execute":"chardev-add","arguments":{"id":"bar7","backend":{"type":"file",
> "data":{"out":"/tmp/log7"}}}}
> 
> 3.{"execute":"chardev-add","arguments":{"id":"bar8","backend":{"type":"file",
> "data":{"out":"/tmp/log8"}}}}
> 
> 4.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":
> "bar7","chardev2":"bar7","id":"gate7"}}
> 
> 5.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":
> "bar7","chardev2":"bar8","id":"gate8"}}
> 
> Actual results,
>   At step 5,it prompts that the chardev named bar7 is in use.I didn't
> reproduce it via the following steps.
> 
> a.{"execute":"chardev-add","arguments":{"id":"bar9","backend":{"type":"file",
> "data":{"out":"/tmp/log9"}}}}
> {"return": {}}
> 
> b.{"execute":"chardev-add","arguments":{"id":"bar10","backend":{"type":
> "file","data":{"out":"/tmp/log10"}}}}
> 
> c.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":
> "bar9","chardev2":"bar10","id":"gate10"}}
> {"return": {}}
> 
> Expected results,
> There is not any improper error message.
> 
>   Any issues please let me know,thanks
> 
> Best Regards,
> Min
  
  Not 100% reproduce it via QMP.
Comment 6 Gerd Hoffmann 2015-05-06 07:32:46 EDT
http://patchwork.ozlabs.org/patch/468879/
Comment 7 Gerd Hoffmann 2015-08-31 04:23:19 EDT
Upstream commit a48da7b5bc1f0c98e7a124337140efd47049066c (in 2.4.0).
Not serious enough for exception, lets pick it up with the 7.3 rebase.
Comment 9 Gerd Hoffmann 2016-05-12 12:39:55 EDT
(In reply to Gerd Hoffmann from comment #7)
> Upstream commit a48da7b5bc1f0c98e7a124337140efd47049066c (in 2.4.0).
> Not serious enough for exception, lets pick it up with the 7.3 rebase.

Happened now ;)
Comment 11 Min Deng 2016-09-06 03:01:11 EDT
Re-test this scenario but some changes comes out,now pci-serial-2x is not supported in RHEL7.3 so I'm afraid that it cannot be verified by pci-serial-2x
I.
HMP,
device_add id=gg,driver=pci-serial-2x,chardev1=foo2,chardev2=foo2
Parameter 'driver' expects pluggable device type
QMP,
1.{"execute":"qmp_capabilities"}

2.{"execute":"chardev-add","arguments":{"id":"bar7","backend":{"type":"file","data":{"out":"/tmp/log7"}}}}

3.{"execute":"chardev-add","arguments":{"id":"bar8","backend":{"type":"file","data":{"out":"/tmp/log8"}}}}

4.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":"bar7","chardev2":"bar7","id":"gate7"}}

{"error": {"class": "GenericError", "desc": "Parameter 'driver' expects pluggable device type"}}

5.{"execute":"device_add","arguments":{"driver":"pci-serial-2x","chardev1":"bar7","chardev2":"bar8","id":"gate8"}}
{"error": {"class": "GenericError", "desc": "Parameter 'driver' expects pluggable device type"}}

II.
As pci_serial is supported I do tests as the following but still something wrong exists
1.{"execute":"qmp_capabilities"}

2.{"execute":"chardev-add","arguments":{"id":"bar7","backend":{"type":"file","data":{"out":"/tmp/log7"}}}}

3.{"execute":"device_add","arguments":{"driver":"pci-serial","chardev1":"bar7"}}

{"error": {"class": "GenericError", "desc": "Property '.chardev1' not found"}}

 In a summary,the fix is not working on build 
qemu-kvm-rhev-2.6.0-22.el7.x86_64 currently
Comment 12 Gerd Hoffmann 2016-09-06 08:43:34 EDT
(In reply to dengmin from comment #11)
> Re-test this scenario but some changes comes out,now pci-serial-2x is not
> supported in RHEL7.3 so I'm afraid that it cannot be verified by
> pci-serial-2x

Can't verify it then as the bug only shows up with 2x and 4x variants.

> 3.{"execute":"device_add","arguments":{"driver":"pci-serial","chardev1":
> "bar7"}}
> 
> {"error": {"class": "GenericError", "desc": "Property '.chardev1' not
> found"}}

It's named "chardev" for pci-serial.
Comment 13 Min Deng 2016-09-09 06:07:52 EDT
(In reply to Gerd Hoffmann from comment #12)
> (In reply to dengmin from comment #11)
> > Re-test this scenario but some changes comes out,now pci-serial-2x is not
> > supported in RHEL7.3 so I'm afraid that it cannot be verified by
> > pci-serial-2x
> 
> Can't verify it then as the bug only shows up with 2x and 4x variants.
> 
> > 3.{"execute":"device_add","arguments":{"driver":"pci-serial","chardev1":
> > "bar7"}}
> > 
> > {"error": {"class": "GenericError", "desc": "Property '.chardev1' not
> > found"}}
> 
> It's named "chardev" for pci-serial.

  Thanks for reminder,they should be like the followings
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"chardev-add","arguments":{"id":"bar7","backend":{"type":"file","data":{"out":"/tmp/log7"}}}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"pci-serial","chardev":"bar7"}}
{"return": {}}
Comment 14 Min Deng 2016-09-12 02:51:45 EDT
(In reply to Gerd Hoffmann from comment #12)
> (In reply to dengmin from comment #11)
> > Re-test this scenario but some changes comes out,now pci-serial-2x is not
> > supported in RHEL7.3 so I'm afraid that it cannot be verified by
> > pci-serial-2x
> 
> Can't verify it then as the bug only shows up with 2x and 4x variants.
> 
> > 3.{"execute":"device_add","arguments":{"driver":"pci-serial","chardev1":
> > "bar7"}}
> > 
> > {"error": {"class": "GenericError", "desc": "Property '.chardev1' not
> > found"}}
> 
> It's named "chardev" for pci-serial.

Hi Gerd,
   Currently,QE could not verify this bug since they are not supported so far.If there was a way for verifying this bug,could you please provide us,many thanks.

Best Regards,
Min
Comment 15 Min Deng 2016-09-14 04:56:29 EDT
(In reply to dengmin from comment #14)
> (In reply to Gerd Hoffmann from comment #12)
> > (In reply to dengmin from comment #11)
> > > Re-test this scenario but some changes comes out,now pci-serial-2x is not
> > > supported in RHEL7.3 so I'm afraid that it cannot be verified by
> > > pci-serial-2x
> > 
> > Can't verify it then as the bug only shows up with 2x and 4x variants.
> > 
> > > 3.{"execute":"device_add","arguments":{"driver":"pci-serial","chardev1":
> > > "bar7"}}
> > > 
> > > {"error": {"class": "GenericError", "desc": "Property '.chardev1' not
> > > found"}}
> > 
> > It's named "chardev" for pci-serial.
> 
> Hi Gerd,
>    Currently,QE could not verify this bug since they are not supported so
> far.If there was a way for verifying this bug,could you please provide
> us,many thanks.
> 
> Best Regards,
> Min

 Otherwise QE have to re-assign it,many thanks!
Comment 16 Gerd Hoffmann 2016-09-14 05:13:32 EDT
Bug is fixed upstream.  Can't be verified in RHEL as as RHEL-7 supports pci-serial only, not pci-serial-{2x,4x}.

So I guess setting to CLOSED/UPSTREAM is fine.
If you disagree feel free to update the bug accordingly.

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