1. 06 4月, 2012 1 次提交
  2. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  3. 26 3月, 2012 1 次提交
    • E
      Fix and test round-trip of query parameters · 70c07e01
      Eric Blake 提交于
      When qparams support was dropped in commit bc1ff160, we forgot
      to add tests to ensure that viruri can do the same round trip
      handling of a URI. This round trip was broken, due to use
      of the old 'query' field of xmlUriPtr, instead of the new
      'query_raw'
      
      Also, we forgot to report an OOM error.
      
      * tests/viruritest.c (mymain): Add tests based on just-deleted
      qparamtest.
      (testURIParse): Allow difference in input and expected output.
      * src/util/viruri.c (virURIFormat): Add missing error. Use
        query_raw, instead of query for xmlUriPtr object.
      70c07e01
  4. 23 3月, 2012 4 次提交
    • D
      Store parsed query parameters directly in the virURIPtr struct · 4ae4ae4b
      Daniel P. Berrange 提交于
      Avoid the need for each driver to parse query parameters itself
      by storing them directly in the virURIPtr struct. The parsing
      code is a copy of that from src/util/qparams.c  The latter will
      be removed in a later patch
      
      * src/util/viruri.h: Add query params to virURIPtr
      * src/util/viruri.c: Parse query parameters when creating virURIPtr
      * tests/viruritest.c: Expand test to cover params
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4ae4ae4b
    • D
      Centralize error reporting for URI parsing/formatting problems · 1f66c18f
      Daniel P. Berrange 提交于
      Move error reporting out of the callers, into virURIParse
      and virURIFormat, to get consistency.
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI
      * src/util/viruri.c, src/util/viruri.h: Add error reporting
      * src/esx/esx_driver.c, src/libvirt.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/remote/remote_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xen/xen_driver.c,
        src/xen/xend_internal.c, tests/viruritest.c: Remove error
        reporting
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1f66c18f
    • D
      Use virURIFree instead of xmlFreeURI · c33dae31
      Daniel P. Berrange 提交于
      Since we defined a custom virURIPtr type, we should use a
      virURIFree method instead of assuming it will always be
      a typedef for xmlURIPtr
      
      * src/util/viruri.c, src/util/viruri.h, src/libvirt_private.syms:
        Add a virURIFree method
      * src/datatypes.c, src/esx/esx_driver.c, src/libvirt.c,
        src/qemu/qemu_migration.c, src/vmx/vmx.c, src/xen/xend_internal.c,
        tests/viruritest.c: s/xmlFreeURI/virURIFree/
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c33dae31
    • D
      Add test case for virURIPtr classs · 6a7ffd43
      Daniel P. Berrange 提交于
      To ensure we properly escape & unescape IPv6 numeric addresses,
      add a test case
      
      * tests/Makefile.am, tests/viruritest.c: URI parsing test
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6a7ffd43