1. 12 3月, 2014 1 次提交
    • J
      storage: Fix bugs in VIR_APPEND_ELEMENT series · ea10cd76
      John Ferlan 提交于
      From commit id 'd53bbfd1'
      
      Found one core and one possible memory leak. Core seen during local
      virt-test/tp_libvirt run for the vol_create_from test. The memory leak
      was seen by inspection during a review of all VIR_APPEND_ELEMENT changes
      
      In storage_backend_disk/virStorageBackendDiskMakeDataVol(), the 'vol'
      needs to be kept around since it's used later, so use the _COPY macro.
      This caused a segv in libvirtd:
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fffe87c3700 (LWP 6919)]
      virStorageBackendDiskMakeDataVol (vol=0x0, groups=0x7fffc8000d70, pool=0x7fffc8002460) at storage/storage_backend_disk.c:66
      66          if (vol->target.path == NULL) {
      
      In storage_backend_rbd/virStorageBackendRBDRefreshPool() there's a failure
      path where the 'vol' needs to go through virStorageVolDefFree() since it
      wouldn't be appended.
      ea10cd76
  2. 10 3月, 2014 2 次提交
  3. 05 3月, 2014 4 次提交
  4. 04 3月, 2014 1 次提交
    • E
      util: make it easier to grab only regular command exit · b9dd878f
      Eric Blake 提交于
      Auditing all callers of virCommandRun and virCommandWait that
      passed a non-NULL pointer for exit status turned up some
      interesting observations.  Many callers were merely passing
      a pointer to avoid the overall command dying, but without
      caring what the exit status was - but these callers would
      be better off treating a child death by signal as an abnormal
      exit.  Other callers were actually acting on the status, but
      not all of them remembered to filter by WIFEXITED and convert
      with WEXITSTATUS; depending on the platform, this can result
      in a status being reported as 256 times too big.  And among
      those that correctly parse the output, it gets rather verbose.
      Finally, there were the callers that explicitly checked that
      the status was 0, and gave their own message, but with fewer
      details than what virCommand gives for free.
      
      So the best idea is to move the complexity out of callers and
      into virCommand - by default, we return the actual exit status
      already cleaned through WEXITSTATUS and treat signals as a
      failed command; but the few callers that care can ask for raw
      status and act on it themselves.
      
      * src/util/vircommand.h (virCommandRawStatus): New prototype.
      * src/libvirt_private.syms (util/command.h): Export it.
      * docs/internals/command.html.in: Document it.
      * src/util/vircommand.c (virCommandRawStatus): New function.
      (virCommandWait): Adjust semantics.
      * tests/commandtest.c (test1): Test it.
      * daemon/remote.c (remoteDispatchAuthPolkit): Adjust callers.
      * src/access/viraccessdriverpolkit.c (virAccessDriverPolkitCheck):
      Likewise.
      * src/fdstream.c (virFDStreamCloseInt): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessStart): Likewise.
      * src/qemu/qemu_command.c (qemuCreateInBridgePortWithHelper):
      Likewise.
      * src/xen/xen_driver.c (xenUnifiedXendProbe): Simplify.
      * tests/reconnect.c (mymain): Likewise.
      * tests/statstest.c (mymain): Likewise.
      * src/bhyve/bhyve_process.c (virBhyveProcessStart)
      (virBhyveProcessStop): Don't overwrite virCommand error.
      * src/libvirt.c (virConnectAuthGainPolkit): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainGetBarrierLimit)
      (openvzDomainSetBarrierLimit): Likewise.
      * src/util/virebtables.c (virEbTablesOnceInit): Likewise.
      * src/util/viriptables.c (virIpTablesOnceInit): Likewise.
      * src/util/virnetdevveth.c (virNetDevVethCreate): Fix debug
      message.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Add comment.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSINodeUpdate): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b9dd878f
  5. 25 2月, 2014 2 次提交
  6. 21 2月, 2014 1 次提交
  7. 15 2月, 2014 1 次提交
  8. 14 2月, 2014 5 次提交
  9. 12 2月, 2014 4 次提交
  10. 11 2月, 2014 3 次提交
  11. 23 1月, 2014 3 次提交
    • O
      storage: Fix the memory leak · 88ae5dc7
      Osier Yang 提交于
      The return value of virGetFCHostNameByWWN is a strdup'ed string.
      Also add comments to declare that the caller should take care of
      freeing it.
      88ae5dc7
    • O
      storage: Fix autostart of pool with "fc_host" type adapter · 2340f019
      Osier Yang 提交于
      The "checkPool" is a bit different for pool with "fc_host"
      type source adapter, since the vHBA it's based on might be
      not created yet (it's created by "startPool", which is
      involked after "checkPool" in storageDriverAutostart). So it
      should not fail, otherwise the "autostart" of the pool will
      fail either.
      
      The problem is easy to reproduce:
          * Enable "autostart" for the pool
          * Restart libvirtd service
          * Check the pool's state
      2340f019
    • O
      storage: Add document for possible problem on volume detection · 6b29eb84
      Osier Yang 提交于
      For pool which relies on remote resources, such as a "iscsi" type
      pool, since how long it takes to export the corresponding devices
      to host's sysfs is really depended, it could depend on the network
      connection, it also could depend on the host's udev procedures. So
      it's likely that the volumes are not able to be detected during pool
      starting process, polling the sysfs doesn't work, since we don't
      know how much time is best for the polling, and even worse, the
      volumes could still be not detected or partly not detected even after
      the polling.  So we end up with a documentation to prompt the fact,
      in virsh manual.
      
      And as a small improvement, let's explicitly say no LUNs found in
      the debug log in that case.
      6b29eb84
  12. 17 1月, 2014 1 次提交
    • E
      maint: avoid nested use of virConnect{Ref,Close} · 25221a1b
      Eric Blake 提交于
      The public virConnectRef and virConnectClose API are just thin
      wrappers around virObjectRef/virObjectRef, with added object
      validation and an error reset.  Within our backend drivers, use
      of the object validation is just an inefficiency since we always
      pass valid objects.  More important to think about is what
      happens with the error reset; our uses of virConnectRef happened
      to be safe (since we hadn't encountered any earlier errors), but
      in several cases the use of virConnectClose could lose a real
      error.
      
      Ideally, we should also avoid calling virConnectOpen() from
      within backend drivers - but that is a known situation that
      needs much more design work.
      
      * src/qemu/qemu_process.c (qemuProcessReconnectHelper)
      (qemuProcessReconnect): Avoid nested public API call.
      * src/qemu/qemu_driver.c (qemuAutostartDomains)
      (qemuStateInitialize, qemuStateStop): Likewise.
      * src/qemu/qemu_migration.c (doPeer2PeerMigrate): Likewise.
      * src/storage/storage_driver.c (storageDriverAutostart):
      Likewise.
      * src/uml/uml_driver.c (umlAutostartConfigs): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessAutostartAll): Likewise.
      (virLXCProcessReboot): Likewise, and avoid leaking conn on error.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25221a1b
  13. 16 1月, 2014 6 次提交
  14. 14 1月, 2014 1 次提交
  15. 13 1月, 2014 1 次提交
  16. 10 1月, 2014 3 次提交
  17. 09 1月, 2014 1 次提交