]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Allow trailing ',' in lists, and '_' in names
authorDaniel P. Berrange <berrange@redhat.com>
Sun, 3 Sep 2006 17:46:32 +0000 (17:46 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Sun, 3 Sep 2006 17:46:32 +0000 (17:46 +0000)
ChangeLog
src/conf.c
tests/confdata/fc4.conf
tests/confdata/fc4.out

index 4d6a1f30a990d444997061a86eb084015ee5e70d..54df75baffed0db62a9178951c60b11b7f42363d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Sep  3 12:50:12 EDT 2006 Daniel Berrange <berrange@redhat.com>
+
+       * src/conf.c: Allow '_' in variable names, and don't fail if there
+       is a trailing ',' at the end of a list.
+       * tests/confdata/fc4.conf, tests/confdata/fc4.out: Expand test 
+       config to include a '_' in a name, and a trailing ',' in a list.
+       
 Sun Sep  3 12:47:42 EDT 2006 Daniel Berrange <berrange@redhat.com>
 
        * tests/.cvsignore, tests/confdata/.cvsignore: Ignore autogenerated
index 5c0707cf2459b5343e2c434caee3c3ab2f78be5f..2950c28f58e26892e6a10e29daa6d267dfae2977 100644 (file)
@@ -443,6 +443,9 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
            }
            NEXT;
            SKIP_BLANKS;
+           if (CUR == ']') {
+               break;
+           }
            tmp = virConfParseValue(ctxt);
            if (tmp == NULL) {
                virConfFreeList(lst);
@@ -508,7 +511,7 @@ virConfParseName(virConfParserCtxtPtr ctxt)
         virConfError(NULL, VIR_ERR_CONF_SYNTAX, "expecting a name", ctxt->line);
        return(NULL);
     }
-    while ((ctxt->cur < ctxt->end) && ((IS_CHAR(CUR)) || (IS_DIGIT(CUR))))
+    while ((ctxt->cur < ctxt->end) && ((IS_CHAR(CUR)) || (IS_DIGIT(CUR)) || (CUR == '_')))
         NEXT;
     ret = strndup(base, ctxt->cur - base);
     if (ret == NULL) {
index 745a4c409c5eae2294e190d393115f221b4022c1..b64a0c49effdfbb95178d01e9f9d99ca6cf733b6 100644 (file)
@@ -2,9 +2,10 @@ kernel="/boot/vmlinuz-2.6.15-1.2054_FC5xenU"
 ramdisk="/boot/initrd-2.6.15-1.2054_FC5xenU.img"
 memory=128 # should be enough
 name="fc4"
-vif = [ 'mac=aa:00:00:00:00:11, bridge=xenbr0' ]
+vif = [ 'mac=aa:00:00:00:00:11, bridge=xenbr0', ]
 disk = ['file:/xen/fc4.img,sda1,w']
 root = "/dev/sda1"
 extra = "ro selinux=0 3"
+on_reboot   = 'restart'
 # just for testing ...
 tst = [ 1, 2, [ 3, 4 ], 5]
index 1fad85ceb25a730cb3f1f05907a5b47640871ddc..a4638da645b519e8271c2e4b4f6f75ea8937c5f8 100644 (file)
@@ -6,5 +6,6 @@ vif = [ "mac=aa:00:00:00:00:11, bridge=xenbr0" ]
 disk = [ "file:/xen/fc4.img,sda1,w" ]
 root = "/dev/sda1"
 extra = "ro selinux=0 3"
+on_reboot = "restart"
 # just for testing ...
 tst = [ 1, 2, [ 3, 4 ], 5 ]