1. 10 12月, 2013 19 次提交
  2. 06 12月, 2013 8 次提交
  3. 05 12月, 2013 5 次提交
    • M
      virThreadPoolFree: Set n(Prio)Workers after the pool is locked · e925aad3
      Michal Privoznik 提交于
      In 78839da0 I am trying to join the worker threads. However, I can't
      sipmly reuse pool->nWorkers (same applies for pool->nPrioWorkers),
      because of the following flow that is currently implemented:
      
      1) the main thread executing virThreadPoolFree sets pool->quit = true,
      wakes up all the workers and wait on pool->quit_cond.
      
      2) A worker is woken up and see quit request. It immediately jumps of
      the while() loop and decrements pool->nWorkers (or pool->nPrioWorkers in
      case of priority worker). The last thread signalizes pool->quit_cond.
      
      3) Main thread is woken up, with both pool->nWorkers and
      pool->nPrioWorkers being zero.
      
      So there's a need to copy the original value of worker thread counts
      into local variables. However, these need to set *after* the check for
      pool being NULL (dereferencing a NULL is no no). And for safety they can
      be set right after the pool is locked.
      Reported-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e925aad3
    • P
      qemu: Fix indentation in qemuTranslateDiskSourcePool · 90f9ccb4
      Peter Krempa 提交于
      Commit e1a4d08b was pushed with bad
      indentation the iSCSI pool translation code.
      90f9ccb4
    • W
      qemuAgentDispose: Reset lastError · 36ae35f0
      Wangyufei (James) 提交于
      When an error occurred in qemuAgentIO, it will be saved in mon->lastError,
      but it will not be freed at the end.  Present since commit c160ce33;
      and compare to commit 9cc8a5af fixing the same problem in qemu_monitor.c.
      
      ==22219== 54 bytes in 1 blocks are definitely lost in loss record 982 of 1,379
      ==22219==    at 0x4C26B9B: malloc (vg_replace_malloc.c:263)
      ==22219==    by 0x8520521: strdup (in /lib64/libc-2.11.3.so)
      ==22219==    by 0x52E99CB: virStrdup (virstring.c:554)
      ==22219==    by 0x52B44C4: virCopyError (virerror.c:195)
      ==22219==    by 0x52B5123: virCopyLastError (virerror.c:312)
      ==22219==    by 0x10905877: qemuAgentIO (qemu_agent.c:660)
      ==22219==    by 0x52B6122: virEventPollDispatchHandles (vireventpoll.c:501)
      ==22219==    by 0x52B7AEA: virEventPollRunOnce (vireventpoll.c:647)
      ==22219==    by 0x52B5C1B: virEventRunDefaultImpl (virevent.c:274)
      ==22219==    by 0x54181FD: virNetServerRun (virnetserver.c:1112)
      ==22219==    by 0x11EF4D: main (libvirtd.c:1513)
      Signed-off-by: NZhou Yimin <zhouyimin@huawei.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      36ae35f0
    • N
      Fix memory leak in qemuBuildDriveStr() · f386d323
      Nehal J Wani 提交于
      This patch fixes memory leaks reported by valgrind on running
      qemuxml2argvtest; introduced in commit 0df53f04.
      
      Most of them are of the form:
      
      ==24777== 15 bytes in 1 blocks are definitely lost in loss record 39 of 129
      ==24777==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==24777==    by 0x341F485E21: strdup (strdup.c:42)
      ==24777==    by 0x4CADE5F: virStrdup (virstring.c:554)
      ==24777==    by 0x4362B6: qemuBuildDriveStr (qemu_command.c:3848)
      ==24777==    by 0x43EF73: qemuBuildCommandLine (qemu_command.c:8500)
      ==24777==    by 0x426670: testCompareXMLToArgvHelper (qemuxml2argvtest.c:350)
      ==24777==    by 0x427C01: virtTestRun (testutils.c:138)
      ==24777==    by 0x41DDB5: mymain (qemuxml2argvtest.c:658)
      ==24777==    by 0x4282A2: virtTestMain (testutils.c:593)
      ==24777==    by 0x341F421A04: (below main) (libc-start.c:225)
      ==24777==
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f386d323
    • P
      maint: Kill usage of atoi() · df36af58
      Peter Krempa 提交于
      Kill the use of atoi() and introduce syntax check to forbid it and it's
      friends (atol, atoll, atof, atoq).
      
      Also fix a typo in variable name holding the cylinders count of a disk
      pool (apparently unused).
      
      examples/domsuspend/suspend.c will need a larger scale refactor as the
      whole example file is broken thus it will be exempted from the syntax
      check for now.
      df36af58
  4. 04 12月, 2013 8 次提交