aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub/src
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-10-10 10:37:37 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-10-14 17:40:36 +0100
commitb2e55da3cd6f5911b833edb9e1fd9a22110c2a74 (patch)
tree56fc7b9d3e4db8b724a8bdb498f97b0ffd41dc04 /tools/pygrub/src
parenta77eb86f44e52c5aea7f0ba7023600c043a9cdcd (diff)
downloadxen-b2e55da3cd6f5911b833edb9e1fd9a22110c2a74.tar.gz
xen-b2e55da3cd6f5911b833edb9e1fd9a22110c2a74.tar.bz2
xen-b2e55da3cd6f5911b833edb9e1fd9a22110c2a74.zip
pygrub: Support (/dev/xvda) style disk specifications
You get these if you install Debian Wheezy as HVM and then try to convert to PV. This is Debian bug #603391. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Tril <tril@metapipe.net> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/pygrub/src')
-rw-r--r--tools/pygrub/src/GrubConf.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index 6324c625fe..cb853c9cba 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -67,7 +67,11 @@ class GrubDiskPart(object):
return self._disk
def set_disk(self, val):
val = val.replace("(", "").replace(")", "")
- self._disk = int(val[2:])
+ if val.startswith("/dev/xvd"):
+ disk = val[len("/dev/xvd")]
+ self._disk = ord(disk)-ord('a')
+ else:
+ self._disk = int(val[2:])
disk = property(get_disk, set_disk)
def get_part(self):