1. 27 5月, 2011 2 次提交
    • M
      esx: Fix regression in absolute file name handling · 8357d91b
      Matthias Bolte 提交于
      Before commit 145d6cb0 (in August 2010) absolute file names
      in VMX and domain XML configs were handled correctly. But this got
      lost during the refactoring. The test cases didn't highlight this
      problem because they have their own set of file name handling
      functions. The actual ones require a real connection to an ESX
      server. Also the test case functions always worked correctly.
      
      Fix the regression and add a new in-the-wild VMX file that contains
      such a problematic absolute path. Even though this test case won't
      protect against new regressions.
      
      Reported by lofic (IRC nick)
      8357d91b
    • M
      openvz: Add simple testcase for config file parsing function · 4a3a0290
      Matthias Bolte 提交于
      This testcase passes before the regression is added in f0443765, fails
      after that commit and passes again after the regression was fixed.
      4a3a0290
  2. 26 5月, 2011 1 次提交
  3. 24 5月, 2011 4 次提交
    • L
      qemu: fix typo in name - should be VHOST_NET, not VNET_HOST · 51781b82
      Laine Stump 提交于
      NB: the enum that uses the string vnet-host (now changed to vhost-net)
      is used in XML, but fortunately that hasn't been in an official
      release yet, so it can still be fixed.
      51781b82
    • D
      Fix QEMU -vnc arg generation with raw IPv6 addresses · 58765b58
      Daniel P. Berrange 提交于
      Since -vnc uses ':' to separate the address from the port, raw
      IPv6 addresses need to be escaped like [addr]:port
      
      * src/qemu/qemu_command.c: Escape raw IPv6 addresses with []
      * tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,
        tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml: Tweak
        to test Ipv6 escaping
      * docs/schemas/domain.rng: Allow Ipv6 addresses, or hostnames
        in <graphics> listen attributes
      58765b58
    • A
      spice: support streaming-video parameter · bb1c5423
      Alon Levy 提交于
      This adds a streaming-video=filter|all|off attribute. It is used to change
      the behavior of video stream detection in spice, the default is filter (the
      default for libvirt is not to specify it - the actual default is defined in
      libspice-server.so).
      
      Usage:
      
          <graphics type='spice' autoport='yes'>
            <streaming mode='off'/>
          </graphics>
      
      Tested with the above and with tests/qemuxml2argvtest.
      Signed-off-by: NAlon Levy <alevy@redhat.com>
      bb1c5423
    • S
      nwfilter: enable filtering of gratuitous ARP packets · fcb0e8c2
      Stefan Berger 提交于
      This patch enables filtering of gratuitous ARP packets using the following XML:
      
      <rule action='accept' direction='in' priority='425'>
      <arp gratuitous='true'/>
      </rule>
      fcb0e8c2
  4. 17 5月, 2011 1 次提交
  5. 14 5月, 2011 1 次提交
    • W
      test: all test_scripts should be part of tarball when building without libvirtd · 72a85f5b
      Wen Congyang 提交于
      Steps to reproduce this problem:
      1. # ./autogen.sh --without-libvirtd
      2. # make dist
      3. # rpmbuild --nodeps --define "_sourcedir `pwd`" -ba libvirt.spec
         ...
         make  check-TESTS
         make[1]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/tests'
         make[1]: *** No rule to make target `test_conf.sh', needed by `check-TESTS'.  Stop.
         make[1]: Leaving directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/tests'
         make: *** [check-am] Error 2
         error: Bad exit status from /var/tmp/rpm-tmp.7Rb9PV (%check)
      72a85f5b
  6. 11 5月, 2011 2 次提交
    • E
      tests: avoid crash when run under gcov · 70ea7dec
      Eric Blake 提交于
      Running ./autobuild.sh failed when gcov is installed, because
      commandtest ended up crashing during gcov's getenv() call after
      exit() had already started.  I traced this nasty bug back to
      a scoping issue present since the test introduction.
      
      * tests/commandtest.c (mymain): Move newenv...
      (newenv): ...to a scope that is still useful during exit().
      70ea7dec
    • P
      xen: parse and generate hpet item in sxpr · e547e44c
      Paolo Bonzini 提交于
      Recent versions of Xen disable the virtual HPET by default.  This is
      usually more precise because tick policies are not implemented for
      the HPET in Xen.  However, there may be several reasons to control
      the HPET manually: 1) to test the emulation; 2) because distros may
      provide the knob while leaving the default to "enabled" for compatibility
      reasons.
      
      This patch provides support for the hpet item in both sexpr and xm
      formats, and translates it to a <timer> element.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e547e44c
  7. 06 5月, 2011 1 次提交
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  8. 04 5月, 2011 1 次提交
  9. 03 5月, 2011 2 次提交
    • E
      tests: suppress more valgrind situations · 3109d2bf
      Eric Blake 提交于
      * tests/.valgrind.supp: Consolidate bash suppressions.  Ignore
      more libnl issues.
      3109d2bf
    • E
      tests: avoid compiler warning · 0620e83d
      Eric Blake 提交于
      ../../tests/xmconfigtest.c: In function 'testCompareParseXML':
      ../../tests/xmconfigtest.c:49:19: error: 'conn' may be used uninitialized in this function [-Wuninitialized]
      
      * tests/xmconfigtest.c (testCompareParseXML): Initialize variable.
      0620e83d
  10. 01 5月, 2011 2 次提交
  11. 30 4月, 2011 3 次提交
    • E
      hash: fix memory leak regression · 701bee01
      Eric Blake 提交于
      Commit 1671d1dc introduced a memory leak in virHashFree, and
      wholesale table corruption in virHashRemoveSet (elements not
      requested to be freed are lost).
      
      * src/util/hash.c (virHashFree): Free bucket array.
      (virHashRemoveSet): Don't lose elements.
      * tests/hashtest.c (testHashCheckForEachCount): New method.
      (testHashCheckCount): Expose the bug.
      701bee01
    • E
      build: fix getcwd portability problems · e39c46a5
      Eric Blake 提交于
      * bootstrap.conf (gnulib_modules): Add getcwd-lgpl.
      * tests/commandtest.c (checkoutput): Drop unused cwd.
      * tests/commandhelper.c (main): Let getcwd malloc.
      * tests/testutils.c (virTestMain): Likewise.
      * tools/virsh.c (cmdPwd): Likewise.
      (virshCmds): Expose cmdPwd and cmdCd on mingw.
      e39c46a5
    • E
      tests: simplify common setup · 20986e58
      Eric Blake 提交于
      A few of the tests were missing basic sanity checks, while most
      of them were doing copy-and-paste initialization (in fact, some
      of them pasted the argc > 1 check more than once!).  It's much
      nicer to do things in one common place, and minimizes the size of
      the next patch that fixes getcwd usage.
      
      * tests/testutils.h (EXIT_AM_HARDFAIL): New define.
      (progname, abs_srcdir): Define for all tests.
      (VIRT_TEST_MAIN): Change callback signature.
      * tests/testutils.c (virtTestMain): Do more common init.
      * tests/commandtest.c (mymain): Simplify.
      * tests/cputest.c (mymain): Likewise.
      * tests/esxutilstest.c (mymain): Likewise.
      * tests/eventtest.c (mymain): Likewise.
      * tests/hashtest.c (mymain): Likewise.
      * tests/networkxml2xmltest.c (mymain): Likewise.
      * tests/nodedevxml2xmltest.c (myname): Likewise.
      * tests/nodeinfotest.c (mymain): Likewise.
      * tests/nwfilterxml2xmltest.c (mymain): Likewise.
      * tests/qemuargv2xmltest.c (mymain): Likewise.
      * tests/qemuhelptest.c (mymain): Likewise.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      * tests/qparamtest.c (mymain): Likewise.
      * tests/sexpr2xmltest.c (mymain): Likewise.
      * tests/sockettest.c (mymain): Likewise.
      * tests/statstest.c (mymain): Likewise.
      * tests/storagepoolxml2xmltest.c (mymain): Likewise.
      * tests/storagevolxml2xmltest.c (mymain): Likewise.
      * tests/virbuftest.c (mymain): Likewise.
      * tests/virshtest.c (mymain): Likewise.
      * tests/vmx2xmltest.c (mymain): Likewise.
      * tests/xencapstest.c (mymain): Likewise.
      * tests/xmconfigtest.c (mymain): Likewise.
      * tests/xml2sexprtest.c (mymain): Likewise.
      * tests/xml2vmxtest.c (mymain): Likewise.
      20986e58
  12. 28 4月, 2011 1 次提交
  13. 27 4月, 2011 1 次提交
    • J
      tests: More unit tests for internal hash APIs · 91e12a50
      Jiri Denemark 提交于
      This adds several tests for remaining hash APIs (custom
      hasher/comparator functions are not covered yet, though).
      
      All tests pass both before and after the "Simplify hash implementation".
      91e12a50
  14. 21 4月, 2011 1 次提交
    • E
      build: fix 32-bit test failure · 1fc288e1
      Eric Blake 提交于
      ARRAY_CARDINALITY is typed as size_t, not long; this matters on 32-bit
      platforms:
      
      hashtest.c: In function 'testHashRemoveForEach':
      hashtest.c:114: error: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int' [-Wformat]
      
      * tests/hashtest.c (testHashRemoveForEach): Use correct format.
      1fc288e1
  15. 16 4月, 2011 2 次提交
  16. 15 4月, 2011 2 次提交
    • M
      Introduce virDomainChrDefNew() · 2ac455c4
      Michal Novotny 提交于
      Make: passed
      Make check: passed
      Make syntax-check: passed
      
      this is the commit to introduce the function to create new character
      device definition for the domain as advised by Cole Robinson
      <crobinso@redhat.com>.
      
      The function is used on the relevant places and also new tests has
      been added.
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      2ac455c4
    • M
      Spice: support audio, images and stream compression · abb1570e
      Michal Privoznik 提交于
      This extends the SPICE XML to allow variable compression settings for audio,
      images and streaming:
          <graphics type='spice' port='5901' tlsPort='-1' autoport='yes'>
              <image compression='auto_glz'/>
              <jpeg compression='auto'/>
              <zlib compression='auto'/>
              <playback compression='on'/>
          </graphics>
      
      All new elements are optional.
      abb1570e
  17. 08 4月, 2011 1 次提交
    • S
      nwfilters: support for TCP flags evaluation · 6ab24feb
      Stefan Berger 提交于
      This patch adds support for the evaluation of TCP flags in nwfilters.
      
      It adds documentation to the web page and extends the tests as well.
      Also, the nwfilter schema is extended.
      
      The following are some example for rules using the tcp flags:
      
      <rule action='accept' direction='in'>
          <tcp state='NONE' flags='SYN/ALL' dsptportstart='80'/>
      </rule>
      <rule action='drop' direction='in'>
          <tcp state='NONE' flags='SYN/ALL'/>
      </rule>
      6ab24feb
  18. 07 4月, 2011 1 次提交
  19. 05 4月, 2011 4 次提交
    • D
      Enable use of -Wold-style-definition compiler flag · a4e37ff1
      Daniel P. Berrange 提交于
      A couple of functions were declared using the old style foo()
      for no-parameters, instead of foo(void)
      
      * src/xen/xen_hypervisor.c, tests/testutils.c: Replace () with (void)
        in some function declarations
      * m4/virt-compile-warnings.m4: Enable -Wold-style-definition
      a4e37ff1
    • D
      Enable use of -Wmissing-noreturn · 329e9dc6
      Daniel P. Berrange 提交于
      * src/internal.h: Define a ATTRIBUTE_NO_RETURN annotation
      * src/lxc/lxc_container.c: Annotate lxcContainerDummyChild
        with ATTRIBUTE_NO_RETURN
      * tests/eventtest.c: Mark async thread as ATTRIBUTE_NO_RETURN
      * m4/virt-compile-warnings.m4: Enable -Wmissing-noreturn
      329e9dc6
    • D
      Enable -Wmissing-format-attribute warning · 7d76d5d5
      Daniel P. Berrange 提交于
      Add a couple of missing ATTRIBUTE_FMT_PRINTF annotations
      
      * tools/virsh.c, tests/testutils.c: Add printf format attribute
      * m4/virt-compile-warnings.m4: Enable -Wmissing-format-attribute
      7d76d5d5
    • M
      vmx: Support persistent CPU shares · 81800ff6
      Matthias Bolte 提交于
      81800ff6
  20. 29 3月, 2011 2 次提交
    • O
      cputune: New tests for cputune XML · 079ae9c7
      Osier Yang 提交于
      v1 - v2:
        * Add missed tests/qemuxml2argvdata/qemuxml2argv-cputune.args
      079ae9c7
    • E
      qemu: fix restoring a compressed save image · d51023d4
      Eric Blake 提交于
      Latent bug introduced in commit 2d6a5819 (Aug 2009), but not exposed
      until commit 1859939a (Jan 2011).  Basically, when virExec creates a
      pipe, it always marks libvirt's side as cloexec.  If libvirt then
      wants to hand that pipe to another child process, things work great if
      the fd is dup2()'d onto stdin or stdout (as with stdin: or exec:
      migration), but if the pipe is instead used as-is (such as with fd:
      migration) then qemu sees EBADF because the fd was closed at exec().
      
      This is a minimal fix for the problem at hand; it is slightly racy,
      but no more racy than the rest of libvirt fd handling, including the
      case of uncompressed save images.  A more invasive fix, but ultimately
      safer at avoiding leaking unintended fds, would be to _always and
      atomically_ open all fds as cloexec in libvirt (thanks to primitives
      like open(O_CLOEXEC), pipe2(), accept4(), ...), then teach virExec to
      clear that bit for all fds explicitly marked to be handed to the child
      only after forking.
      
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Clear cloexec
      flag.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Tweak test.
      d51023d4
  21. 28 3月, 2011 1 次提交
    • E
      tests: don't alter state in $HOME · d0c7254b
      Eric Blake 提交于
      Diego reported a bug where virsh tries to initialize a readline
      history directory during 'make check' run as root, but fails
      because /root was read-only.
      
      It turns out that I could reproduce this as non-root, by using:
      
      mv ~/.virsh{,.bak}
      chmod a-w ~
      make check -C tests TESTS=int-overflow
      chmod u+w ~
      mv ~/.virsh{.bak,}
      
      * tests/int-overflow: Don't trigger interactive mode.
      Reported by Diego Elio Pettenò.
      d0c7254b
  22. 25 3月, 2011 1 次提交
    • E
      command: add virCommandAbort for cleanup paths · 9ed54518
      Eric Blake 提交于
      Sometimes, an asynchronous helper is started (such as a compressor
      or iohelper program), but a later error means that we want to
      abort that child.  Make this easier.
      
      Note that since daemons and virCommandRunAsync can't mix, the only
      time virCommandFree can reap a process is if someone did
      virCommandRunAsync for a non-daemon and didn't stash the pid.
      
      * src/util/command.h (virCommandAbort): New prototype.
      * src/util/command.c (_virCommand): Add new field.
      (virCommandRunAsync, virCommandWait): Track whether pid was used.
      (virCommandFree): Reap child if caller did not request pid.
      (virCommandAbort): New function.
      * src/libvirt_private.syms (command.h): Export it.
      * tests/commandtest.c (test19): New test.
      9ed54518
  23. 07 3月, 2011 1 次提交
    • D
      Move event code out of the daemon/ into src/util/ · 343eaa15
      Daniel P. Berrange 提交于
      The event loop implementation is used by more than just the
      daemon, so move it into the shared area.
      
      * daemon/event.c, src/util/event_poll.c: Renamed
      * daemon/event.h, src/util/event_poll.h: Renamed
      * tools/Makefile.am, tools/console.c, tools/virsh.c: Update
        to use new virEventPoll APIs
      * daemon/mdns.c, daemon/mdns.c, daemon/Makefile.am: Update
        to use new virEventPoll APIs
      343eaa15
  24. 06 3月, 2011 1 次提交
    • O
      qemu: Support vram for video of qxl type · 82dfc6f3
      Osier Yang 提交于
      For qemu names the primary vga as "qxl-vga":
      
        1) if vram is specified for 2nd qxl device:
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,vram_size=$SIZE,...
      
        2) if vram is not specified for 2nd qxl device, (use the default
           set by global):
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,...
      
      For qemu names all qxl devices as "qxl":
      
        1) if vram is specified for 2nd qxl device:
      
          -vga qxl -global qxl.vram_size=$SIZE \
          -device qxl,id=video1,vram_size=$SIZE ...
      
        2) if vram is not specified for 2nd qxl device:
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,...
      
      "-global" is the only way to define vram_size for the primary qxl
      device, regardless of how qemu names it, (It's not good a good
      way, as original idea of "-global" is to set a global default for
      a driver property, but to specify vram for first qxl device, we
      have to use it).
      
      For other qxl devices, as they are represented by "-device", could
      specify it directly and seperately for each, and it overrides the
      default set by "-global" if specified.
      
      v1 - v2:
        * modify "virDomainVideoDefaultRAM" so that it returns 16M as the
          default vram_size for qxl device.
      
        * vram_size * 1024 (qemu accepts bytes for vram_size).
      
        * apply default vram_size for qxl device for which vram_size is
          not specified.
      
        * modify "graphics-spice" tests (more sensiable vram_size)
      
        * Add an argument of virDomainDefPtr type for qemuBuildVideoDevStr,
          to use virDomainVideoDefaultRAM in qemuBuildVideoDevStr).
      
      v2 - v3:
        * Modify default video memory size for qxl device from 16M to 24M
      
        * Update codes to be consistent with changes on qemu_capabilities.*
      82dfc6f3
  25. 03 3月, 2011 1 次提交
    • E
      maint: avoid long lines in more tests · 3b750d13
      Eric Blake 提交于
      * tests/xml2sexprdata/*.sexpr: Add backslash-newlines.
      * tests/sexpr2xmldata/*.sexpr: Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args: Likewise.
      3b750d13