File 525c1e84-pygrub-xvda-style-disk.patch of Package xen.openSUSE_13.1_Update
Subject: pygrub: Support (/dev/xvda) style disk specifications
From: Ian Campbell ian.campbell@citrix.com Thu Oct 10 10:37:37 2013 +0100
Date: Mon Oct 14 17:40:36 2013 +0100:
Git: b2e55da3cd6f5911b833edb9e1fd9a22110c2a74
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>
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index 6324c62..cb853c9 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):