1. 08 3月, 2016 2 次提交
  2. 01 3月, 2016 1 次提交
  3. 19 2月, 2016 2 次提交
    • J
      qemu: Avoid calling qemuProcessStop without a job · 81f50cb9
      Jiri Denemark 提交于
      Calling qemuProcessStop without a job opens a way to race conditions
      with qemuDomainObjExitMonitor called in another thread. A real world
      example of such a race condition:
      
        - migration thread (A) calls qemuMigrationWaitForSpice
        - another thread (B) starts processing qemuDomainAbortJob API
        - thread B signals thread A via qemuDomainObjAbortAsyncJob
        - thread B enters monitor (qemuDomainObjEnterMonitor)
        - thread B calls qemuMonitorSend
        - thread A awakens and calls qemuProcessStop
        - thread A calls qemuMonitorClose and sets priv->mon to NULL
        - thread B calls qemuDomainObjExitMonitor with priv->mon == NULL
        => monitor stays ref'ed and locked
      
      Depending on how lucky we are, the race may result in a memory leak or
      it can even deadlock libvirtd's event loop if it tries to lock the
      monitor to process an event received before qemuMonitorClose was called.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      81f50cb9
    • J
      qemu: Pass async job to qemuProcessInit · b7a948be
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      b7a948be
  4. 17 2月, 2016 1 次提交
    • P
      qemu: migration: Refactor code now that we assume support for fd migration · 23087cfd
      Peter Krempa 提交于
      After removing capability check for fd migration the code that was left
      behind didn't make quite sense. The old exec migration would be used in
      case when pipe() failed. Remove the old code and make failure of pipe()
      a hard error.
      
      This additionally removes usage of virCgroupAllowDevicePath outside of
      qemu_cgroup.c.
      23087cfd
  5. 11 2月, 2016 1 次提交
    • M
      qemu: Connect to guest agent iff needed · 88ed9d77
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1293351
      
      Since we already have virtio channel events, we know when guest
      agent within guest has (dis-)connected. Instead of us blindly
      connecting to a socket that no one is listening to, we can just
      follow what qemu-ga does. This has a nice benefit that we don't
      need to 'guest-ping' the agent just to timeout and find out
      nobody is listening.
      
      The way that this commit is implemented:
      - don't connect in qemuProcessLaunch directly, defer that to event
        callback (which already follows the agent) -
        processSerialChangedEvent
      - after migration is settled, before we resume vCPUs, ask qemu
        whether somebody is listening on the socket and if so, connect
        to it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      88ed9d77
  6. 08 2月, 2016 1 次提交
  7. 05 2月, 2016 1 次提交
  8. 04 2月, 2016 2 次提交
  9. 10 1月, 2016 1 次提交
  10. 09 1月, 2016 4 次提交
  11. 08 1月, 2016 1 次提交
  12. 07 1月, 2016 1 次提交
  13. 04 1月, 2016 1 次提交
    • M
      qemu: do not leak NBD disk data in migration cookie · 28c9eea0
      Michael Chapman 提交于
      Valgrind complained:
      
      ==18990== 20 (16 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 188 of 996
      ==18990==    at 0x4A057BB: calloc (vg_replace_malloc.c:593)
      ==18990==    by 0x5292E9B: virAllocN (viralloc.c:191)
      ==18990==    by 0x2221E731: qemuMigrationCookieXMLParseStr (qemu_migration.c:1012)
      ==18990==    by 0x2221F390: qemuMigrationEatCookie (qemu_migration.c:1413)
      ==18990==    by 0x222228CE: qemuMigrationPrepareAny (qemu_migration.c:3463)
      ==18990==    by 0x22224121: qemuMigrationPrepareDirect (qemu_migration.c:3865)
      ==18990==    by 0x22251C25: qemuDomainMigratePrepare3Params (qemu_driver.c:12414)
      ==18990==    by 0x5389EE0: virDomainMigratePrepare3Params (libvirt-domain.c:5107)
      ==18990==    by 0x1278DB: remoteDispatchDomainMigratePrepare3ParamsHelper (remote.c:5425)
      ==18990==    by 0x53FF287: virNetServerProgramDispatch (virnetserverprogram.c:437)
      ==18990==    by 0x540523D: virNetServerProcessMsg (virnetserver.c:135)
      ==18990==    by 0x54052C7: virNetServerHandleJob (virnetserver.c:156)
      ==18990==
      ==18990== 20 (16 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 189 of 996
      ==18990==    at 0x4A057BB: calloc (vg_replace_malloc.c:593)
      ==18990==    by 0x5292E9B: virAllocN (viralloc.c:191)
      ==18990==    by 0x2221E731: qemuMigrationCookieXMLParseStr (qemu_migration.c:1012)
      ==18990==    by 0x2221F390: qemuMigrationEatCookie (qemu_migration.c:1413)
      ==18990==    by 0x222249D2: qemuMigrationRun (qemu_migration.c:4395)
      ==18990==    by 0x22226365: doNativeMigrate (qemu_migration.c:4693)
      ==18990==    by 0x22228E45: qemuMigrationPerform (qemu_migration.c:5553)
      ==18990==    by 0x2225144B: qemuDomainMigratePerform3Params (qemu_driver.c:12621)
      ==18990==    by 0x539F5D8: virDomainMigratePerform3Params (libvirt-domain.c:5206)
      ==18990==    by 0x127305: remoteDispatchDomainMigratePerform3ParamsHelper (remote.c:5557)
      ==18990==    by 0x53FF287: virNetServerProgramDispatch (virnetserverprogram.c:437)
      ==18990==    by 0x540523D: virNetServerProcessMsg (virnetserver.c:135)
      
      If we're replacing the NBD data, it's simplest to free the old object
      (including the disk list) and allocate a new one.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      28c9eea0
  14. 26 11月, 2015 2 次提交
    • D
      qemu: convert monitor to use qemuDomainLogContextPtr indirectly · a48539c0
      Daniel P. Berrange 提交于
      Currently the QEMU monitor is given an FD to the logfile. This
      won't work in the future with virtlogd, so it needs to use the
      qemuDomainLogContextPtr instead, but it shouldn't directly
      access that object either. So define a callback that the
      monitor can use for reporting errors from the log file.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a48539c0
    • D
      qemu: unify code for reporting errors from QEMU log files · 69b09921
      Daniel P. Berrange 提交于
      There are two pretty similar functions qemuProcessReadLog and
      qemuProcessReadChildErrors. Both read from the QEMU log file
      and try to strip out libvirt messages. The latter then reports
      an error, while the former lets the callers report an error.
      
      Re-write qemuProcessReadLog so that it uses a single read
      into a dynamically allocated buffer. Then introduce a new
      qemuProcessReportLogError that calls qemuProcessReadLog
      and reports an error.
      
      Convert all callers to use qemuProcessReportLogError.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      69b09921
  15. 25 11月, 2015 4 次提交
  16. 19 11月, 2015 3 次提交
  17. 10 11月, 2015 1 次提交
  18. 05 11月, 2015 2 次提交
  19. 27 10月, 2015 1 次提交
  20. 16 10月, 2015 1 次提交
    • S
      Close the source fd if the destination qemu exits during tunnelled migration · b39a1fe1
      Shivaprasad G Bhat 提交于
      Tunnelled migration can hang if the destination qemu exits despite all the
      ABI checks. This happens whenever the destination qemu exits before the
      complete transfer is noticed by source qemu. The savevm state checks at
      runtime can fail at destination and cause qemu to error out.
      The source qemu cant notice it as the EPIPE is not propogated to it.
      The qemuMigrationIOFunc() notices the stream being broken from virStreamSend()
      and it cleans up the stream alone. The qemuMigrationWaitForCompletion() would
      never get to 100% transfer completion.
      The qemuMigrationWaitForCompletion() never breaks out as well since
      the ssh connection to destination is healthy, and the source qemu also thinks
      the migration is ongoing as the Fd to which it transfers, is never
      closed or broken. So, the migration will hang forever. Even Ctrl-C on the
      virsh migrate wouldn't be honoured. Close the source side FD when there is
      an error in the stream. That way, the source qemu updates itself and
      qemuMigrationWaitForCompletion() notices the failure.
      
      Close the FD for all kinds of errors to be sure. The error message is not
      copied for EPIPE so that the destination error is copied instead later.
      
      Note:
      Reproducible with repeated migrations between Power hosts running in different
      subcores-per-core modes.
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      b39a1fe1
  21. 07 10月, 2015 4 次提交
  22. 06 10月, 2015 3 次提交