Skip to contentSkip to conversation

tools: allow config file compatibility with new tap syntax

PATCH In review Andre Przywara 2 participants 2 messages Jun 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: allow config file compatibility with new tap syntax

Hi,

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. 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.

Regards,
Andre.

Signature · 9 lines
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
tools/python/xen/xend/server/BlktapController.py +6 -2
diff -r aef9bba654f1 tools/python/xen/xend/server/BlktapController.py
@@ -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'):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

I've seen a couple references to the tap:tapdisk syntax in the last few days - For the record, the change responsible for this is 19346. It's not related to the blktap2 code at all.

The point of making this change was to allow folks to specify a blktap-like driver using qemu (with the syntax tap:ioemu).

The patch makes sense to me. I'd be very happy to be able to use the older tap:<driver> syntax.

--Dutch

Quoted 27 lines · Andre Przywara

Hi,

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. 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.

Regards,
Andre.

Signature · 9 lines
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