• M
    Add virIndexToDiskName and fix mapping gap · 63166a4e
    Matthias Bolte 提交于
    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
    63166a4e
util.h 8.8 KB