1. 19 9月, 2014 1 次提交
  2. 25 4月, 2014 1 次提交
  3. 25 3月, 2014 1 次提交
  4. 18 3月, 2014 1 次提交
  5. 15 3月, 2014 1 次提交
    • C
      qemu: XMLToNative: Don't show -S · e8400564
      Cole Robinson 提交于
      -S causes qemu to start in the paused state. Since XML2Native is intended
      to generate something that users can run directly, this will trip them up.
      e8400564
  6. 20 2月, 2014 1 次提交
    • D
      Introduce new OOM testing support · 590029f6
      Daniel P. Berrange 提交于
      The previous OOM testing support would re-run the entire "main"
      method each iteration, failing a different malloc each time.
      When a test suite has 'n' allocations, the number of repeats
      requires is  (n * (n + 1) ) / 2.  This gets very large, very
      quickly.
      
      This new OOM testing support instead integrates at the
      virtTestRun level, so each individual test case gets repeated,
      instead of the entire test suite. This means the values of
      'n' are orders of magnitude smaller.
      
      The simple usage is
      
         $ VIR_TEST_OOM=1 ./qemuxml2argvtest
         ...
         29) QEMU XML-2-ARGV clock-utc                                         ... OK
             Test OOM for nalloc=36 .................................... OK
         30) QEMU XML-2-ARGV clock-localtime                                   ... OK
             Test OOM for nalloc=36 .................................... OK
         31) QEMU XML-2-ARGV clock-france                                      ... OK
             Test OOM for nalloc=38 ...................................... OK
         ...
      
      the second lines reports how many mallocs have to be failed, and thus
      how many repeats of the test will be run.
      
      If it crashes, then running under valgrind will often show the problem
      
        $ VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When debugging problems it is also helpful to select an individual
      test case
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When things get really tricky, it is possible to request that just
      specific allocs are failed. eg to fail allocs 5 -> 12, use
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-12 ../run valgrind ./qemuxml2argvtest
      
      In the worse case, you might want to know the stack trace of the
      alloc which was failed then VIR_TEST_OOM_TRACE can be set. If it
      is set to 1 then it will only print if it thinks a mistake happened.
      This is often not reliable, so setting it to 2 will make it print
      the stack trace for every alloc that is failed.
      
        $ VIR_TEST_OOM_TRACE=2 VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-5 ../run valgrind ./qemuxml2argvtest
        30) QEMU XML-2-ARGV clock-localtime                                   ... OK
            Test OOM for nalloc=36 !virAllocN
        /home/berrange/src/virt/libvirt/src/util/viralloc.c:180
        virHashCreateFull
        /home/berrange/src/virt/libvirt/src/util/virhash.c:144
        virDomainDefParseXML
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:11745
        virDomainDefParseNode
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12646
        virDomainDefParse
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12590
        testCompareXMLToArgvFiles
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:106
        virtTestRun
        /home/berrange/src/virt/libvirt/tests/testutils.c:250
        mymain
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:418 (discriminator 2)
        virtTestMain
        /home/berrange/src/virt/libvirt/tests/testutils.c:750
        ??
        ??:0
        _start
        ??:?
         FAILED
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      590029f6
  7. 11 1月, 2014 1 次提交
  8. 28 11月, 2013 1 次提交
    • E
      tests: guarantee abs_srcdir in all C tests · 0aa873d7
      Eric Blake 提交于
      While trying to debug a failure of virpcitest during 'make distcheck',
      I noticed that with a VPATH build, 'cd tests; ./virpcitest' fails for
      an entirely different reason.  To reproduce the distcheck failure, I
      had to run 'cd tests; abs_srcdir=/path/to/src ./virpcitest'.  But we
      document in HACKING that all of our tests are supposed to be runnable
      without requiring extra environment variables.
      
      The solution: hardcode the location of srcdir into the just-built
      binaries, rather than requiring make to prepopulate environment
      variables.  With this, './virpcitest' passes even in a VPATH build
      (provided that $(srcdir) is writable; a followup patch will fix the
      conditions required by 'make distcheck').  [Note: the makefile must
      still pass on directory variables to the test environment of shell
      scripts, since those aren't compiled.  So while this solves the case
      of a compiled test, it still requires environment variables to pass
      a VPATH build of any shell script test case that relies on srcdir.]
      
      * tests/Makefile.am (AM_CFLAGS): Define abs_srcdir in all compiled
      tests.
      * tests/testutils.h (abs_srcdir): Quit declaring.
      * tests/testutils.c (virtTestMain): Rely on define rather than
      environment variable.
      * tests/virpcimock.c (pci_device_new_from_stub): Rely on define.
      * tests/cputest.c (mymain): Adjust abs_top_srcdir default.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxmlnstest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0aa873d7
  9. 08 10月, 2013 1 次提交
  10. 20 5月, 2013 1 次提交
    • O
      qemu: Add callback struct for qemuBuildCommandLine · 3a6204cb
      Osier Yang 提交于
      Since 0d70656a, it starts to access the sysfs files to build
      the qemu command line (by virSCSIDeviceGetSgName, which is to find
      out the scsi generic device name by adpater:bus:target:unit), there
      is no way to work around, qemu wants to see the scsi generic device
      like "/dev/sg6" anyway.
      
      And there might be other places which need to access sysfs files
      when building qemu command line in future.
      
      Instead of increasing the arguments of qemuBuildCommandLine, this
      introduces a new callback for qemuBuildCommandLine, and thus tests
      can register their own callbacks for sysfs test input files accessing.
      
      * src/qemu/qemu_command.h: (New callback struct
                                  qemuBuildCommandLineCallbacks;
                                  extern buildCommandLineCallbacks)
      * src/qemu/qemu_command.c: (wire up the callback struct)
      * src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
      * src/qemu/qemu_hotplug.c: Likewise
      * src/qemu/qemu_process.c: Likewise
      * tests/testutilsqemu.[ch]: (Helper testSCSIDeviceGetSgName;
                                   callback struct testCallbacks;)
      * tests/qemuxml2argvtest.c: (Use testCallbacks)
      * src/tests/qemuxmlnstest.c: (Like above)
      3a6204cb
  11. 10 5月, 2013 1 次提交
  12. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  13. 17 4月, 2013 1 次提交
  14. 05 4月, 2013 3 次提交
  15. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  16. 08 2月, 2013 2 次提交
  17. 05 2月, 2013 1 次提交
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d
  18. 19 12月, 2012 1 次提交
  19. 29 11月, 2012 1 次提交
  20. 27 9月, 2012 2 次提交
  21. 13 9月, 2012 1 次提交
    • D
      Turn QEMU capabilities object into a full virObjectPtr · beac09fd
      Daniel P. Berrange 提交于
      The current qemu capabilities are stored in a virBitmapPtr
      object, whose type is exposed to callers. We want to store
      more data besides just the flags, so we need to move to a
      struct type. This object will also need to be reference
      counted, since we'll be maintaining a cache of data per
      binary. This change introduces a 'qemuCapsPtr' virObject
      class. Most of the change is just renaming types and
      variables in all the callers
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      beac09fd
  22. 07 8月, 2012 1 次提交
    • D
      Convert public datatypes to inherit from virObject · 46ec5f85
      Daniel P. Berrange 提交于
      This converts the following public API datatypes to use the
      virObject infrastructure:
      
        virConnectPtr
        virDomainPtr
        virDomainSnapshotPtr
        virInterfacePtr
        virNetworkPtr
        virNodeDevicePtr
        virNWFilterPtr
        virSecretPtr
        virStreamPtr
        virStorageVolPtr
        virStoragePoolPtr
      
      The code is significantly simplified, since the mutex in the
      virConnectPtr object now only needs to be held when accessing
      the per-connection virError object instance. All other operations
      are completely lock free.
      
      * src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
        public datatypes to use virObject
      * src/conf/domain_event.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/storage/storage_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
        tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
        to use virObjectUnref/virObjectRef
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      46ec5f85
  23. 11 7月, 2012 1 次提交
  24. 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
  25. 04 2月, 2012 1 次提交
    • E
      build: expand rule to cover testsuite · 8fe454ce
      Eric Blake 提交于
      The bulk of this patch was done with:
      
      sed -i 's/\(\bfree *(/VIR_FREE(/g' tests/*.c
      
      followed by fixing the few compile errors that resulted.
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
      Remove tests from exemption.
      * tests/testutils.h: Add common header.
      * tests/commandhelper.c: Fix offenders.
      * tests/cputest.c: Likewise.
      * tests/domainsnapshotxml2xmltest.c: Likewise.
      * tests/interfacexml2xmltest.c: Likewise.
      * tests/networkxml2argvtest.c: Likewise.
      * tests/networkxml2xmltest.c: Likewise.
      * tests/nodedevxml2xmltest.c: Likewise.
      * tests/nodeinfotest.c: Likewise.
      * tests/nwfilterxml2xmltest.c: Likewise.
      * tests/qemuargv2xmltest.c: Likewise.
      * tests/qemuxml2argvtest.c: Likewise.
      * tests/qemuxml2xmltest.c: Likewise.
      * tests/qemuxmlnstest.c: Likewise.
      * tests/qparamtest.c: Likewise.
      * tests/sexpr2xmltest.c: Likewise.
      * tests/storagepoolxml2xmltest.c: Likewise.
      * tests/storagevolxml2xmltest.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/virshtest.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      * tests/xml2sexprtest.c: Likewise.
      8fe454ce
  26. 21 12月, 2011 1 次提交
    • M
      qemu: Add a capability flag for -no-acpi · 5abbe04d
      Michael Ellerman 提交于
      Currently non-x86 guests must have <acpi/> defined in <features> to
      prevent libvirt from running qemu with -no-acpi. Although it works, it
      is a hack.
      
      Instead add a capability flag which indicates whether qemu understands
      the -no-acpi option. Use it to control whether libvirt emits -no-acpi.
      
      Current versions of qemu always display -no-acpi in their help output,
      so this patch has no effect. However the development version of qemu
      has been modified such that -no-acpi is only displayed when it is
      actually supported.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      5abbe04d
  27. 02 12月, 2011 1 次提交
    • E
      build: properly skip tests · da8061ee
      Eric Blake 提交于
      I got this failure on FreeBSD:
      
      shunloadtest.c: In function 'main':
      shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)
      
      but inspection showed several other problems, all fixed here.
      
      * tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
      EXIT_AM_SKIP is defined.
      * tests/esxutilstest.c [!WITH_ESX]: Likewise.
      * tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
      * tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
      * tests/shunloadtest.c [!linux]: Likewise.
      * tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
      * tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
      da8061ee
  28. 19 11月, 2011 1 次提交
    • D
      Rename Macvtap management APIs · 43925db7
      Daniel P. Berrange 提交于
      In preparation for code re-organization, rename the Macvtap
      management APIs to have the following patterns
      
        virNetDevMacVLanXXXXX     - macvlan/macvtap interface management
        virNetDevVPortProfileXXXX - virtual port profile management
      
      * src/util/macvtap.c, src/util/macvtap.h: Rename APIs
      * src/conf/domain_conf.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_command.h,
        src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
        src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
        src/qemu/qemu_process.h: Update for renamed APIs
      43925db7
  29. 25 10月, 2011 1 次提交
  30. 19 10月, 2011 1 次提交
    • P
      qemu: Test name-space handling · aa84f966
      Philipp Hahn 提交于
      Add test cases for parsing the qemu-name-space.
      This is based on qemuxml2argv{test,data/}, but can not reside in
      qemuxml2argv{test,data/} because ...
      
      1. qemuxmlns-qemu-ns-domain.xml is not schema-valid and breaks
      domainschematest. The test is still important to detect xmlns:qemu
      bindings to a name-space other than
      http://libvirt.org/schemas/domain/qemu/1.0
      
      2. they break qemuxml2xml, because the xmlns:qemu binding is moved to
      the top-level <domain> element when converting from argv to xml.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      aa84f966