1. 23 3月, 2012 3 次提交
  2. 29 2月, 2012 1 次提交
  3. 28 2月, 2012 1 次提交
    • J
      qemu: unescape HMP commands before converting them to json · f27f616f
      Josh Durgin 提交于
      QMP commands don't need to be escaped since converting them to json
      also escapes special characters. When a QMP command fails, however,
      libvirt falls back to HMP commands. These fallback functions
      (qemuMonitorText*) do their own escaping, and pass the result directly
      to qemuMonitorHMPCommandWithFd. If the monitor is in json mode, these
      pre-escaped commands will be escaped again when converted to json,
      which can result in the wrong arguments being sent.
      
      For example, a filename test\file would be sent in json as
      test\\file.
      
      This prevented attaching an image file with a " or \ in its name in
      qemu 1.0.50, and also broke rbd attachment (which uses backslashes to
      escape some internal arguments.)
      Reported-by: NMasuko Tomoya <tomoya.masuko@gmail.com>
      Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f27f616f
  4. 25 2月, 2012 1 次提交
    • D
      Workaround python header file insanity · 1d4c4d9d
      Daniel P. Berrange 提交于
      The /usr/include/python/pyconfig.h file pollutes the global
      namespace with a huge number of HAVE_XXX and WITH_XXX
      defines. These change what we detected in our own config.h
      In particular if you try to build without DTrace, python's
      headers turn it back on with predictable fail.
      
      THe hack to workaround this is to rename WITH_DTRACE to
      WITH_DTRACE_PROBES to avoid the namespace clash
      1d4c4d9d
  5. 04 2月, 2012 1 次提交
    • E
      build: clean up CPPFLAGS/INCLUDES usage · cb33ee1f
      Eric Blake 提交于
      Our syntax checker missed all-lower-case variables (this will
      be fixed by the next .gnulib update).  Additionally, anywhere
      that we mix in-tree files with generated files, automake recommends
      listing builddir prior to srcdir for VPATH builds.
      
      * src/Makefile.am (*_la_CFLAGS): Favor $(top_srcdir).
      (INCLUDES): Likewise, and follow automake recommendations on
      builddir before srcdir.
      * python/Makefile.am (INCLUDES): Swap directory order.
      * tests/Makefile.am (INCLUDES): Likewise.
      * tools/Makefile.am (INCLUDES): Likewise.
      * daemon/Makefile.am (INCLUDES): Likewise.
      (libvirtd.init, libvirtd.service): Favor $().
      * examples/hellolibvirt/Makefile.am (hellolibvirt_LDADD):
      Likewise.
      * examples/openauth/Makefile.am (openauth_LDADD): Likewise.
      * examples/dominfo/Makefile.am (INCLUDES): Drop dead include.
      * examples/domsuspend/Makefile.am (INCLUDES): Likewise.
      cb33ee1f
  6. 26 1月, 2012 1 次提交
  7. 30 11月, 2011 1 次提交
    • D
      Add internal APIs for dealing with time · 3ec12898
      Daniel P. Berrange 提交于
      The logging APIs need to be able to generate formatted timestamps
      using only async signal safe functions. This rules out using
      gmtime/localtime/malloc/gettimeday(!) and much more.
      
      Introduce a new internal API which is async signal safe.
      
        virTimeMillisNowRaw replacement for gettimeofday. Uses clock_gettime
                            where available, otherwise falls back to the unsafe
                            gettimeofday
      
        virTimeFieldsNowRaw  replacements for gmtime(), convert a timestamp
        virTimeFieldsThenRaw into a broken out set of fields. No localtime()
                             replacement is provided, because converting to
                             local time is not practical with only async signal
                             safe APIs.
      
        virTimeStringNowRaw  replacements for strftime() which print a timestamp
        virTimeStringThenRaw into a string, using a pre-determined format, with
                             a fixed size buffer (VIR_TIME_STRING_BUFLEN)
      
      For each of these there is also a version without the Raw postfix
      which raises a full libvirt error. These versions are not async
      signal safe
      
      * src/Makefile.am, src/util/virtime.c, src/util/virtime.h: New files
      * src/libvirt_private.syms: New APis
      * configure.ac: Check for clock_gettime in -lrt
      * tests/virtimetest.c, tests/Makefile.am: Test new APIs
      3ec12898
  8. 21 10月, 2011 1 次提交
    • E
      snapshot: test domainsnapshot indentation · 27b3b303
      Eric Blake 提交于
      Add a test for the simple parts of my indentation changes, and
      fix the fallout.
      
      * tests/domainsnapshotxml2xmltest.c: New test.
      * tests/Makefile.am (domainsnapshotxml2xmltest_SOURCES): Build it.
      * src/conf/domain_conf.c (virDomainSnapshotDefFormat): Avoid NULL
      deref, match documented order.
      * src/conf/domain_conf.h (virDomainSnapshotDefFormat): Add const.
      * tests/domainsnapshotxml2xmlout/all_parameters.xml: Tweak output.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Likewise.
      * tests/domainsnapshotxml2xmlout/full_domain.xml: Likewise.
      * .gitignore: Exempt new binary.
      27b3b303
  9. 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
  10. 12 10月, 2011 2 次提交
    • E
      build: fix 'make check' linkage with dtrace · b794d2a5
      Eric Blake 提交于
      Building on Linux with dtrace enabled was failing 'make check':
      
        CCLD   nodeinfotest
      ../src/.libs/libvirt_test.a(libvirt_net_rpc_client_la-virnetclient.o): In function `virNetClientNew':
      /home/remote/eblake/libvirt/src/rpc/virnetclient.c:162: undefined reference to `libvirt_rpc_client_new_semaphore'
      
      On looking further, I see some earlier warnings emitted from libtool:
      
      *** Warning: Linking the shared library libvirt.la against the non-libtool
      *** objects  probes.o is not portable!
      
      Since src/probes.o is only built on Linux, and even then, only when
      dtrace is enabled, this failure does not affect other platforms, and
      despite libtool warning that it is not generally portable, it is not
      a problem for our use-case in libvirt.la.  But it turns out that while
      libtool is willing to jam raw .o files into an installed shared
      library (libvirt.la becomes libvirt.so), it is NOT willing to jam
      the same .o file into the convenience library libvirt_test.la.
      Perhaps this is a bug in libtool, but even if we get libtool fixed,
      libvirt must continue to build on platforms with older libtool.  So,
      the fix is the same as we are already using for the libvirt_lxc
      executable - don't rely on the .o file being in the convenience
      library, but instead use LDADD to pull it in directly.
      
      * tests/Makefile.am (PROBES_O): New macro.
      (LDADDS): Use it to fix link errors.
      b794d2a5
    • J
      build: Fix VPATH build with new probes · 15d52307
      Jiri Denemark 提交于
      15d52307
  11. 17 9月, 2011 1 次提交
    • D
      Prevent crash from dlclose() of libvirt.so · 8e44e559
      Daniel P. Berrange 提交于
      When libvirt calls virInitialize it creates a thread local
      for the virErrorPtr storage, and registers a callback to
      cleanup memory when a thread exits. When libvirt is dlclose()d
      or otherwise made non-resident, the callback function is
      removed from memory, but the thread local may still exist
      and if a thread later exists, it will invoke the callback
      and SEGV. There may also be other thread locals with callbacks
      pointing to libvirt code, so it is in general never safe to
      unload libvirt.so from memory once initialized.
      
      To allow dlclose() to succeed, but keep libvirt.so resident
      in memory, link with '-z nodelete'. This issue was first
      found with the libvirt CIM provider, but can potentially
      hit many of the dynamic language bindings which all ultimately
      involve dlopen() in some way, either on libvirt.so itself,
      or on the glue code for the binding which in turns links
      to libvirt
      
      * configure.ac, src/Makefile.am: Ensure libvirt.so is linked
        with -z nodelete
      * cfg.mk, .gitignore, tests/Makefile.am, tests/shunloadhelper.c,
        tests/shunloadtest.c: A test case to unload libvirt while
        a thread is still running.
      8e44e559
  12. 30 7月, 2011 1 次提交
    • E
      build: avoid non-portable shell in test setup · 343ab982
      Eric Blake 提交于
      POSIX states that 'a=1; a=2 b=$a command' has unspecified results
      for the value of $b visible within command.  In particular, on
      BSD, this resulted in PATH not picking up the in-test ssh.
      
      * tests/Makefile.am (lv_abs_top_builddir): New macro.
      (path_add, TESTS_ENVIRONMENT): Use it to avoid referring to an
      environment variable set previously within the same command line.
      Reported by Matthias Bolte.
      343ab982
  13. 29 7月, 2011 2 次提交
    • M
      freebsd: Fix build problem due to picking up the wrong libvirt.h · b590866b
      Matthias Bolte 提交于
      Gettext annoyingly modifies CPPFLAGS in-place, putting
      -I/usr/local/include into the search patch if libintl headers
      must be used from that location.  But since we must support
      automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used
      prior to INCLUDES, this means that the build picks up the _old_
      installed libvirt.h in priority to the in-tree version, leading
      to all sorts of weird build failures on FreeBSD.
      
      Fix this by teaching configure to undo gettext's actions, but
      to keep any changes required by gettext at the end of INCLUDES
      after all in-tree locations are used first.  Also requires
      adding a wrapper Makefile.am and making gnulib-tool create
      just gnulib.mk files during the bootstrap process.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b590866b
    • E
      maint: add missing copyright notices · ff81956a
      Eric Blake 提交于
      I went with the shorter license notice used by src/libvirt.c,
      rather than spelling out the full LGPLv2+ clause into each of
      these files.
      
      * configure.ac: Declare copyright.
      * all Makefile.am: Likewise.
      ff81956a
  14. 25 7月, 2011 1 次提交
    • E
      tests: fix compilation failures · 5283ea9b
      Eric Blake 提交于
      Even though gnutls is a hard-req for libvirt, and gnutls depends
      on libtasn1, that does not mean that you have to have the libtasn1
      development files installed.  Skip the test rather than failing
      compilation in that case.
      
      With newer gcc, the test consumed too much stack space.  Move
      things to static storage to fix that.
      
      * configure.ac (AC_CHECK_HEADERS): Check for libtasn1.h.
      (HAVE_LIBTASN1): New automake conditional.
      * tests/Makefile.am (virnettlsconvirnettlscontexttest_SOURCES)
      (virnettlscontexttest_LDADD): Allow compilation without libtasn1.
      * tests/virnettlscontexttest.c: Skip test if headers not present.
      (struct testTLSCertReq): Alter time members.
      (testTLSGenerateCert): Reflect the change.
      (mymain): Reduce stack usage.
      5283ea9b
  15. 22 7月, 2011 2 次提交
    • D
      Add a test case for certificate validation · bd789dff
      Daniel P. Berrange 提交于
      This test case checks certification validation rules for
      
       - Basic constraints
       - Key purpose
       - Key usage
       - Start/expiry times
      
      It checks initial context creation sanity checks, and live
      session validation
      bd789dff
    • L
      network: internal API functions to manage assignment of physdev to guest · 04711a0f
      Laine Stump 提交于
      The network driver needs to assign physical devices for use by modes
      that use macvtap, keeping track of which physical devices are in use
      (and how many instances, when the devices can be shared). Three calls
      are added:
      
      networkAllocateActualDevice - finds a physical device for use by the
      domain, and sets up the virDomainActualNetDef accordingly.
      
      networkNotifyActualDevice - assumes that the domain was already
      running, but libvirtd was restarted, and needs to be notified by each
      already-running domain about what interfaces they are using.
      
      networkReleaseActualDevice - decrements the usage count of the
      allocated physical device, and frees the virDomainActualNetDef to
      avoid later accidentally using the device.
      
      bridge_driver.[hc] - the new APIs. When WITH_NETWORK is false, these
      functions are all #defined to be "0" in the .h file (effectively
      becoming a NOP) to prevent link errors.
      
      qemu_(command|driver|hotplug|process).c - add calls to the above APIs
          in the appropriate places.
      
      tests/Makefile.am - we need to include libvirt_driver_network.la
          whenever libvirt_driver_qemu.la is linked, to avoid unreferenced
          symbols (in functions that are never called by the test
          programs...)
      04711a0f
  16. 09 7月, 2011 1 次提交
  17. 08 7月, 2011 1 次提交
  18. 05 7月, 2011 1 次提交
  19. 02 7月, 2011 2 次提交
    • M
      tests: Add a general util test · ab0b2c19
      Matthias Bolte 提交于
      Move non-esx specific tests from esxutilstest there and add a
      test for virParseVersionString.
      ab0b2c19
    • E
      build: consistently use CFLAGS · 6ae3052c
      Eric Blake 提交于
      According to the automake manual, CPPFLAGS (aka INCLUDES, as spelled
      in automake 1.9.6) should only include -I, -D, and -U directives; more
      generic directives like -Wall belong in CFLAGS since they affect more
      phases of the build process.  Therefore, we should be sticking CFLAGS
      additions into a CFLAGS container, not a CPPFLAGS container.
      
      * src/Makefile.am (libvirt_driver_vmware_la_CFLAGS): Use AM_CFLAGS.
      (INCLUDES): Move CFLAGS items...
      (AM_CFLAGS): ...to their proper location.
      * python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
      * tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
      (commandtest_CFLAGS, commandhelper_CFLAGS)
      (virnetmessagetest_CFLAGS, virnetsockettest_CFLAGS): Use AM_CFLAGS.
      6ae3052c
  20. 01 7月, 2011 2 次提交
  21. 30 6月, 2011 1 次提交
  22. 25 6月, 2011 1 次提交
  23. 24 6月, 2011 2 次提交
    • D
      Introduce a generic object for using network sockets · 58b5b14e
      Daniel P. Berrange 提交于
      Introduces a simple wrapper around the raw POSIX sockets APIs
      and name resolution APIs. Allows for easy creation of client
      and server sockets with correct usage of name resolution APIs
      for protocol agnostic socket setup.
      
      It can listen for UNIX and TCP stream sockets.
      
      It can connect to UNIX, TCP streams directly, or indirectly
      to UNIX sockets via an SSH tunnel or external command
      
      * src/Makefile.am: Add to libvirt-net-rpc.la
      * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Generic
        sockets APIs
      * tests/Makefile.am: Add socket test
      * tests/virnetsockettest.c: New test case
      * tests/testutils.c: Avoid overriding LIBVIRT_DEBUG settings
      * tests/ssh.c: Dumb helper program for SSH tunnelling tests
      58b5b14e
    • D
      Provide a simple object for encoding/decoding RPC messages · ceacc1dd
      Daniel P. Berrange 提交于
      This provides a new struct that contains a buffer for the RPC
      message header+payload, as well as a decoded copy of the message
      header. There is an API for applying a XDR encoding & decoding
      of the message headers and payloads. There are also APIs for
      maintaining a simple FIFO queue of message instances.
      
      Expected usage scenarios are:
      
      To send a message
      
         msg = virNetMessageNew()
      
         ...fill in msg->header fields..
         virNetMessageEncodeHeader(msg)
         ...loook at msg->header fields to determine payload filter
         virNetMessageEncodePayload(msg, xdrfilter, data)
         ...send msg->bufferLength worth of data from buffer
      
      To receive a message
      
         msg = virNetMessageNew()
         ...read VIR_NET_MESSAGE_LEN_MAX of data into buffer
         virNetMessageDecodeLength(msg)
         ...read msg->bufferLength-msg->bufferOffset of data into buffer
         virNetMessageDecodeHeader(msg)
         ...look at msg->header fields to determine payload filter
         virNetMessageDecodePayload(msg, xdrfilter, data)
         ...run payload processor
      
      * src/Makefile.am: Add to libvirt-net-rpc.la
      * src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Internal
        message handling API.
      * testutils.c, testutils.h: Helper for printing binary differences
      * virnetmessagetest.c: Validate all XDR encoding/decoding
      ceacc1dd
  24. 27 5月, 2011 1 次提交
  25. 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
  26. 16 4月, 2011 2 次提交
  27. 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
  28. 16 1月, 2011 1 次提交
    • M
      tests: Remove obsolete secaatest · ed25dcc2
      Matthias Bolte 提交于
      Before the security driver was refactored in d6623003 seclabeltest and
      secaatest were basically the same. seclabeltest was meant for SELinux
      and secaatest for AppArmor. Both tests exited early when the specific
      security driver backend wasn't enabled.
      
      With the new security manager trying to initialize a disabled security
      driver backend is an error that can't be distinguished from other errors
      anymore. Therefore, the updated seclabeltest just asks for the first
      available backend as this will always work even with SELinux and AppArmor
      backend being disabled due to the new Nop backend.
      
      Remove the obsolete secaatest and compile and run the seclabeltest
      unconditional.
      
      This fixes make check on systems that support AppArmor.
      ed25dcc2
  29. 13 1月, 2011 1 次提交
    • E
      tests: virsh is no longer in builddir/src · 90c2a138
      Eric Blake 提交于
      Commit 870dba07 (Mar 2008) added builddir/src to PATH to pick
      up virsh.  Later, virsh was moved to tools; commit db68d6b1
      (Oct 2009) noticed this, but only added the new location rather
      than deleting the old location.
      
      * tests/Makefile.am (path_add): Drop now-useless directory.
      Suggested by Daniel P. Berrange.
      90c2a138
  30. 22 12月, 2010 1 次提交
    • M
      esx: Move VMX handling code out of the driver directory · 42b2f35d
      Matthias Bolte 提交于
      Now the VMware driver doesn't depend on the ESX driver anymore.
      
      Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE.
      Also add a libvirt_vmx.syms file.
      
      Move some escaping functions from esx_util.c to vmx.c.
      
      Adapt the test suite, ESX and VMware driver to the new code layout.
      42b2f35d
  31. 21 12月, 2010 1 次提交