RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1258361 - Libvirtd crash when attach-disk with an unsupported disk address ccw
Summary: Libvirtd crash when attach-disk with an unsupported disk address ccw
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-31 07:54 UTC by Pei Zhang
Modified: 2015-11-19 06:52 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.17-8.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:52:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Pei Zhang 2015-08-31 07:54:23 UTC
Description of problem:
Although we don't support s903 machine / vm, but virsh commands have some options related to it (like ccw type address). So libvirtd should also run well even though we do some invalid operations.

Version-Release number of selected component (if applicable):
libvirt-1.2.17-6.el7.x86_64
qemu-kvm-rhev-2.3.0-18.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. check current libvirtd pid

# ps -ef|grep libvirtd
root      1033     1  0 15:21 ?        00:00:00 /usr/sbin/libvirtd

# virsh list 
 Id    Name                           State
----------------------------------------------------
 51    r72                            running

2. attach disk with address is ccw

# virsh attach-disk r72 /var/lib/libvirt/images/raw.img vde --targetbus virtio --address ccw:00.0.0000
error: Failed to attach disk
error: End of file while reading data: Input/output error

3. check libvirtd pid ; libvirtd was restart

# ps -ef| grep libvirtd
root      3973     1  0 15:31 ?        00:00:00 /usr/sbin/libvirtd

4.cold plug disk with ccw address
# virsh attach-disk r72 /var/lib/libvirt/images/raw.img vde --targetbus virtio --address ccw:00.0.0000 --config
Disk attached successfully

5. start guest 
# virsh start r72
error: Failed to start domain r72
error: internal error: process exited while connecting to monitor: 
2015-08-31T02:47:31.816904Z qemu-kvm: -device virtio-blk-ccw,scsi=off,devno=0.0.0000,drive=drive-virtio-disk4,id=virtio-disk4: 'virtio-blk-ccw' is not a valid device model name

Actual results:
As step2 and step3 , fail to attach disk , but libvirtd crash.

Expected results:
Libvirtd won't crash. and as step5, give clear error message .  

Additional info:
core_backtrace form abrt:

