On 05/31/2013 04:09 AM, Osier Yang wrote:
With unknown good reasons, the attribute "bus" of scsi
device
address is always set to 0, same for attribute "target". (See
virDomainDiskDefAssignAddress).
Though we might need to change the algorithm to honor "bus"
and "target" too, that's a different issue. The address generator
for scsi host device in this patch just follows the unknown
good reasons, only considering the "controller" and "unit".
It walks through all scsi controllers and their units, to see
if the address $controller:0:0:$unit can be used (if not used
by any disk or scsi host device yet), if found one, it sits on
it, otherwise, it creates a new controller (actually the controller
is implicitly created by someone else), and sits on
$new_controller:0:0:0 instead.
ACK.
src/conf/domain_conf.c | 202
++++++++++++++++++---
.../qemuxml2argv-hostdev-scsi-autogen-address.xml | 95 ++++++++++
...qemuxml2xmlout-hostdev-scsi-autogen-address.xml | 106 +++++++++++
tests/qemuxml2xmltest.c | 2 +
4 files changed, 375 insertions(+), 30 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-autogen-address.xml
create mode 100644
tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml
Relatively big to be pushing this late after freeze, but it can be
argued that this is a bug fix and worth including in 1.0.6.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org