xend: allow config file compatibility with new tap syntax

Recently the format of the tap syntax in the config file changed to
using a 4 part specifier (tap:tapdisk:<format>:<filename>) instead
of the old 3-part one (tap:<qcow>:<filename>).
This breaks compatibility with existing config files: a guest start
will throw a Python exception and will be aborted.
AFAICS currently tap:tapdisk is redundant, so the attached patch
simply catches the above mentioned exception and tries to parse the
old format in this case.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
This commit is contained in:
Keir Fraser committed 2009-06-16 11:00:29 +01:00
1 parent e966818264
commit 51e4a7555d
1 file changed
+6 -2
@@ -120,8 +120,12 @@ class BlktapController(BlkifController):
def createDevice(self, config):
uname = config.get('uname', '')
(typ, subtyp, params, file) = string.split(uname, ':', 3)
uname = config.get('uname', '')
try:
(typ, subtyp, params, file) = string.split(uname, ':', 3)
except:
(typ, params, file) = string.split(uname, ':', 2)
subtyp = 'tapdisk'
if typ in ('tap'):
if subtyp in ('tapdisk'):
if params in ('ioemu', 'qcow2', 'vmdk', 'sync'):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.