You need to sign in or sign up before continuing.
  1. 19 7月, 2019 1 次提交
  2. 18 7月, 2019 9 次提交
  3. 19 6月, 2019 1 次提交
  4. 21 5月, 2019 2 次提交
  5. 24 1月, 2019 1 次提交
  6. 18 1月, 2019 16 次提交
  7. 14 12月, 2018 1 次提交
  8. 10 5月, 2018 1 次提交
  9. 06 12月, 2017 1 次提交
  10. 27 4月, 2017 1 次提交
  11. 19 6月, 2015 2 次提交
  12. 29 4月, 2015 2 次提交
    • M
      qemuBlockJobSync*: introduce sync block job helpers · 89a5e25d
      Michael Chapman 提交于
      qemuBlockJobSyncBegin and qemuBlockJobSyncEnd delimit a region of code
      where block job events are processed "synchronously".
      qemuBlockJobSyncWait and qemuBlockJobSyncWaitWithTimeout wait for an
      event generated by a block job.
      
      The Wait* functions may be called multiple times while the synchronous
      block job is active. Any pending block job event will be processed by
      only when Wait* or End is called.  disk->blockJobStatus is reset by
      these functions, so if it is needed a pointer to a
      virConnectDomainEventBlockJobStatus variable should be passed as the
      last argument. It is safe to pass NULL if you do not care about the
      block job status.
      
      All functions assume the VM object is locked. The Wait* functions will
      unlock the object for as long as they are waiting. They will return -1
      and report an error if the domain exits before an event is received.
      
      Typical use is as follows:
      
        virQEMUDriverPtr driver;
        virDomainObjPtr vm; /* locked */
        virDomainDiskDefPtr disk;
        virConnectDomainEventBlockJobStatus status;
      
        qemuBlockJobSyncBegin(disk);
      
        ... start block job ...
      
        if (qemuBlockJobSyncWait(driver, vm, disk, &status) < 0) {
            /* domain died while waiting for event */
            ret = -1;
            goto error;
        }
      
        ... possibly start other block jobs
            or wait for further events ...
      
        qemuBlockJobSyncEnd(driver, vm, disk, NULL);
      
      To perform other tasks periodically while waiting for an event:
      
        virQEMUDriverPtr driver;
        virDomainObjPtr vm; /* locked */
        virDomainDiskDefPtr disk;
        virConnectDomainEventBlockJobStatus status;
        unsigned long long timeout = 500 * 1000ull; /* milliseconds */
      
        qemuBlockJobSyncBegin(disk);
      
        ... start block job ...
      
        do {
            ... do other task ...
      
            if (qemuBlockJobSyncWaitWithTimeout(driver, vm, disk,
                                                timeout, &status) < 0) {
                /* domain died while waiting for event */
                ret = -1;
                goto error;
            }
        } while (status == -1);
      
        qemuBlockJobSyncEnd(driver, vm, disk, NULL);
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      89a5e25d
    • M
      qemuBlockJobEventProcess: move to new source file · 206dbf3f
      Michael Chapman 提交于
      We will want to use synchronous block jobs from qemu_migration as well,
      so split this function out into a new source file.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      206dbf3f
  13. 25 4月, 2014 1 次提交
  14. 11 3月, 2014 1 次提交