Bug 923599 - Virtio serial chardev will be still in use even failed to hot plug a serial port on it
Summary: Virtio serial chardev will be still in use even failed to hot plug a serial p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 770512
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-20 07:38 UTC by Qian Guo
Modified: 2015-03-05 09:42 UTC (History)
19 users (show)

Fixed In Version: qemu 2.1
Doc Type: Bug Fix
Doc Text:
Clone Of: 770512
Environment:
Last Closed: 2015-03-05 09:42:15 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0624 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2015-03-05 14:37:36 UTC

Comment 3 langfang 2013-12-11 07:56:30 UTC
Test the old and the latest version,hit the same problem

Host:
# uname -r
3.10.0-57.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.2-4.el7.x86_64/qemu-kvm-1.5.3-21.el7.x86_64

Guest:
3.10.0-55.el7.x86_64

Steps:
1. Boot a guest with virtio serial bus and chardev but no serial port, for example:
/usr/libexec/qemu-kvm ....... -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait ...

2. Hot plug a virtio serial port on the first chardev "channel0".
qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1


3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized


4. Hot plug the serial port again with correct "nr" value.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2
Property 'virtserialport.chardev' can't take value 'channel1', it's in use

Results:
Can not hot plug the second serial port to the chardev.

MY CLI:
 /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3 -vga cirrus -usb -device usb-tablet -monitor stdio -drive file=/root/RHEL-Server-7.0-64.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait

