1. 05 2月, 2013 9 次提交
    • 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
      tests: Create test for virCommandDoAsyncIO · f0154959
      Michal Privoznik 提交于
      This is just a basic test, so we don't break virCommand in the
      future. A "Hello world\n" string is written to commanhelper,
      which copies input to stdout and stderr where we read it from.
      Then the read strings are compared with expected values.
      f0154959
    • M
      Introduce event loop to commandtest · 39c77fe5
      Michal Privoznik 提交于
      This is just preparing environment for the next patch, which is
      going to need an event loop.
      39c77fe5
    • 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
    • P
      conf: Use correct type for device type enum in virDomainDeviceDefFree · 8a3cf528
      Peter Krempa 提交于
      With this change it's easy to spot a forgotten free if a new device
      class is added.
      8a3cf528
    • J
      build: Add libcurl dependency to libvirt_driver.la · 514b9306
      Jiri Denemark 提交于
      libvirt.c calls curl_global_init() if WITH_CURL is defined and thus it
      should be linked with libcurl. This fixes link failure in case neither
      xenapi nor esx driver is enabled (they are the only users of libcurl).
      514b9306
    • J
      spec: Fix minor changelog issues · 53657a0a
      Jiri Denemark 提交于
      When a changelog entry references an RPM macro, % needs to be escaped so
      that it does not appear expanded in package changelog.
      
      Fri Mar  4 2009 is incorrect since Mar 4 was Wednesday. Since
      libvirt-0.6.1 was released on Mar 4 2009, we should change Fri to Wed.
      53657a0a
    • M
      Add basic support for VDI images · 027bf2ea
      Martin Kletzander 提交于
      QEMU is fully capable of handling VDI images and we just refuse to
      work with them.  As qemu-img knows and supports this, there should be
      no problem with this addition.
      
      This is of course, just basic functionality, without searching for any
      backing files, etc.
      027bf2ea
    • M
      Support shifted magic in storage files · a0f98229
      Martin Kletzander 提交于
      Some files have the magic shifted to some offset other than 0, so we
      have to support that.  I also cleaned up some lines to be more
      readable and added missing magic for iso file format.
      a0f98229
  2. 04 2月, 2013 17 次提交
  3. 02 2月, 2013 4 次提交
    • M
      e7aa207c
    • M
      esx: Simplify esxPrivate pointer handling in esxOpen · ee47d236
      Matthias Bolte 提交于
      Commit 4445e16b changed the signature
      of esxConnectToHost and esxConnectToVCenter by replacing the esxPrivate
      pointer with virConnectPtr. The esxPrivate pointer was then retrieved
      again from virConnectPtr's privateData. This resulted in a NULL pointer
      dereference, because the privateData pointer was not yet initialized at
      the point where esxConnectToHost and esxConnectToVCenter are called.
      
      This was fixed in commit b126715a that
      moved the initialization of privateData before the problematic calls.
      
      Simplify the logic by making the call to esxFreePrivate unconditional and
      changing esxConnectToHost and esxConnectToVCenter back to take a esxPrivate
      pointer directly. This allows to assign esxPrivate to the virConnectPtr's
      privateData pointer as one of the last steps in esxOpen making it more
      obvious that it is not initialized during the earlier steps of esxOpen.
      ee47d236
    • E
      docs: don't ignore virEvent API · b2aa03b3
      Eric Blake 提交于
      Commit 6094ad7b (0.9.3 release) promoted several functions from
      internal to public, but forgot to fix the documentation generator
      to provide details about those functions.
      
      For an example of what this fixes, look at:
      file:///path/to/libvirt/docs/html/libvirt-libvirt.html#virEventAddHandle
      before and after the patch.
      
      * docs/apibuild.py (ignored_functions): Don't ignore functions
      that were turned into official API.
      * src/util/virevent.c: Fix comments to pass through parser.
      b2aa03b3
    • E
      maint: update to latest gnulib · d09949e2
      Eric Blake 提交于
      CVE-2013-0242 in glibc's regex() can cause a DoS in any daemon
      that runs a regex search on user input while in a multibyte locale.
      I'm not sure how hard it would be to trigger such a setup for
      libvirtd, but rather than risk things, we can avoid the issue:
      gnulib has worked around the problem, and by updating to the latest
      gnulib, we can avoid the bug even on platforms where glibc has yet
      to be patched.
      
      * .gnulib: Update to latest, for various fixes, including regex.
      * bootstrap: Resync from upstream.
      d09949e2
  4. 01 2月, 2013 9 次提交
    • C
      docs: use div, not table, for notices on opaque types · 52b1fd25
      Claudio Bley 提交于
      It's simpler to render and it prevents wrapping the line too early
      because of the table spacing, border et cetera.
      52b1fd25
    • C
      docs: abort when missing return or argument documentation · 7d3cef8a
      Claudio Bley 提交于
      When a function has no associated information to one of its
      arguments or its return type we report it and stop with an error.
      7d3cef8a
    • C
    • C
      91ecc7dd
    • C
      libvirt.h.in: fix documentation for virConnectDomainEventBlockJobCallback · a7defab6
      Claudio Bley 提交于
      In commit 3ac26e26 parameter "path" was
      renamed to "disk" but this change was not reflected in the documentation.
      
      Additionally, documentation of the "opaque" parameter was missing.
      a7defab6
    • C
      4247e4e5
    • S
      Add support for QEMU -add-fd support detection · 410b335d
      Stefan Berger 提交于
      Add support for QEMU -add-fd command line parameter detection.
      This intentionally rejects qemu 1.2, where 'add-fd' QMP did
      not allow full control of set ids, and where there was no command
      line counterpart, but accepts qemu 1.3.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      410b335d
    • E
      qemu: expose qemu 1.3 add-fd monitor command · 7b2c5893
      Eric Blake 提交于
      Add entry points for calling the qemu 'add-fd' and 'remove-fd'
      monitor commands.  There is no entry point for 'query-fdsets';
      the assumption is that a developer can use
       virsh qemu-monitor-command domain '{"execute":"query-fdsets"}'
      when debugging issues, and that meanwhile, libvirt is responsible
      enough to remember what fds it associated with what fdsets.
      Likewise, on the 'add-fd' command, it is assumed that libvirt
      will always pass a set id, rather than letting qemu autogenerate
      the next available id number.
      
      * src/qemu/qemu_monitor.c (qemuMonitorAddFd, qemuMonitorRemoveFd):
      New functions.
      * src/qemu/qemu_monitor.h (qemuMonitorAddFd, qemuMonitorRemoveFd):
      New prototypes.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONAddFd)
      (qemuMonitorJSONRemoveFd): New functions.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONAddFd)
      (qemuMonitorJSONRemoveFd): New prototypes.
      7b2c5893
    • E
      tests: add a comment about our fake qmp · 949ebc30
      Eric Blake 提交于
      While testing QMP, I used a simple qemu session of
      'qemu-kvm -M none -nodefaults -nographic -qmp stdio'
      for some experiments.  But it took me far too long to remember
      the magic invocation to unlock QMP into accepting normal commands.
      While I was able to grep libvirt sources and easily find where
      libvirt expects the normal "QMP" greeting, I could not find the
      proper reply to that greeting nearby.
      
      Reading the testsuite didn't help either, since there we don't
      emulate the mandatory handshake.  But since my grep hit the
      testsuite, adding a bit of documentation will make it much easier
      to jog my memory in the future.
      
      * tests/qemumonitortestutils.c (QEMU_JSON_GREETING): Mention that
      the normal counterpart reply is skipped.
      949ebc30
  5. 31 1月, 2013 1 次提交
    • J
      spec: Avoid using makeinstall relic · d45066a5
      Jiri Denemark 提交于
      The macro was made to help installing broken packages that did not use
      DESTDIR correctly by overriding individual path variables (prefix,
      sysconfdir, ...). Newer rpm provides fixed make_install macro that calls
      make install with just the correct DESTDIR, however it is not available
      everywhere (e.g., RHEL 5 does not have it). On the other hand the
      make_install macro is simple and straightforward enough for us to use
      its expansion directly.
      d45066a5