diff --git a/storage/__init__.py b/storage/__init__.py
index 09dab1f..03c8f07 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1180,6 +1180,17 @@ class Storage(object):
return self.fsset.rootDevice
def compareDisks(self, first, second):
+ def name_to_prio(name):
+ # the order is: hd < sd < vd or xvd < something else
+ if name.startswith("hd"):
+ return -1
+ elif name.startswith("sd"):
+ return 0
+ elif (name.startswith("vd") or name.startswith("xvd")):
+ return 1
+ else:
+ return 2
+
# if exactly one of the devices has a pcidev, prefer it
if bool(self.eddDict[first].pcidev) ^ bool(self.eddDict[second].pcidev):
if self.eddDict[first].pcidev:
@@ -1202,24 +1213,8 @@ class Storage(object):
if self.eddDict[second].biosdev:
return 1