1. 07 6月, 2011 2 次提交
  2. 03 6月, 2011 3 次提交
    • E
      build: silence coverity false positive · 89e651fa
      Eric Blake 提交于
      Coverity complained that infd could be -1 at the point where it is
      passed to write, when in reality, this code can only be reached if
      infd is non-negative.
      
      * src/util/command.c (virCommandProcessIO): Help out coverity.
      89e651fa
    • E
      storage: avoid memory leak on stat failure · f515bab7
      Eric Blake 提交于
      Spotted by coverity.  Triggers on failed stat, although I'm not sure
      how easy that condition is, so I'm not sure if this is a runtime
      memory hog.  Regression introduced in commit 8077d64f (unreleased).
      
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD):
      Reduce need for malloc, avoiding a leak.
      f515bab7
    • E
      command: avoid leak on failure · bb889529
      Eric Blake 提交于
      Detected by Coverity.  While it is possible on OOM condition, as
      well as with bad code that passes binary == NULL, it is unlikely
      to be encountered in the wild.
      
      * src/util/command.c (virCommandNewArgList): Don't leak memory.
      bb889529
  3. 02 6月, 2011 2 次提交
    • D
      Basic framework for lock manager plugins · 6a943419
      Daniel P. Berrange 提交于
      Define the basic framework lock manager plugins. The
      basic plugin API for 3rd parties to implemented is
      defined in
      
        src/locking/lock_driver.h
      
      This allows dlopen()able modules for alternative locking
      schemes, however, we do not install the header. This
      requires lock plugins to be in-tree allowing changing of
      the lock manager plugin API in future.
      
      The libvirt code for loading & calling into plugins
      is in
      
        src/locking/lock_manager.{c,h}
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add
        VIR_FROM_LOCKING
      * src/locking/lock_driver.h: API for lock driver plugins
        to implement
      * src/locking/lock_manager.c, src/locking/lock_manager.h:
        Internal API for managing locking
      * src/Makefile.am: Add locking code
      6a943419
    • D
      Allow handshake with child process during startup · 285c2fdf
      Daniel P. Berrange 提交于
      Allow the parent process to perform a bi-directional handshake
      with the child process during fork/exec. The child process
      will fork and do its initial setup. Immediately prior to the
      exec(), it will stop & wait for a handshake from the parent
      process. The parent process will spawn the child and wait
      until the child reaches the handshake point. It will do
      whatever extra setup work is required, before signalling the
      child to continue.
      
      The implementation of this is done using two pairs of blocking
      pipes. The first pair is used to block the parent, until the
      child writes a single byte. Then the second pair pair is used
      to block the child, until the parent confirms with another
      single byte.
      
      * src/util/command.c, src/util/command.h,
        src/libvirt_private.syms: Add APIs to perform a handshake
      285c2fdf
  4. 01 6月, 2011 2 次提交
    • O
      util: Fix incorrect error in PCI functions · a74575e3
      Osier Yang 提交于
      Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_INTERNAL_ERROR. Error
      like following is not what user want to see.
      
      error : pciDeviceIsAssignable:1487 : this function is not supported
      by the connection driver: Device 0000:07:10.0 is behind a switch
      lacking ACS and cannot be assigned
      a74575e3
    • C
      storage: List directory volumes for dir/fs/netfs pools · 8077d64f
      Cole Robinson 提交于
      Since directories can be used for <filesystem> passthrough, they are
      basically storage volumes.
      
      v2:
          Skip ., .., lost+found dirs
      
      v3:
          Use gnulib last_component
      
      v4:
          Use gnulib "dirname.h", not system <dirname.h>
          Don't skip lost+found
      8077d64f
  5. 31 5月, 2011 2 次提交
    • D
      Fix sysinfo/virsh build problems on Win32 · ef983dfe
      Daniel P. Berrange 提交于
      The virSysinfoIsEqual method was mistakenly inside a #ifndef WIN32
      conditional.
      
      The existing virSysinfoFormat is also stubbed out on Win32, even
      though the code works without any trouble. This breaks XML output
      on Win32, so the stub is removed.
      
      virsh migrate mistakenly had some variables inside the conditional
      
      * src/util/sysinfo.c: Build virSysinfoIsEqual on Win32 and remove
        Win32 stub for virSysinfoFormat
      * tools/virsh.c: Fix variable declaration on Win32
      ef983dfe
    • D
      Add an API for comparing the ABI of two guest configurations · 08106e20
      Daniel P. Berrange 提交于
      To allow a client app to pass in custom XML during migration
      of a guest it is neccessary to ensure the guest ABI remains
      unchanged. The virDomainDefCheckABIStablity method accepts
      two virDomainDefPtr structs and compares everything in them
      that could impact the guest machine ABI
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDefCheckABIStablity
      * src/conf/cpu_conf.c, src/conf/cpu_conf.h: Add virCPUDefIsEqual
      * src/util/sysinfo.c, src/util/sysinfo.h: Add virSysinfoIsEqual
      08106e20
  6. 29 5月, 2011 1 次提交
    • R
      Fix virExecWithHook Prototype · 4996c314
      Richard Laager 提交于
      This was necessary to get libvirt to build on Solaris 11 Express and
      seems correct (as it makes this match the definition in util.c):
      4996c314
  7. 27 5月, 2011 2 次提交
  8. 25 5月, 2011 1 次提交
    • E
      build: fix VIR_DEBUG on mingw · 4486f3a2
      Eric Blake 提交于
      We don't use the gnulib vsnprintf replacement, which means that
      on mingw, vsnprintf doesn't support %zn or %lln.
      
      And as it turns out, VIR_GET_VAR_STR was a rather inefficient
      reimplementation of virVasprintf logic.
      
      * src/util/logging.c (VIR_GET_VAR_STR): Drop.
      (virLogMessage): Inline a simpler version here.
      * src/util/virterror.c (VIR_GET_VAR_STR, virRaiseErrorFull):
      Likewise.
      Reported by Matthias Bolte.
      4486f3a2
  9. 24 5月, 2011 2 次提交
  10. 18 5月, 2011 2 次提交
    • C
      Fix messages using VIR_ERR_XML_ERROR · ed97be61
      Cole Robinson 提交于
      This error code has existed since the dawn of time, yet the messages it
      generates are almost universally busted. Here's a small sampling:
      
      src/conf/domain_conf.c:4889 : XML description for missing root element is not well formed or invalid
      src/conf/domain_conf.c:4951 : XML description for unknown device type is not well formed or invalid
      src/conf/domain_conf.c:5460 : XML description for maximum vcpus must be an integer is not well formed or invalid
      src/conf/domain_conf.c:5468 : XML description for invalid maxvcpus %(count)lu is not well formed or invalid
      
      Fix up the error code to instead be
      
      XML error: <msg>
      
      Adjust the few locations that were using the original correctly (or shouldn't
      have been using the error code at all).
      
      v2:
          Fix wording of error code without a passed argument
      ed97be61
    • D
      Add support for 'passthru' mode for direct network interfaces · 5252a06d
      Dirk Herrendorefer 提交于
      starting with kernel 2.6.38 macvtap supports a 'passthru' mode for
      attaching virtual functions of a SRIOV capable network card directly to a VM.
      This patch adds the capability to configure such a device.
      Signed-off-by: NDirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
      5252a06d
  11. 17 5月, 2011 3 次提交
  12. 16 5月, 2011 1 次提交
    • D
      Disable virCommandExec on Win32 · 91e5c3dc
      Daniel P. Berrange 提交于
      Mingw execve() has a broken signature. Disable this
      function until gnulib fixes the signature, since we
      don't really need this on Win32 anyway.
      
      * src/util/command.c: Disable virCommandExec on Win32
      91e5c3dc
  13. 14 5月, 2011 3 次提交
  14. 13 5月, 2011 2 次提交
    • C
      xml: Make sure virXpathNodeSet always sets an error · 0571c3af
      Cole Robinson 提交于
      And update callers to actually respect the error
      0571c3af
    • M
      virFDStream: Add option for delete file after it's opening · 6a1f5f56
      Michal Privoznik 提交于
      This is needed if we want to transfer a temporary file. If the
      transfer is done with iohelper, we might run into a race condition,
      where we unlink() file before iohelper is executed.
      
      * src/fdstream.c, src/fdstream.h,
        src/util/iohelper.c: Add new option
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
        src/storage/storage_driver.c, src/uml/uml_driver.c,
        src/xen/xen_driver.c: Expand existing function calls
      6a1f5f56
  15. 12 5月, 2011 3 次提交
    • E
      maint: omit translation for all VIR_INFO · cb84580a
      Eric Blake 提交于
      We were 31/73 on whether to translate; since less than 50% translated
      and since VIR_INFO is less than VIR_WARN which also doesn't translate,
      this makes sense.
      
      * cfg.mk (sc_prohibit_gettext_markup): Add VIR_INFO, since it
      falls between WARN and DEBUG.
      * daemon/libvirtd.c (qemudDispatchSignalEvent, remoteCheckAccess)
      (qemudDispatchServer): Adjust offenders.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/network/bridge_driver.c (networkReloadIptablesRules)
      (networkStartNetworkDaemon, networkShutdownNetworkDaemon)
      (networkCreate, networkDefine, networkUndefine): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainDefine)
      (qemudDomainUndefine): Likewise.
      * src/storage/storage_driver.c (storagePoolCreate)
      (storagePoolDefine, storagePoolUndefine, storagePoolStart)
      (storagePoolDestroy, storagePoolDelete, storageVolumeCreateXML)
      (storageVolumeCreateXMLFrom, storageVolumeDelete): Likewise.
      * src/util/bridge.c (brProbeVnetHdr): Likewise.
      * po/POTFILES.in: Drop src/util/bridge.c.
      cb84580a
    • E
      build: avoid gcc preprocessor extensions · bc6bfeaa
      Eric Blake 提交于
      Use of ',##__VA_ARGS__' is a gcc extension not guaranteed by
      C99; thankfully, we can avoid it by lumping the format argument
      into the var-args set.
      
      * src/util/logging.h (VIR_DEBUG_INT, VIR_INFO_INT, VIR_WARN_INT)
      (VIR_ERROR_INT, VIR_DEBUG, VIR_INFO, VIR_WARN, VIR_ERROR): Stick
      to C99 var-arg macro syntax.
      * examples/domain-events/events-c/event-test.c (VIR_DEBUG):
      Simplify.
      bc6bfeaa
    • L
      libvirt,logging: cleanup VIR_XXX0() · b65f37a4
      Lai Jiangshan 提交于
      These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.
      
      How do these coversions works? The magic is using the gcc extension of ##.
      When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
      avoid compile error.
      
      example: origin				after CPP
      	high_level_api("%d", a_int)	low_level_api("%d", a_int)
      	high_level_api("a  string")	low_level_api("a  string")
      
      About 400 conversions.
      
      8 special conversions:
      VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
      VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
      VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
        (for security) 6 conversions
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      b65f37a4
  16. 11 5月, 2011 3 次提交
    • D
      Add support for YAJL version 2 API/ABI · 9f5d3a91
      Daniel P. Berrange 提交于
      Version 2.0.0 or yajl changed API. It is fairly trivial for us to
      cope with both APIs in libvirt, so adapt.
      
      * configure.ac: Probe for yajl2 API
      * src/util/json.c: Conditional support for yajl2 API
      9f5d3a91
    • C
      command: Add virCommandExec helper · f095398a
      Cole Robinson 提交于
      Actually execs the argv/env we've generated, replacing the current process.
      Kind of has a limited usage, but allows us to use virCommand in LXC
      driver to launch the 'init' process
      f095398a
    • C
      command: Add virCommandEnvAddFormat · 35c1b35e
      Cole Robinson 提交于
      Similar to virCommandArgAddFormat. We will use this shortly.
      
      v2:
          Convert virCommandEnvAddPair to use the new function
      35c1b35e
  17. 10 5月, 2011 1 次提交
  18. 09 5月, 2011 1 次提交
  19. 06 5月, 2011 3 次提交
    • M
      Add warning message to XML definition files stored on disk · 5d09c314
      Michal Privoznik 提交于
      Users often edit XML file stored in configuration directory
      thinking of modifying a domain/network/pool/etc. Thus it is wise
      to let them know they are using the wrong way and give them hint.
      5d09c314
    • E
      buf: add virBufferVasprintf · f09acccf
      Eric Blake 提交于
      Match the fact that we have virAsprintf and virVasprintf.
      
      * src/util/buf.h (virBufferVasprintf): New prototype.
      * src/util/buf.c (virBufferAsprintf): Move guts...
      (virBufferVasprintf): ...to new function.
      * src/libvirt_private.syms (buf.h): Export it.
      * bootstrap.conf (gnulib_modules): Add stdarg, for va_copy.
      f09acccf
    • 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
  20. 04 5月, 2011 1 次提交
    • E
      util: remove dead assignment · 44aa49ae
      Eric Blake 提交于
      Clang complained about this, and it was easy enough to fix.
      
      * src/util/util.c (virFileOpenAs): Drop dead assignment.
      44aa49ae