pci-devfn: check that device/slot number is within range
authorDonald Dutile <ddutile@redhat.com>
Wed, 21 Sep 2011 19:25:11 +0000 (15:25 -0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 23 Sep 2011 15:55:34 +0000 (10:55 -0500)
commit704416c1a628dfee0175cbdef4871bca4eb877ec
treeef095af380ee8cdf3ed85e514b12f3c909db50e9
parentc9383548e2def65aceb351f88144659e2a506dba
pci-devfn: check that device/slot number is within range

Need to check that guest slot/device number is not > 31 or walk off
the devfn table when checking if a devfn is available or not in a guest.

before this fix, passing in an addr=abc  or addr=34,
can crash qemu, sometimes fail gracefully if data past end
of devfn table fails the availability test.

with this fix, get clean error:
Property 'pci-assign.addr' doesn't take value '34'

also tested when no addr= param passed for guest (pcicfg) address,
and that worked as well.

Signed-off-by: Don Dutile <ddutile@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev-properties.c