1. 18 1月, 2019 3 次提交
  2. 14 12月, 2018 1 次提交
  3. 10 5月, 2018 1 次提交
  4. 06 12月, 2017 1 次提交
  5. 27 4月, 2017 1 次提交
  6. 19 6月, 2015 2 次提交
  7. 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
  8. 25 4月, 2014 1 次提交
  9. 11 3月, 2014 1 次提交
  10. 13 8月, 2013 1 次提交
  11. 02 8月, 2013 1 次提交
    • R
      bridge driver: extract platform specifics · 4ac708f2
      Roman Bogorodskiy 提交于
      * Move platform specific things (e.g. firewalling and route
        collision checks) into bridge_driver_platform
      * Create two platform specific implementations:
          - bridge_driver_linux: Linux implementation using iptables,
            it's actually the code moved from bridge_driver.c
          - bridge_driver_nop: dumb implementation that does nothing
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4ac708f2