1. 06 5月, 2011 1 次提交
  2. 05 5月, 2011 11 次提交
    • D
      Fix qemuMigrationToFile nonull annotation · f7fc885d
      Daniel P. Berrange 提交于
      The qemuMigrationToFile method was accidentally annotated for
      the 'compressor' parameter to be non-null, instead of the
      'path' parameter. Thus GCC with -O2, unhelpfully deleted the
      entire 'if (compressor == NULL)' block of code during
      optimization. Thus NULL was passed to virCommandNew() with
      predictably bad results.
      
      * src/qemu/qemu_migration.h: Fix non-null annotation to be
        against path instead of compressor
      f7fc885d
    • D
      Make QEMU migration use cached qemu capabilities data · 7c31e1ef
      Daniel P. Berrange 提交于
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Remove
        qemuCaps parameters & use cached data
      * src/qemu/qemu_driver.c: Don't create & pass qemuCaps to
        migration methods
      7c31e1ef
    • D
      Make QEMU hotplug use cached qemu capabilities data · a623bff4
      Daniel P. Berrange 提交于
      * src/qemu/qemu_hotplug.h, src/qemu/qemu_hotplug.c: Remove
        qemuCaps parameters from all methods
      * src/qemu/qemu_driver.c: Don't create & pass qemuCaps to
        hotplug methods
      a623bff4
    • D
      Persist qemu capabilities in the domain status file · 43c01d38
      Daniel P. Berrange 提交于
      To cope with the QEMU binary being changed while a VM is running,
      it is neccessary to persist the original qemu capabilities at the
      time the VM is booted.
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: Add
        an enum for a string rep of every capability
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Support for
        storing capabilities in the domain status XML
      * src/qemu/qemu_process.c: Populate & free QEMU capabilities at
        domain startup
      43c01d38
    • D
      Release of libvirt-0.9.1 · 9b889aac
      Daniel Veillard 提交于
      * configure.ac libvirt.spec.in docs/news.html.in: update and document
        the release
      * po/*.po*: update localizations for german, polish, spanish, ukrainian
        and vietnamese coming from transifex, regenerate
      9b889aac
    • E
      maint: detect clang 2.9 · 2ffa8b34
      Eric Blake 提交于
      In Fedora 15, with clang 2.8, 'scan-build env' shows:
      CCC_ANALYZER_ANALYSIS=-analyzer-check-objc-mem -analyzer-check-security-syntactic -analyzer-check-dead-stores -analyzer-check-objc-unused-ivars -analyzer-check-objc-methodsigs
      
      But in rawhide, with clang 2.9, the same variable is set but
      empty, implying the default set of analysis.  We still want
      sa_assert defined in that case, to stop clang from hitting
      false positives.
      
      * configure.ac (STATIC_ANALYSIS): Detect clang even when the set
      of analyses is the default.
      2ffa8b34
    • E
      storage: avoid null deref and leak on failure · 4644f0b2
      Eric Blake 提交于
      Detected by clang.  NULL deref added in commit 343a27af (Mar 11),
      but leak of voldef present since commit 2cd9b2d8 (Apr 09).
      
      * src/storage/storage_driver.c (storageVolumeCreateXML): Don't
      leak voldef or dereference null volobj.
      4644f0b2
    • M
      esx: Disable performance counter queries in esxDomainGetInfo · 6eb3a1f4
      Matthias Bolte 提交于
      The queried values aren't used yet.
      6eb3a1f4
    • M
      esx: Avoid null dereference on error in esxDomainGetInfo · 62a6b7cc
      Matthias Bolte 提交于
      Add missing early exits and convert error logging to proper API level
      error reporting.
      
      Centralize cleanup code for the PerfQuerySpec object.
      
      Reported by Eric Blake, detected by clang.
      62a6b7cc
    • E
      remote: avoid null dereference on error · 85cb2926
      Eric Blake 提交于
      Clang found three instances of uninitialized use of nparams in
      the cleanup path.  Unfortunately, one is a false positive: clang
      couldn't see that ret->params.params_val is guaranteed to be
      NULL unless allocated within a function, and that nparams is
      guaranteed to be assigned prior to the allocation; hoisting the
      assignment to nparams to be earlier in the function shuts up
      that false positive.  But two of the reports also happened to
      highlight a real bug - the error path can dereference NULL.
      
      Regression introduced in commit 158ba873.
      
      * daemon/remote.c (remoteDispatchDomainGetMemoryParameters)
      (remoteDispatchDomainGetBlkioParameters): Don't clear fields if
      array was not allocated.
      (remoteDispatchDomainGetSchedulerParameters): Initialize nparams
      earlier.
      85cb2926
    • M
      esx: Remove dead store in esxUtil_ParseDatastorePath · d0a8f99c
      Matthias Bolte 提交于
      The ++ on preliminaryFileName was a left over from a previous version
      of this function that explicitly returned the filename and did a strdup
      on preliminaryFileName afterwards.
      
      As the filename isn't returned explicitly anymore remove the preliminary
      variable for it and reuse the tmp variable instead.
      
      Reported by Eric Blake, detected by clang.
      d0a8f99c
  3. 04 5月, 2011 13 次提交
    • E
      qemu: update qemuCgroupControllerActive signature · 29e131de
      Eric Blake 提交于
      Clang warned about a dead assignment.  In the process, I noticed
      that we are only using the function for a bool value.  I audited
      all other callers in qemu_{migration,cgroup,driver,hotplug), and
      all were making the call in a bool context.
      
      Also, do bounds checking on the argument.
      
      * src/qemu/qemu_cgroup.c (qemuSetupCgroup): Delete dead
      assignment.
      (qemuCgroupControllerActive): Change return type to bool.
      * src/qemu/qemu_cgroup.h (qemuCgroupControllerActive): Likewise.
      29e131de
    • 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
    • E
      lxc: report correct error · 32388f12
      Eric Blake 提交于
      Clang noticed a dead assignment, which turned out to be the use
      of the wrong variable.  rc starts life as -1, and is only ever
      assigned to 0 just before a successful cleanup.
      
      * src/lxc/lxc_driver.c (lxcSetupInterfaces): Don't call
      virReportSystemError(-1).
      32388f12
    • E
      libxl: avoid compiler warning · 710f8811
      Eric Blake 提交于
      Detected by gcc:
      
      libxl/libxl_driver.c: In function 'libxlDomainDestroy':
      libxl/libxl_drier.c:1351:30: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]
      
      * src/libxl/libxl_driver.c (libxlDomainDestroy): Delete unused
      variable.
      710f8811
    • E
      qemu: remove dead assignment · 5f929dd3
      Eric Blake 提交于
      Detected by clang.
      
      * src/qemu/qemu_migration.c (qemuMigrationToFile): Nothing later
      uses is_reg.
      5f929dd3
    • E
      storage: use virCommand to avoid compiler warning · f72393fa
      Eric Blake 提交于
      clang didn't like the last increment to nargs.  But why even
      track nargs ourselves, when virCommand does it for us?
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIConnection): Switch to virCommand to avoid
      a dead-store warning on nargs.
      f72393fa
    • E
      cgroup: avoid leaking a file · ead2b433
      Eric Blake 提交于
      Clang detected a dead store to rc.  It turns out that in fixing this,
      I also found a FILE* leak.
      
      This is a subtle change in behavior, although unlikely to hit.  The
      pidfile is a kernel file, so we've probably got more serious problems
      under foot if we fail to parse one.  However, the previous behavior
      was that even if one pid file failed to parse, we tried others,
      whereas now we give up on the first failure.  Either way, though,
      the function returns -1, so the caller will know that something is
      going wrong, and that not all pids were necessarily reaped.  Besides,
      there were other instances already in the code where failure in the
      inner loop aborted the outer loop.
      
      * src/util/cgroup.c (virCgroupKillInternal): Abort rather than
      resuming loop on fscanf failure, and cleanup file on error.
      ead2b433
    • E
      qemu: silence clang false positives · d8f75281
      Eric Blake 提交于
      Clang 2.8 wasn't quite able to follow that persistentDef was
      assigned earlier if (flags & VIR_DOMAIN_MEM_CONFIG) is true.
      Silence this false positive, to make clang analysis easier to use.
      
      * src/qemu/qemu_driver.c (qemudDomainSetMemoryFlags): Add an
      annotation to silence clang's claim of a NULL dereference.
      d8f75281
    • E
      virsh: avoid null pointer dereference · 44699b32
      Eric Blake 提交于
      Clang detected that vol-download will call unlink(NULL) if there
      is a parse error during option parsing.  Also, mingw doesn't like
      unlinking an open file.
      
      * tools/virsh.c (cmdVolDownload): Only unlink file if created.
      44699b32
    • E
      pci: fix null pointer dereference · 1164e1a2
      Eric Blake 提交于
      Clang detected a null-pointer dereference regression, introduced
      in commit 4e8969eb.  Without this patch, a device with
      unbind_from_stub set to false would eventually try to call
      virFileExists on uncomputed drvdir.
      
      * src/util/pci.c (pciUnbindDeviceFromStub): Ensure drvdir is set
      before use.
      1164e1a2
    • E
      qemu: avoid null pointer dereference · 4d080ee4
      Eric Blake 提交于
      This code has had problems historically.  As originally
      written, in commit 6bcf2501 (Jun 08), it could call unlink
      on a random string, nuking an unrelated file.
      
      Then commit 182a80b9 (Sep 09), the code was rewritten to
      allocate tmp, with both a use-after-free bug and a chance to
      call unlink(NULL).
      
      Commit e206946d (Mar 11) fixed the use-after-free, but not the
      NULL dereference.  Thanks to clang for catching this!
      
      * src/qemu/qemu_driver.c (qemudDomainMemoryPeek): Don't call
      unlink on NULL.
      4d080ee4
    • E
      tests: avoid null pointer dereference · 4b4e8b57
      Eric Blake 提交于
      Unlikely to hit in real life, but clang noticed it.
      
      * tests/commandtest.c (checkoutput, test4, test18): Avoid
      unlink(NULL) on OOM.
      4b4e8b57
    • E
      Revert "lxc: Do not try to reconnect inactive domain when do lxcStartup" · 6e177fa1
      Eric Blake 提交于
      This reverts commit 0e7f7f85.
      
      From the mailing list:
      
      > So, AFAICT, this patch means we will never reconnect to any LXC
      > VMs now.
      >
      > The correct solution, is to refactor LXC driver startup to work
      > the same way as the QEMU driver startup.
      >
      >   - Load all the live state XML files (to pick up running VMs)
      >   - Reconnect to all VMs
      >   - Load all the persistent config XML files (to pick up any additional
      >     inactive guets)
      
      But that solution is invasive enough to be post-0.9.1.
      6e177fa1
  4. 03 5月, 2011 4 次提交
  5. 02 5月, 2011 2 次提交
    • C
      qemu: fix uninitialized variable warning · b15a8a1b
      Christophe Fergeau 提交于
      This commit fixes
      qemu/qemu_driver.c: In function 'qemuDomainModifyDeviceFlags':
      qemu/qemu_driver.c:4041:8: warning: 'ret' may be used uninitialized in this
      function [-Wuninitialized]
      qemu/qemu_driver.c:4013:9: note: 'ret' was declared here
      
      The variable is set to -1 so that the error paths are taken when the code
      to set it didn't get a chance to run. Without initializing it, we could
      return some an undefined value from this function.
      
      While I was at it, I made a trivial whitespace change in the same function
      to improve readability.
      b15a8a1b
    • G
      fix missing VLAN id for Qbg example · 170f2a87
      Gerhard Stenzel 提交于
      For IEEE 802.1Qbg, it is necessary to use a VLAN interface.
      vepa itself does not require a VLAN interface.
      
      Signed-off-by: Gerhard Stenzel <stenzel at de.ibm.com>
      170f2a87
  6. 01 5月, 2011 3 次提交
  7. 30 4月, 2011 6 次提交
    • M
      nwfilter: Fix memory leak in the ebtables subdriver · 0e7c7b8b
      Matthias Bolte 提交于
      Call shutdown functions for all subcomponents in nwfilterDriverShutdown.
      
      Make sure that this shutdown functions can safely be called multiple times
      and independent from the actual subcomponents state.
      0e7c7b8b
    • M
      feecc9f3
    • M
      Fix memory leak in __virExec · 9d50b323
      Matthias Bolte 提交于
      Commit e0d014f2 made binary potentially allocated on the heap.
      It was freed in the parent in the error path, but not in the success path
      that doesn't goto the cleanup label.
      
      Found by 'make -C tests valgrind'.
      9d50b323
    • 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
    • C
      docs: Document <filesystem> device · 41a7835f
      Cole Robinson 提交于
      Tried to dredge through old changelogs and commits to come up with it, so
      may not be completely accurate.
      
      v2:
      Drop ambiguous 'containers'
      Use same mail archive for all links
      41a7835f
    • 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