From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH] tools: allow config file compatibility with new tap syntax Date: Tue, 9 Jun 2009 11:42:19 +0200 Message-ID: <4A2E2E7B.1040803@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000805080801080205030703" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --------------000805080801080205030703 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi, recently the format of the tap syntax in the config file changed to using a 4 part specifier (tap:tapdisk::) instead of the old 3-part one (tap::). 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. This will help our test work flow, because we can use the same config file for different Xen tools versions. What is the purpose of the new :tapdisk: specifier? Is it really redundant (at least currently)? Please cry out if there is something that I have missed, otherwise please apply the patch. If applying this patch is not an option, I would opt for a better error message. Signed-off-by: Andre Przywara Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448 3567 12 ----to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy; Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------000805080801080205030703 Content-Type: text/x-patch; name="tapdisk_config_file.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tapdisk_config_file.patch" diff -r aef9bba654f1 tools/python/xen/xend/server/BlktapController.py --- a/tools/python/xen/xend/server/BlktapController.py Wed Jun 03 00:29:31 2009 +0200 +++ b/tools/python/xen/xend/server/BlktapController.py Mon Jun 08 10:16:33 2009 +0200 @@ -120,8 +120,12 @@ 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'): --------------000805080801080205030703 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000805080801080205030703--