1. 24 2月, 2011 3 次提交
  2. 23 2月, 2011 1 次提交
    • D
      Fix off-by-1 in virFileAbsPath. · 9f5bbe3b
      Daniel P. Berrange 提交于
      The virFileAbsPath was not taking into account the '/' directory
      separator when allocating memory for combining cwd + path. Convert
      to use virAsprintf to avoid this type of bug completely.
      
      * src/util/util.c: Convert virFileAbsPath to use virAsprintf
      9f5bbe3b
  3. 22 2月, 2011 3 次提交
    • R
      802.1Qbh: Delay IFF_UP'ing interface until migration final stage · dfd39ccd
      Roopa Prabhu 提交于
      Current code does an IFF_UP on a 8021Qbh interface immediately after a port
      profile set. This is ok in most cases except when its the migration prepare
      stage. During migration we want to postpone IFF_UP'ing the interface on the
      destination host until the source host has disassociated the interface.
      This patch moves IFF_UP of the interface to the final stage of migration.
      The motivation for this change is to postpone any addr registrations on the
      destination host until the source host has done the addr deregistrations.
      
      While at it, for symmetry with associate move ifDown of a 8021Qbh interface
      to before disassociate
      dfd39ccd
    • M
      Moved some SEXPR functions from xen-unified · c71328b9
      Markus Groß 提交于
      c71328b9
    • M
      Moved SEXPR unit to utils · 8606ca0d
      Markus Groß 提交于
      8606ca0d
  4. 21 2月, 2011 2 次提交
    • E
      maint: kill all remaining uses of old DEBUG macro · 994e7567
      Eric Blake 提交于
      Done mechanically with:
      $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
      
      followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
      with a single 'make syntax-check' fallout in the same file, and the
      actual deletion in src/util/logging.h.
      
      * src/util/logging.h (DEBUG, DEBUG0): Delete.
      * daemon/libvirtd.h (qemudDebug): Likewise.
      * global: Change remaining clients over to VIR_DEBUG counterpart.
      994e7567
    • E
      hash: make virHashFree more free-like · 03ba07cb
      Eric Blake 提交于
      Two-argument free functions are uncommon; match the style elsewhere
      by caching the callback at creation.
      
      * src/util/hash.h (virHashCreate, virHashFree): Move deallocator
      argument to creation.
      * cfg.mk (useless_free_options): Add virHashFree.
      * src/util/hash.c (_virHashTable): Track deallocator.
      (virHashCreate, virHashFree): Update to new signature.
      * src/conf/domain_conf.c (virDomainObjListDeinit)
      (virDomainObjListInit, virDomainDiskDefForeachPath)
      (virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
      Update callers.
      * src/conf/nwfilter_params.c (virNWFilterHashTableFree)
      (virNWFilterHashTableCreate): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
      Likewise.
      * src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
      Likewise.
      * src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
      (virNWFilterLearnShutdown): Likewise.
      * src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
      (qemuDomainPCIAddressSetFree): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      03ba07cb
  5. 19 2月, 2011 1 次提交
    • E
      build: fix broken mingw cross-compilation · 7b6286b7
      Eric Blake 提交于
      Two regressions:
      Commit df1011ca broke builds for systems that lack devmapper
      (non-Linux, as well as Linux with ./autogen.sh --without-libvirtd
      and without the libraries present).
      Commit ce6fd650 broke cross-compilation, due to a gnulib bug.
      
      * .gnulib: Update to latest, for cross-compilation fix.
      * src/util/util.c (virIsDevMapperDevice): Provide stub for
      platforms not using storage driver.
      * configure.ac (devmapper): Arrange to define HAVE_LIBDEVMAPPER_H.
      devmapper issue reported by Wen Congyang.
      7b6286b7
  6. 18 2月, 2011 5 次提交
    • C
      factor common code in virHashAddEntry and virHashUpdateEntry · 7f1c65e5
      Christophe Fergeau 提交于
      The only difference between these 2 functions is that one errors
      out when the entry is already present while the other modifies
      the existing entry. Add an helper function with a boolean argument
      indicating whether existing entries should be updated or not, and
      use this helper in both functions.
      7f1c65e5
    • C
      add hash table rebalancing in virHashUpdateEntry · 5c5880e0
      Christophe Fergeau 提交于
      The code in virHashUpdateEntry and virHashAddEntry is really
      similar. However, the latter rebalances the hash table when
      one of its buckets contains too many elements while the former
      does not. Fix this discrepancy.
      5c5880e0
    • E
      hash: modernize debug code · aebe04d7
      Eric Blake 提交于
      * src/util/hash.c (virHashGrow) [DEBUG_GROW]: Use modern logging.
      Reported by Christophe Fergeau.
      aebe04d7
    • E
      logging: make VIR_ERROR and friends preserve errno · bb904f45
      Eric Blake 提交于
      Followup to commit 17e19add, and would have prevented the bug
      independently fixed in commit 76c57a7c.
      
      * src/util/logging.c (virLogMessage): Preserve errno, since
      logging should be as unintrusive as possible.
      bb904f45
    • L
      Allow brAddTap to create a tap device that is down · 13ae7a02
      Laine Stump 提交于
      An upcoming patch has a use for a tap device to be created that
      doesn't need to be actually put into the "up" state, and keeping it
      "down" keeps the output of ifconfig from being unnecessarily cluttered
      (ifconfig won't show down interfaces unless you add "-a").
      
      bridge.[ch]: add "up" as an arg to brAddTap()
      uml_conf.c, qemu_command.c: add "up" (set to "true") to brAddTap() call.
      13ae7a02
  7. 17 2月, 2011 1 次提交
    • O
      storage: Allow to delete device mapper disk partition · df1011ca
      Osier Yang 提交于
      The name convention of device mapper disk is different, and 'parted'
      can't be used to delete a device mapper disk partition. e.g.
      
      Name                 Path
      -----------------------------------------
      3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
      
      Error: Expecting a partition number.
      
      This patch introduces 'dmsetup' to fix it.
      
      Changes:
        - New function "virIsDevMapperDevice" in "src/utils/utils.c"
        - remove "is_dm_device" in "src/storage/parthelper.c", use
          "virIsDevMapperDevice" instead.
        - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in"
        - Check "dmsetup" in 'configure.ac' for "with-storage-disk"
        - Changes on "src/Makefile.am" to link against libdevmapper
        - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms"
      
      Changes from v1 to v3:
        - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g
        - replace "virRun" with "virCommand"
        - sort the list of util functions in "libvirt_private.syms"
        - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration.
      
      e.g.
      
      Name                 Path
      -----------------------------------------
      3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
      
      Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted
      
      Name                 Path
      -----------------------------------------
      df1011ca
  8. 16 2月, 2011 2 次提交
    • E
      cgroup: preserve correct errno on failure · 76c57a7c
      Eric Blake 提交于
      * src/util/cgroup.c (virCgroupSetValueStr, virCgroupGetValueStr)
      (virCgroupRemoveRecursively): VIR_DEBUG can clobber errno.
      (virCgroupRemove): Use VIR_DEBUG rather than DEBUG.
      76c57a7c
    • E
      build: address clang reports about virCommand · 3db08aea
      Eric Blake 提交于
      clang had 5 reports against virCommand; three were false positives
      (a NULL deref in ProcessIO solved by sa_assert, and two uninitialized
      memory operations solved by adding an initializer), but two were real.
      
      * src/util/command.c (virCommandProcessIO): Fix real bug of
      possible NULL dereference.  Teach clang that buf is never NULL.
      (virCommandRun): Teach clang that infd is only ever accessed when
      initialized.
      3db08aea
  9. 15 2月, 2011 5 次提交
  10. 14 2月, 2011 1 次提交
  11. 12 2月, 2011 1 次提交
    • E
      build: fix cygwin strerror_r failure · 699a5888
      Eric Blake 提交于
      Building the 0.8.8 release candidate on cygwin produced this compiler
      warning, which is indicative of catastrophic failure on any attempt to
      print an error message with errno turned to a string:
      
        CC       strerror_r.lo
      strerror_r.c: In function 'rpl_strerror_r':
      strerror_r.c:67: warning: assignment makes integer from pointer without a cast
      
      This has been fixed in gnulib.
      
      * .gnulib: Update to latest, for strerror_r fix.
      * src/util/memory.c (includes): Satisfy 'make syntax-check'.
      699a5888
  12. 11 2月, 2011 1 次提交
    • D
      Imprint all logs with version + package build information · cee61fc2
      Daniel P. Berrange 提交于
      The logging functions are enhanced so that immediately prior to
      the first log message being printed to any output channel, the
      libvirt package version will be printed.
      
      eg
      
       $ LIBVIRT_DEBUG=1 virsh
       18:13:28.013: 17536: info : libvirt version: 0.8.7
       18:13:28.013: 17536: debug : virInitialize:361 : register drivers
       ...
      
      The 'configure' script gains two new arguments which can be
      used as
      
         --with-packager="Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10"
         --with-packager-version="1.fc14"
      
      to allow distros to append a custom string with package specific
      data.
      
      The RPM specfile is modified so that it appends the RPM version,
      the build host, the build date and the packager name.
      
      eg
      
       $ LIBVIRT_DEBUG=1 virsh
       18:14:52.086: 17551: info : libvirt version: 0.8.7, package: 1.fc13 (Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10)
       18:14:52.086: 17551: debug : virInitialize:361 : register drivers
      
      Thus when distro packagers receive bug reports they can clearly
      see what version was in use, even if the bug reporter mistakenly
      or intentionally lies about version/builds
      
      * src/util/logging.c: Output version data prior to first log message
      * libvirt.spec.in: Include RPM release, date, hostname & packager
      * configure.ac: Add --with-packager & --with-packager-version args
      cee61fc2
  13. 10 2月, 2011 2 次提交
  14. 09 2月, 2011 3 次提交
  15. 04 2月, 2011 1 次提交
    • S
      macvtap: fix 2 nla_put expressions (non-serious bug) · be23e2bd
      Stefan Berger 提交于
      This patch fixes 2 occurrences of nla_put expression with a '!' in
      front of them that basically prevented the detection that the buffer
      is too small. However, code further below would then detect that the
      buffer is too small when further parts are added to the netlink message.
      be23e2bd
  16. 03 2月, 2011 1 次提交
    • D
      Fix conflicts with glibc globals · de53effe
      Davidlohr Bueso 提交于
      When compiling libvirt with GCC 3.4.6 the following warning is being triggered quite a lot:
      
      util/memory.h:60: warning: declaration of 'remove' shadows a global declaration
      /usr/include/stdio.h:175: warning: shadowed declaration is here
      
      Fix this by renaming the parameter to 'toremove'.
      de53effe
  17. 02 2月, 2011 1 次提交
  18. 30 1月, 2011 2 次提交
    • E
      maint: reject raw close, popen in 'make syntax-check' · 030ce43b
      Eric Blake 提交于
      commit f1fe9671 was supposed to make sure we use files.h
      macros to avoid double close, but it didn't work.
      
      Meanwhile, virCommand is vastly superior to system(), fork(),
      and popen() (also to virExec, but we haven't completed that
      conversion), so enforce that, too.
      
      * cfg.mk (sc_prohibit_close): Fix typo that excluded close, and
      add pclose.
      (sc_prohibit_fork_wrappers): New rule, for fork, system, and popen.
      * .x-sc_prohibit_close: More exemptions.
      * .x-sc_prohibit_fork_wrappers: New file.
      * Makefile.am (syntax_check_exceptions): Ship new file.
      * src/datatypes.c (virReleaseConnect): Tweak comment to avoid
      false positive.
      * src/util/files.h (VIR_CLOSE): Likewise.
      030ce43b
    • E
      build: avoid close, system · e67ae619
      Eric Blake 提交于
      * src/fdstream.c (virFDStreamOpenFile, virFDStreamCreateFile):
      Use VIR_FORCE_CLOSE instead of close.
      * tests/commandtest.c (mymain): Likewise.
      * tools/virsh.c (editFile): Use virCommand instead of system.
      * src/util/util.c (__virExec): Special case preservation of std
      file descriptors to child.
      e67ae619
  19. 29 1月, 2011 1 次提交
  20. 26 1月, 2011 3 次提交
    • D
      Filter out certain expected error messages from libvirtd · b8786c06
      Daniel P. Berrange 提交于
      Add a hook to the error reporting APIs to allow specific
      error messages to be filtered out. Wire up libvirtd to
      remove VIR_ERR_NO_DOMAIN & similar error codes from the
      logs. They are still logged at DEBUG level.
      
      * daemon/libvirtd.c: Filter VIR_ERR_NO_DOMAIN and friends
      * src/libvirt_private.syms, src/util/virterror.c,
        src/util/virterror_internal.h: Hook for changing error
        reporting level
      b8786c06
    • D
      Revert all previous error log priority hacks · dbfca3ff
      Daniel P. Berrange 提交于
      This reverts the additions in commit
      
        abff683f
      
      taking us back to state where all errors are fully logged
      in both libvirtd and normal clients.
      
      THe intent was to stop VIR_ERR_NO_DOMAIN (No such domain
      with UUID XXXX) messages from client apps polluting syslog
      The change affected all error codes, but more seriously,
      it also impacted errors from internal libvirtd infrastructure
      For example guest autostart no longer logged errors. The
      libvirtd network code no longer logged some errors. This
      makes debugging incredibly hard
      
      * daemon/libvirtd.c: Remove error log priority filter
      * src/util/virterror.c, src/util/virterror_internal.h: Remove
        callback for overriding log priority
      dbfca3ff
    • D
      Cleanup code style in logging APIs · 2b7ac883
      Daniel P. Berrange 提交于
      Remove use of brackets around following return statement.
      Fix indentation of two switch statements
      2b7ac883