]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Fix parsing python style triple quotes
authorCole Robinson <crobinso@redhat.com>
Thu, 18 Nov 2010 22:35:23 +0000 (17:35 -0500)
committerCole Robinson <crobinso@redhat.com>
Mon, 22 Nov 2010 21:37:21 +0000 (16:37 -0500)
An incorrect check broke matching the closing set of quotes. Update
tests to cover this case for XM config files.

src/util/conf.c
tests/xmconfigdata/test-escape-paths.cfg
tests/xmconfigdata/test-escape-paths.xml

index a31bbc4f031b01b13b838a67857510d0655e0d6a..d9a76033428fafb5eafb18ee683aebf2bed88924 100644 (file)
@@ -400,8 +400,9 @@ virConfParseString(virConfParserCtxtPtr ctxt)
         ctxt->cur += 3;
         base = ctxt->cur;
 
+        /* Find the ending triple quotes */
         while ((ctxt->cur + 2 < ctxt->end) &&
-               (STRPREFIX(ctxt->cur, "\"\"\""))) {
+               !(STRPREFIX(ctxt->cur, "\"\"\""))) {
             if (CUR == '\n')
                 ctxt->line++;
             NEXT;
index f9f2cb859de90065b73851deebdaafa3506a3487..e3e6db9b345f9dae4e4483df788630628f6f8033 100644 (file)
@@ -19,7 +19,7 @@ vnc = 1
 vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
-disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso&test,hdc:cdrom,r" ]
+disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso&test,hdc:cdrom,r", """phy:/dev/HostVG/XenGuest'",hdb,w""" ]
 vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=ioemu" ]
 parallel = "none"
 serial = "none"
index dabf4928f3c54898c165c712e317eaf3370a94dd..13e6e2986e366c7459284dfeae821432e5173875 100644 (file)
       <target dev='hdc' bus='ide'/>
       <readonly/>
     </disk>
+    <disk type='block' device='disk'>
+      <driver name='phy'/>
+      <source dev='/dev/HostVG/XenGuest&apos;&quot;'/>
+      <target dev='hdb' bus='ide'/>
+    </disk>
     <interface type='bridge'>
       <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>