Comment 4 Mike Cao 2013-12-13 09:04:09 UTC
I hit the similiar issue (In reply to langfang from comment #3)
> Test the old and the latest version,hit the same problem
> 
> Host:
> # uname -r
> 3.10.0-57.el7.x86_64
> # rpm -q qemu-kvm
> qemu-kvm-1.5.2-4.el7.x86_64/qemu-kvm-1.5.3-21.el7.x86_64
> 
> Guest:
> 3.10.0-55.el7.x86_64
> 
> Steps:
> 1. Boot a guest with virtio serial bus and chardev but no serial port, for
> example:
> /usr/libexec/qemu-kvm ....... -device
> virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev
> socket,id=channel0,path=/tmp/port0,server,nowait -chardev
> socket,id=channel1,path=/tmp/port1,server,nowait ...
> 
> 2. Hot plug a virtio serial port on the first chardev "channel0".
> qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.
> 0,id=port0,nr=1
> 
> 
> 3. Hot plug another serial port on the second chardev "channel1" but with a
> wrong "nr" value to let it failed to plug.
> 
> (qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.
> 1,id=port1,nr=1
> virtio-serial-bus: A port already exists at id 1
> Device 'virtserialport' could not be initialized
> 
> 
> 4. Hot plug the serial port again with correct "nr" value.
> (qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.
> 1,id=port1,nr=2
> Property 'virtserialport.chardev' can't take value 'channel1', it's in use
> 


I hit the similiar issue on qemu-kvm-rhev-1.5.3-19.el7.x86_64,
after step 4 try
(qemu)info qtree
            bus: serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "ice, id ""
"
                chardev = <null>
                nr = 4294967295
                name = "com.redhat.rhevm.vdsm2"
                port -1, guest off, host off, throttle off
              dev: virtserialport, id "�"
                chardev = <null>
                nr = 4294967295
                name = "com.redhat.rhevm.vdsm2"
                port -1, guest off, host off, throttle off
              dev: virtserialport, id "GIOChannel (Unix)"
                chardev = <null>
                nr = 4294967295
                name = "com.redhat.rhevm.vdsm2"
                port -1, guest off, host off, throttle off
              dev: virtserialport, id "port0"
                chardev = chardev0
                nr = 2
                name = "com.redhat.rhevm.vdsm"
                port 2, guest off, host off, throttle off
              dev: virtserialport, id "port1"
                chardev = chardev1
                nr = 1
                name = "com.redhat.rhevm.vdsm1"
                port 1, guest on, host on, throttle on

step 5 ,try to use virtserialport named com.redhat.rhevm.vdsm1
# nc -U /tmp/socket1
Ncat: Invalid argument.

Comment 5 Amit Shah 2014-01-07 10:21:00 UTC
Might be a dup of bug 1038914.

Comment 13 juzhang 2014-07-16 01:17:10 UTC
Hi Huding,

Could you handle this issue?

Best Regards,
Junyi

Comment 14 huiqingding 2014-07-16 06:08:40 UTC
(In reply to juzhang from comment #13)
> Hi Huding,
> 
> Could you handle this issue?
> 
> Best Regards,
> Junyi

I test the following version and not hit this problem
Host:
qemu-kvm-rhev-2.1.0-2.el7ev.preview.x86_64
kernel-3.10.0-123.6.2.el7.x86_64
Guest:
kernel-3.10.0-123.el7.x86_64

Steps to Test:
1. Boot a guest with virtio serial bus and chardev but no serial port, for example:
/usr/libexec/qemu-kvm ....... -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait ...

2. Hot plug a virtio serial port on the first chardev "channel0".
qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2

Actual results:
after step3, use "info qtree" to check, the virtserialport "port0" is added:
        bus: virtio-bus
          type virtio-pci-bus
          dev: virtio-serial-device, id ""
            max_ports = 3 (0x3)
            bus: virtio-serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "port0"
                chardev = "channel0"
                nr = 1 (0x1)
                name = "org.linux-kvm.port.0"
                port 1, guest off, host off, throttle off
after step4, no error info and use "info qtree" to check, the virtserial port "port1" is added:
        bus: virtio-bus
          type virtio-pci-bus
          dev: virtio-serial-device, id ""
            max_ports = 3 (0x3)
            bus: virtio-serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "port1"
                chardev = "channel1"
                nr = 2 (0x2)
                name = "org.linux-kvm.port.1"
                port 2, guest off, host off, throttle off
              dev: virtserialport, id "port0"
                chardev = "channel0"
                nr = 1 (0x1)
                name = "org.linux-kvm.port.0"
                port 1, guest off, host off, throttle off

Comment 16 huiqingding 2014-08-06 09:54:00 UTC
Reproduce this bug using the following version:
kernel-3.10.0-140.el7.x86_64
qemu-kvm-1.5.3-21.el7.x86_64

Steps to Reproduce:
1. Boot a guest with virtio serial bus and chardev but no serial port, for example:
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3 -vga cirrus -usb -device usb-tablet -monitor stdio -drive file=/home/RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait -qmp tcp:0:4445,server,nowait

2. Hot plug a virtio serial port on the first chardev "channel0".
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2
Property 'virtserialport.chardev' can't take value 'channel1', it's in use

Results:
After step4, can not hot plug the second serial port to the chardev

Comment 17 huiqingding 2014-08-06 10:05:51 UTC
Reproduce this bug using the following version:
kernel-3.10.0-140.el7.x86_64
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64

Steps to Reproduce:
1. Boot a guest with virtio serial bus and chardev but no serial port, for example:
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3 -vga cirrus -usb -device usb-tablet -monitor stdio -drive file=/home/RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait -qmp tcp:0:4445,server,nowait

2. Hot plug a virtio serial port on the first chardev "channel0".
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2


Results:
After step4, the second serial port can be added to the chardev, use "info qtree" to check there are two ports:
        bus: virtio-bus
          type virtio-pci-bus
          dev: virtio-serial-device, id ""
            max_ports = 3 (0x3)
            bus: virtio-serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "port1"
                chardev = "channel1"
                nr = 2 (0x2)
                name = "org.linux-kvm.port.1"
                port 2, guest off, host off, throttle off
              dev: virtserialport, id "port0"
                chardev = "channel0"
                nr = 1 (0x1)
                name = "org.linux-kvm.port.0"
                port 1, guest off, host off, throttle off

inside guest, there are two ports:
# ls /dev/vport1p*
/dev/vport1p1 /dev/vport1p2

Addtional test:
I also test QMP command, the results are same as above.
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel0","name":"org.linux-kvm.port.0","id":"port0","nr":1}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2","nr":1}}
{"error": {"class": "GenericError", "desc": "virtio-serial-bus: A port already exists at id 1"}}
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2","nr":2}}
{"return": {}}

Comment 18 huiqingding 2014-08-06 10:07:25 UTC
(In reply to huiqingding from comment #17)
> Reproduce this bug using the following version:

Correction:
Test this bug on an intel host using the following version:

> kernel-3.10.0-140.el7.x86_64
> qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
> 
> Steps to Reproduce:
> 1. Boot a guest with virtio serial bus and chardev but no serial port, for
> example:
> # /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp
> 4,sockets=1,cores=4,threads=1 -name test -rtc
> base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3
> -vga cirrus -usb -device usb-tablet -monitor stdio -drive
> file=/home/RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-system-disk,
> media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device
> virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev
> tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device
> virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,
> bus=pci.0,addr=0x8 -device
> virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev
> socket,id=channel0,path=/tmp/port0,server,nowait -chardev
> socket,id=channel1,path=/tmp/port1,server,nowait -qmp
> tcp:0:4445,server,nowait
> 
> 2. Hot plug a virtio serial port on the first chardev "channel0".
> (qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.
> 0,id=port0,nr=1
> 
> 3. Hot plug another serial port on the second chardev "channel1" but with a
> wrong "nr" value to let it failed to plug.
> 
> (qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.
> 1,id=port1,nr=1
> virtio-serial-bus: A port already exists at id 1
> Device 'virtserialport' could not be initialized
> 
> 4. Hot plug the serial port again with correct "nr" value.
> (qemu) device_add
> virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.
> 1,id=port1,nr=2
> 
> 
> Results:
> After step4, the second serial port can be added to the chardev, use "info
> qtree" to check there are two ports:
>         bus: virtio-bus
>           type virtio-pci-bus
>           dev: virtio-serial-device, id ""
>             max_ports = 3 (0x3)
>             bus: virtio-serial0.0
>               type virtio-serial-bus
>               dev: virtserialport, id "port1"
>                 chardev = "channel1"
>                 nr = 2 (0x2)
>                 name = "org.linux-kvm.port.1"
>                 port 2, guest off, host off, throttle off
>               dev: virtserialport, id "port0"
>                 chardev = "channel0"
>                 nr = 1 (0x1)
>                 name = "org.linux-kvm.port.0"
>                 port 1, guest off, host off, throttle off
> 
> inside guest, there are two ports:
> # ls /dev/vport1p*
> /dev/vport1p1 /dev/vport1p2
> 
> Addtional test:
> I also test QMP command, the results are same as above.
> {"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-
> serial0.0","chardev":"channel0","name":"org.linux-kvm.port.0","id":"port0",
> "nr":1}}
> {"return": {}}
> {"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-
> serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2",
> "nr":1}}
> {"error": {"class": "GenericError", "desc": "virtio-serial-bus: A port
> already exists at id 1"}}
> {"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-
> serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2",
> "nr":2}}
> {"return": {}}

Comment 19 huiqingding 2014-08-07 00:58:48 UTC
Test this bug on an amd host using the following version:
kernel-3.10.0-140.el7.x86_64
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64

Steps to Test:
1. Boot a win2012r2 guest with virtio serial bus and chardev but no serial port, for example:
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3 -vga cirrus -usb -device usb-tablet -monitor stdio -drive file=/home/win2012r2.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait -qmp tcp:0:4445,server,nowait

2. Hot plug a virtio serial port on the first chardev "channel0".
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2


Results:
After step4, the second serial port can be added to the chardev, use "info qtree" to check there are two ports:
          dev: virtio-serial-device, id ""
            max_ports = 3 (0x3)
            bus: virtio-serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "port1"
                chardev = "channel1"
                nr = 2 (0x2)
                name = "org.linux-kvm.port.1"
                port 2, guest off, host off, throttle off
              dev: virtserialport, id "port0"
                chardev = "channel0"
                nr = 1 (0x1)
                name = "org.linux-kvm.port.0"
                port 1, guest off, host off, throttle off

inside guest, check Control Panel -> Hardware -> Devices and Printers, there are two ports: vport0p1 and vport0p2

I also test QMP command, the results are same as above.
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel0","name":"org.linux-kvm.port.0","id":"port0","nr":1}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2","nr":1}}
{"error": {"class": "GenericError", "desc": "virtio-serial-bus: A port already exists at id 1"}}
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","chardev":"channel1","name":"org.linux-kvm.port.2","id":"port2","nr":2}}
{"return": {}}

Comment 21 Qian Guo 2014-08-27 10:04:48 UTC
Reproduced by qemu-kvm-1.5.3-21.el7.x86_64

Steps
1.Boot a guest with virtio serial bus and chardev but no serial port.
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew  -k en-us  -boot menu=on -vnc :3 -vga cirrus -usb -device usb-tablet -monitor stdio -drive file=/home/rhel7/sn1.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,addr=0x3 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:8d,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -chardev socket,id=channel1,path=/tmp/port1,server,nowait -qmp tcp:0:4445,server,nowait

2. Hot plug a virtio serial port on the first chardev "channel0".
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device initialization failed.
Device 'virtserialport' could not be initialized


4. Hot plug the serial port again with correct "nr" value.
qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2


Result, failed to hotplug the correct serial port 
"Property 'virtserialport.chardev' can't take value 'channel1', it's in use
"

So this bug is reproduced

Verify this bug with qemu-kvm-rhev-2.1.0-2.el7.x86_64

Steps as above

Result:
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0,id=port0,nr=1
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized
(qemu) device_add virtserialport,bus=virtio-serial0.0,chardev=channel1,name=org.linux-kvm.port.1,id=port1,nr=2
(qemu) info qtree
...
dev: i440FX-pcihost, id ""
    pci-hole64-size = 18446744073709551615 (16 EiB)
    short_root_bus = 0 (0x0)
    irq 0
    bus: pci.0
      type PCI
      dev: virtio-serial-pci, id "virtio-serial0"
        ioeventfd = true
        vectors = 4 (0x4)
        class = 1920 (0x780)
        max_ports = 3 (0x3)
        indirect_desc = true
        event_idx = true
        addr = 04.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class Class 0780, addr 00:04.0, pci id 1af4:1003 (sub 1af4:0003)
        bar 0: i/o at 0xc060 [0xc07f]
        bar 1: mem at 0xfebd2000 [0xfebd2fff]
        bus: virtio-bus
          type virtio-pci-bus
          dev: virtio-serial-device, id ""
            max_ports = 3 (0x3)
            bus: virtio-serial0.0
              type virtio-serial-bus
              dev: virtserialport, id "port1"
                chardev = "channel1"
                nr = 2 (0x2)
                name = "org.linux-kvm.port.1"
                port 2, guest off, host off, throttle off
              dev: virtserialport, id "port0"
                chardev = "channel0"
                nr = 1 (0x1)
                name = "org.linux-kvm.port.0"
                port 1, guest off, host off, throttle off
....
Hotplug succeed

So this bug is fixed by qemu-kvm-rhev-2.1.0-2.el7.x86_64

Comment 23 errata-xmlrpc 2015-03-05 09:42:15 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, 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://rhn.redhat.com/errata/RHSA-2015-0624.html


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