From Dan Kenigsberg <[email protected]>:

Dan Kenigsberg has uploaded a new change for review.

Change subject: [wip] fix vmdevices.storage.makeName
......................................................................

[wip] fix vmdevices.storage.makeName

it should mimic 
http://elixir.free-electrons.com/linux/latest/ident/sd_format_disk_name

Change-Id: Ib0219be59e408df6628fd148b9ad70af8e2366aa
Signed-off-by: Dan Kenigsberg <[email protected]>
---
M lib/vdsm/virt/vmdevices/storage.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/81155/1

diff --git a/lib/vdsm/virt/vmdevices/storage.py 
b/lib/vdsm/virt/vmdevices/storage.py
index a67d4f8..f34deb7 100644
--- a/lib/vdsm/virt/vmdevices/storage.py
+++ b/lib/vdsm/virt/vmdevices/storage.py
@@ -806,8 +806,10 @@
     devindex = ''
 
     i = int(index)
-    while i > 0:
+    while True:
         devindex = chr(ord('a') + (i % 26)) + devindex
-        i //= 26
+        i = i // 26 - 1
+        if i < 0:
+            break
 
     return devname.get(interface, 'hd') + (devindex or 'a')


-- 
To view, visit https://gerrit.ovirt.org/81155
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0219be59e408df6628fd148b9ad70af8e2366aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <[email protected]>
_______________________________________________
vdsm-patches mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to