]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: Use ida to allocate virtio index
authorAsias He <asias@redhat.com>
Thu, 3 May 2012 02:20:51 +0000 (10:20 +0800)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 May 2012 02:46:12 +0000 (12:16 +0930)
commit46c483ac22daf1a5dc1e487e79538dc939e8ef6e
treeb0a32e83e72f07064b9ae7156ec2bdc501734b6d
parent63f3ebf735f0430acd6781e71326e82033d3930f
virtio: Use ida to allocate virtio index

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
}

Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio.c