]> xenbits.xensource.com Git - libvirt.git/commit
conf: add global check for duplicate drive addresses
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Wed, 30 Nov 2016 11:47:04 +0000 (12:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2016 09:45:46 +0000 (10:45 +0100)
commit0f2721d044ff21cbbaf6e71840290eb063657fae
tree119393a95c2544d5c3bd79427d6685db4b45361d
parentb39d3a7eb61bf5c818778341e5670cf3b6331381
conf: add global check for duplicate drive addresses

Add a global check for duplicate drive addresses. This will fix the
problem of duplicate disk and hostdev drive addresses.

Example for duplicate drive addresses:
<disk>
  ...
  <target name='sda'/>
</disk>
<disk>
  ...
  <target name='sdb'/>
  <address type='drive' controller=0 bus=0 target=0 unit=0/>
</disk>

Another example:
<hostdev mode='subsystem' type='scsi' managed='no'>
  <source>
  ...
  </source>
  <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</hostdev>
<hostdev mode='subsystem' type='scsi' managed='no'>
  <source>
  ...
  </source>
  <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</hostdev>

Unfortunately the fixes (1b08cc170a84077afd4d15f4639a9a2cf398e9a2,
8d46386bfe01b84982e25e915ad9cfbae5cf4cb1) weren't enough to catch these
cases and it isn't possible to add additional checks in
virDomainDeviceDefPostParseInternal() for SCSI hostdevs or
virDomainDiskDefAssignAddress() for SCSI/IDE/FDC/SATA disks without
adding another parse flag (virDomainDefParseFlags) to disable this
validation while updating or detaching a disk or hostdev.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c