1. 08 2月, 2013 10 次提交
  2. 06 2月, 2013 23 次提交
  3. 05 2月, 2013 7 次提交
    • D
      Turn virDomainObjList into an opaque virObject · 37abd471
      Daniel P. Berrange 提交于
      As a step towards making virDomainObjList thread-safe turn it
      into an opaque virObject, preventing any direct access to its
      internals.
      
      As part of this a new method virDomainObjListForEach is
      introduced to replace all existing usage of virHashForEach
      37abd471
    • D
      Rename all domain list APIs to have virDomainObjList prefix · 4f6ed6c3
      Daniel P. Berrange 提交于
      The APIs names for accessing the domain list object are
      very inconsistent. Rename them all to have a standard
      virDomainObjList prefix.
      4f6ed6c3
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d
    • M
      qemu: Catch stderr of image compression binary · 137229bf
      Michal Privoznik 提交于
      If a compression binary prints something to stderr, currently
      it is discarded. However, it can contain useful data from
      debugging POV, so we should catch it.
      137229bf
    • M
      qemu: Catch stderr of image decompression binary · cc6c425f
      Michal Privoznik 提交于
      If a decompression binary prints something to stderr, currently
      it is discarded. However, it can contain useful data from
      debugging POV, so we should catch it.
      cc6c425f
    • M
      virFileWrapperFd: Switch to new virCommandDoAsyncIO · 1f25194a
      Michal Privoznik 提交于
      Commit 34e8f63a introduced support for catching errors from
      libvirt iohelper. However, at those times there wasn't such fancy
      API as virCommandDoAsyncIO(), so everything has to be implemented
      on our own. But since we do have the API now, we can use it and
      drop our implementation then.
      1f25194a
    • M
      virCommand: Introduce virCommandDoAsyncIO · 68fb7550
      Michal Privoznik 提交于
      Currently, if we want to feed stdin, or catch stdout or stderr of a
      virCommand we have to use virCommandRun(). When using virCommandRunAsync()
      we have to register FD handles by hand. This may lead to code duplication.
      Hence, introduce an internal API, which does this automatically within
      virCommandRunAsync(). The intended usage looks like this:
      
          virCommandPtr cmd = virCommandNew*(...);
          char *buf = NULL;
      
          ...
      
          virCommandSetOutputBuffer(cmd, &buf);
          virCommandDoAsyncIO(cmd);
      
          if (virCommandRunAsync(cmd, NULL) < 0)
              goto cleanup;
      
          ...
      
          if (virCommandWait(cmd, NULL) < 0)
              goto cleanup;
      
          /* @buf now contains @cmd's stdout */
          VIR_DEBUG("STDOUT: %s", NULLSTR(buf));
      
          ...
      
      cleanup:
          VIR_FREE(buf);
          virCommandFree(cmd);
      
      Note, that both stdout and stderr buffers may change until virCommandWait()
      returns.
      68fb7550