]> xenbits.xensource.com Git - libvirt.git/commit
Add virIndexToDiskName and fix mapping gap
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 3 Dec 2009 16:17:40 +0000 (17:17 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 3 Dec 2009 17:07:49 +0000 (18:07 +0100)
commit63166a4e0c5ad1b3100b9d21a17a47482a599cbb
tree7e5c305975948eb417ea70d75f0f75899b37c9ec
parent7a18fbeeb8824a6f270ef83b1c490269968ef1b3
Add virIndexToDiskName and fix mapping gap

esxVMX_IndexToDiskName handles indices up to 701. This limit comes
from a mapping gap in virDiskNameToIndex:

  sdzy -> 700
  sdzz -> 701
  sdaaa -> 728
  sdaab -> 729

This line in virDiskNameToIndex causes this gap:

  idx = (idx + i) * 26;

Fixing it by altering this line to:

  idx = (idx + (i < 1 ? 0 : 1)) * 26;

Also add a new version of virIndexToDiskName that handles the inverse
mapping for arbitrary indices.

* src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName
* src/util/util.[ch]: add virIndexToDiskName and fix mapping gap
* tests/esxutilstest.c: update test to verify that the gap is fixed
src/esx/esx_vmx.c
src/esx/esx_vmx.h
src/util/util.c
src/util/util.h
tests/esxutilstest.c