Bug 844542 - virtio: Use ida to allocate virtio index
virtio: Use ida to allocate virtio index
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Asias He
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-07-30 23:14 EDT by Asias He
Modified: 2013-02-21 01:44 EST (History)
4 users (show)

See Also:
Fixed In Version: kernel-2.6.32-301.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 01:44:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Asias He 2012-07-30 23:14:15 EDT
Description of problem:

    Current index allocation in virtio is based on a monotonically
    increasing variable "index". This means we'll run out of numbers
    after a while. E.g. someone crazy doing this in host side.
    while(1) {
        hot-plug a virtio device
        hot-unplug the virito devcie

Version-Release number of selected component (if applicable):

How reproducible:


Steps to Reproduce:
1. hot-plug a virtio device, e.g. virito-blk
2. hot-unplug the virito devcie
3. goto step 1 until loop == 10 times 
4. hot-plug the virtio device

Actual results:
# ls -l /sys/block/vda/device
lrwxrwxrwx 1 root root 0 Jul 30 23:04 /sys/block/vda/device -> ../../../virtio10

Expected results:
The virtio device should pointed to the original virito number instead of increasing monotonically.

Additional info:
Upstream fix is: 90e03207f468e84258270ad07095ef50f925c17d, I will backport to RHEL6.4 soon.
Comment 2 RHEL Product and Program Management 2012-08-10 14:39:07 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.
Comment 4 Jarod Wilson 2012-08-24 15:27:34 EDT
Patch(es) available on kernel-2.6.32-301.el6
Comment 7 Sibiao Luo 2012-12-16 22:44:14 EST
Reproduce this issue on 2.6.32-300.el6.x86_64 with the same steps as comment #0.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-300.el6.x86_64   <---------
guest info:
# uname -r
2.6.32-300.el6.x86_64   <---------

after steps 4, the virtio device number will increase monotonically, did not point to the original virito number.
# ls -l /sys/block/vda/device
lrwxrwxrwx. 1 root root 0 Dec 17 19:00 /sys/block/vda/device -> ../../../virtio10

Verify this issue on 2.6.32-345.el6.x86_64 with the same steps as comment #0.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-345.el6.x86_64   <---------
guest info:
# uname -r
2.6.32-345.el6.x86_64   <---------

The virtio device pointed to the original virtio number instead of increasing monotonically after hot-plug the virtio blk device again.
# ls -l /sys/block/vda/device
lrwxrwxrwx. 1 root root 0 Dec 17 19:35 /sys/block/vda/device -> ../../../virtio2

# ls -l /sys/block/vda/device
lrwxrwxrwx. 1 root root 0 Dec 17 19:35 /sys/block/vda/device -> ../../../virtio2

Base on above, this issue has been fixed correctly.
Comment 8 juzhang 2012-12-17 22:12:41 EST
According to comment7, set this issue as verified.
Comment 10 errata-xmlrpc 2013-02-21 01:44:07 EST
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.


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