{   "signal": 11
,   "executable": "/usr/sbin/libvirtd"
,   "stacktrace":
      [ {   "crash_thread": true
        ,   "frames":
              [ {   "address": 139723471082910
                ,   "build_id": "d323059eae8c8710c5cff4ff546adbf8c039c1df"
                ,   "build_id_offset": 869790
                ,   "function_name": "virDomainCCWAddressAssign"
                ,   "file_name": "/lib64/libvirt.so.0"
                }
              , {   "address": 139722876216111
                ,   "build_id": "5c69fcd6eb2eb9911d99eba147eee27d3c74bda7"
                ,   "build_id_offset": 455471
                ,   "function_name": "qemuDomainAttachDeviceDiskLive"
                ,   "file_name": "/usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so"
                }
              , {   "address": 139722876669448
                ,   "build_id": "5c69fcd6eb2eb9911d99eba147eee27d3c74bda7"
                ,   "build_id_offset": 908808
                ,   "function_name": "qemuDomainAttachDeviceFlags"
                ,   "file_name": "/usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so"
                }
              , {   "address": 139723471698566
                ,   "build_id": "d323059eae8c8710c5cff4ff546adbf8c039c1df"
                ,   "build_id_offset": 1485446
                ,   "function_name": "virDomainAttachDevice"
                ,   "file_name": "/lib64/libvirt.so.0"
                }
              , {   "address": 139723484587055
                ,   "build_id": "a9d9a89b2c451d612aaf24c48c85c1bae3488a88"
                ,   "build_id_offset": 250927
                ,   "function_name": "remoteDispatchDomainAttachDeviceHelper"
                ,   "file_name": "/usr/sbin/libvirtd"
                }
              , {   "address": 139723472102962
                ,   "build_id": "d323059eae8c8710c5cff4ff546adbf8c039c1df"
                ,   "build_id_offset": 1889842
                ,   "function_name": "virNetServerProgramDispatch"
                ,   "file_name": "/lib64/libvirt.so.0"
                }
              , {   "address": 139723472083117
                ,   "build_id": "d323059eae8c8710c5cff4ff546adbf8c039c1df"
                ,   "build_id_offset": 1869997
                ,   "function_name": "virNetServerHandleJob"
                ,   "file_name": "/lib64/libvirt.so.0"
                }

Comment 1 Pei Zhang 2015-08-31 09:47:08 UTC
> Description of problem:
> Although we don't support s903 machine .

Sorry, wrote the wrong machine type. changed it.
s/s903/s390

Comment 2 John Ferlan 2015-08-31 16:47:29 UTC
Just for completeness, the following XML added to domain would cause the same failure for the config option:

  <disk type='file' device='disk'>
    <driver name='qemu' type='raw'/>
    <source file='/home/vm-images/test-1g.img'/>
    <target dev='vde' bus='virtio'/>
    <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
  </disk>


BTW: A similar problem exists for the <rng>

Comment 3 John Ferlan 2015-08-31 17:09:13 UTC
see upstream patch:

http://www.redhat.com/archives/libvir-list/2015-August/msg01043.html

Comment 4 John Ferlan 2015-09-03 21:02:09 UTC
Posted a v2:

http://www.redhat.com/archives/libvir-list/2015-September/msg00109.html

Review points out that hotplug of scsi controller results in same crash, e.g.

$ cat ctlr-ccw.xml
<controller type='scsi' index='10'>
   <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
</controller>
$ virsh attach-device $dom ctlr-ccw.xml

Similarly for rng:

$ cat rng-ccw.xml
<rng model='virtio'>
   <backend model='random'>/dev/hwrng</backend>
   <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
</rng>
$ virsh attach-device $dom rng-ccw.xml

With v2 of the patch applied, errors would be:

error: unsupported configuration: cannot use CCW address type for device 'vde' using machine type 'pc-i440fx-1.4'

or

error: unsupported configuration: cannot use CCW address type for device '/dev/hwrng' using machine type 'pc-i440fx-1.4'

or

error: unsupported configuration: cannot use CCW address type for device 'controller' using machine type 'pc-i440fx-1.4'

Comment 5 John Ferlan 2015-09-03 21:03:04 UTC
Setting exception flag because we're late in the release and this does cause a libvirtd crash

Comment 8 yisun 2015-09-09 08:56:49 UTC
Verified on:
libvirt-1.2.17-8.el7.x86_64
qemu-kvm-rhev-2.3.0-22.el7.x86_64
kernel-3.10.0-314.el7.x86_64

1. use attack-disk to test
[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155     1  1 16:41 ?        00:00:00 /usr/sbin/libvirtd


[root@lento80 ~]# virsh attach-disk rhel7_Sep4 /var/lib/libvirt/images/test.raw vde --targetbus virtio --address ccw:00.0.0000
error: Failed to attach disk
error: unsupported configuration: cannot use CCW address type for device 'vde' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd

[root@lento80 ~]# virsh attach-disk rhel7_Sep4 /var/lib/libvirt/images/test.raw vde --targetbus virtio --address ccw:00.0.0000 --config
Disk attached successfully

[root@lento80 ~]# virsh destroy rhel7_Sep4
Domain rhel7_Sep4 destroyed

[root@lento80 ~]# virsh start rhel7_Sep4
error: Failed to start domain rhel7_Sep4
error: unsupported configuration: cannot use CCW address type for device 'vde' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd


2. use attack-device to test
[root@lento80 ~]# virsh edit rhel7_Sep4
Domain rhel7_Sep4 XML configuration edited.

[root@lento80 ~]# cat disk.xml 
  <disk type='file' device='disk'>
    <driver name='qemu' type='raw'/>
    <source file='/var/lib/libvirt/images/test.raw'/>
    <target dev='vde' bus='virtio'/>
    <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
  </disk>
[root@lento80 ~]# virsh attach-device rhel7_Sep4 disk.xml 
error: Failed to attach device from disk.xml
error: Requested operation is not valid: cannot do live update a device on inactive domain

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd

# virsh attach-device rhel7_Sep4 disk.xml --config
Device attached successfully

[root@lento80 ~]# virsh destroy rhel7_Sep4;virsh start rhel7_Sep4
error: Failed to destroy domain rhel7_Sep4
error: Requested operation is not valid: domain is not running

error: Failed to start domain rhel7_Sep4
error: unsupported configuration: cannot use CCW address type for device 'vde' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd


3. test controller hot-plug
[root@lento80 ~]# cat controller.xml 
<controller type='scsi' index='10'>
   <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
</controller>

[root@lento80 ~]# virsh attach-device rhel7_Sep4 controller.xml 
error: Failed to attach device from controller.xml
error: unsupported configuration: cannot use CCW address type for device 'controller' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd

[root@lento80 ~]# virsh attach-device rhel7_Sep4 controller.xml --config
Device attached successfully

[root@lento80 ~]# virsh destroy rhel7_Sep4;virsh start rhel7_Sep4
Domain rhel7_Sep4 destroyed

error: Failed to start domain rhel7_Sep4
error: unsupported configuration: cannot use CCW address type for device 'controller' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd

4. test rng hot-plug

[root@lento80 ~]# cat rng.xml 
<rng model='virtio'>
   <backend model='random'>/dev/hwrng</backend>
   <address type='ccw' cssid='0x0' ssid='0x0' devno='0x0000'/>
</rng>
[root@lento80 ~]# virsh attach-device rhel7_Sep4 rng.xml 
error: Failed to attach device from rng.xml
error: unsupported configuration: cannot use CCW address type for device '/dev/hwrng' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd
[root@lento80 ~]# virsh attach-device rhel7_Sep4 rng.xml --config
Device attached successfully

[root@lento80 ~]# virsh destroy rhel7_Sep4;virsh start rhel7_Sep4
Domain rhel7_Sep4 destroyed

error: Failed to start domain rhel7_Sep4
error: unsupported configuration: cannot use CCW address type for device '/dev/hwrng' using machine type 'pc-i440fx-rhel7.2.0'

[root@lento80 ~]# ps -ef |  grep -v grep | grep libvirtd
root     28155<=== not crashed     1  0 16:41 ?        00:00:00 /usr/sbin/libvirtd

Comment 10 errata-xmlrpc 2015-11-19 06:52:50 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/RHBA-2015-2202.html


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