1. 27 6月, 2014 1 次提交
    • E
      docs: publish correct enum values · 7d17f0a4
      Eric Blake 提交于
      We publish libvirt-api.xml for others to use, and in fact, the
      libvirt-python bindings use it to generate python constants that
      correspond to our enum values.  However, we had an off-by-one bug
      that any enum that relied on C's rules for implicit initialization
      of the first enum member to 0 got listed in the xml as having a
      value of 1 (and all later members of the enum were equally
      botched).
      
      The fix is simple - since we add one to the previous value when
      encountering an enum without an initializer, the previous value
      must start at -1 so that the first enum member is assigned 0.
      
      The python generator code has had the off-by-one ever since DV
      first wrote it years ago, but most of our public enums were immune
      because they had an explicit = 0 initializer.  The only affected
      enums are:
      - virDomainEventGraphicsAddressType (such as
      VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4), since commit 987e31ed
      (libvirt v0.8.0)
      - virDomainCoreDumpFormat (such as VIR_DOMAIN_CORE_DUMP_FORMAT_RAW),
      since commit 9fbaff00 (libvirt v1.2.3)
      - virIPAddrType (such as VIR_IP_ADDR_TYPE_IPV4), since commit
      03e0e79e (not yet released)
      
      Thanks to Nehal J Wani for reporting the problem on IRC, and
      for helping me zero in on the culprit function.
      
      * docs/apibuild.py (CParser.parseEnumBlock): Fix implicit enum
      values.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit 9b291bbe)
      7d17f0a4
  2. 23 8月, 2013 1 次提交
  3. 30 7月, 2013 1 次提交
  4. 25 6月, 2013 5 次提交
  5. 24 4月, 2013 1 次提交
  6. 08 2月, 2013 1 次提交
  7. 02 2月, 2013 1 次提交
  8. 01 2月, 2013 1 次提交
  9. 31 1月, 2013 1 次提交
    • C
      apibuild.py: fix TypeError raised in except clause · 9170ba15
      Claudio Bley 提交于
      When an exception happened inside the try clause in serialize_function,
      a new exception was raised in the except clause subsequently:
      
      Traceback (most recent call last):
        File "./apibuild.py", line 2529, in <module>
          rebuild("libvirt")
        File "./apibuild.py", line 2513, in rebuild
          builder.serialize()
        File "./apibuild.py", line 2467, in serialize
          self.serialize_function(output, function)
        File "./apibuild.py", line 2208, in serialize_function
          self.warning("Failed to save function %s info: " % name, `id.info`)
      TypeError: warning() takes exactly 2 arguments (3 given)
      
      Use the correct number of arguments for self.warning and print the
      original exception to stderr.
      9170ba15
  10. 30 1月, 2013 1 次提交
  11. 22 1月, 2013 2 次提交
  12. 14 1月, 2013 3 次提交
    • D
      Introduce an LXC specific public API & library · 3d1596b0
      Daniel P. Berrange 提交于
      This patch introduces support for LXC specific public APIs. In
      common with what was done for QEMU, this creates a libvirt_lxc.so
      library and libvirt/libvirt-lxc.h header file.
      
      The actual APIs are
      
        int virDomainLxcOpenNamespace(virDomainPtr domain,
                                      int **fdlist,
                                      unsigned int flags);
      
        int virDomainLxcEnterNamespace(virDomainPtr domain,
                                       unsigned int nfdlist,
                                       int *fdlist,
                                       unsigned int *noldfdlist,
                                       int **oldfdlist,
                                       unsigned int flags);
      
      which provide a way to use the setns() system call to move the
      calling process into the container's namespace. It is not
      practical to write in a generically applicable manner. The
      nearest that we could get to such an API would be an API which
      allows to pass a command + argv to be executed inside a
      container. Even if we had such a generic API, this LXC specific
      API is still useful, because it allows the caller to maintain
      the current process context, in particular any I/O streams they
      have open.
      
      NB the virDomainLxcEnterNamespace() API is special in that it
      runs client side, so does not involve the internal driver API.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3d1596b0
    • C
      docs: restrict the set of characters for info keys · bf1786b6
      Claudio Bley 提交于
      When parsing the top level comment of a file, apibuild.py used
      to split on any ':' character of a line regarding the first part
      as a key for a setting, e.g. "Summary". The second part would then
      be assigned as the value for that key.
      
      This means you could not use a ':' character inside those comments
      without ill effects.
      
      Now, a key must consist solely of alphanumeric characters, '_' or '.'.
      bf1786b6
    • C
      docs: simplify code · 833e1493
      Claudio Bley 提交于
      833e1493
  13. 08 1月, 2013 1 次提交
  14. 12 10月, 2012 1 次提交
  15. 18 9月, 2012 1 次提交
    • E
      blockjob: add virDomainBlockCommit · ef1e024d
      Eric Blake 提交于
      A block commit moves data in the opposite direction of block pull.
      Block pull reduces the chain length by dropping backing files after
      data has been pulled into the top overlay, and is always safe; block
      commit reduces the chain length by dropping overlays after data has
      been committed into the backing file, and any files that depended
      on base but not on top are invalidated at any point where they have
      unallocated data that is now pointing to changed contents in base.
      Both directions are useful, however: a qcow2 layer that is more than
      50% allocated will typically be faster with a pull operation, while
      a qcow2 layer with less than 50% allocation will be faster as a
      commit operation.  Committing across multiple layers can be more
      efficient than repeatedly committing one layer at a time, but
      requires extra support from the hypervisor.
      
      This API matches Jeff Cody's proposed qemu command 'block-commit':
      https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
      
      Jeff's command is still in the works for qemu 1.3, and may gain
      further enhancements, such as the ability to control on-error
      handling (it will be comparable to the error handling Paolo is
      adding to 'drive-mirror', so a similar solution will be needed
      when I finally propose virDomainBlockCopy with more functionality
      than the basics supported by virDomainBlockRebase).  However, even
      without qemu support, this API will be useful for _offline_ block
      commits, by wrapping qemu-img calls and turning them into a block
      job, so this API is worth committing now.
      
      For some examples of how this will be implemented, all starting
      with the chain: base <- snap1 <- snap2 <- active
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
       virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
      but cannot be implemented for online qemu with round 1 of
      Jeff's patches; and for offline images, it would require
      three back-to-back qemu-img invocations unless qemu-img
      is patched to allow more efficient multi-layer commits;
      the end result would be 'base' as the active disk with
      contents from all three other files, where 'snap1' and
      'snap2' are invalid right away, and 'active' is invalid
      once any further changes to 'base' are made.
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
      they cannot be implemented for online qemu, but for offline,
      it is a matter of 'qemu-img commit active', so that 'snap2'
      is now the active disk with contents formerly in 'active'.
      
      + Similarly:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
      for an offline domain will merge 'active' into 'snap2', then
      delete 'active' to avoid leaving a potentially invalid file
      around.
      
      + This version:
       virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
      can be implemented online with 'block-commit' passing a base of
      snap1 and a top of snap2; and can be implemented offline by
      'qemu-img commit snap2' followed by 'qemu-img rebase -u
      -b snap1 active'
      
      * include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
      * src/libvirt.c (virDomainBlockCommit): Implement it.
      * src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
      * src/driver.h (virDrvDomainBlockCommit): New driver callback.
      * docs/apibuild.py (CParser.parseSignature): Add exception.
      ef1e024d
  16. 27 7月, 2012 1 次提交
  17. 24 5月, 2012 1 次提交
    • D
      Add parsing for VIR_ENUM_IMPL & VIR_ENUM_DECL in apibuild.py · 45b43a8c
      Daniel P. Berrange 提交于
      The apibuild.py parser needs to be able to parse & ignore
      any VIR_ENUM_IMPL/VIR_ENUM_DECL macros in the source. Add
      some special case code to deal with this rather than trying
      to figure out a generic syntax for parsing macros.
      
      * apibuild.py: Special case  VIR_ENUM_IMPL & VIR_ENUM_DECL
      45b43a8c
  18. 02 2月, 2012 1 次提交
    • E
      block rebase: add new API virDomainBlockRebase · 99fd69c3
      Eric Blake 提交于
      Qemu is adding the ability to do a partial rebase.  That is, given:
      
      base <- intermediate <- current
      
      virDomainBlockPull will produce:
      
      current
      
      but qemu now has the ability to leave base in the chain, to produce:
      
      base <- current
      
      Note that current qemu can only do a forward merge, and only with
      the current image as the destination, which is fully described by
      this API without flags.  But in the future, it may be possible to
      enhance this API for additional scenarios by using flags:
      
      Merging the current image back into a previous image (that is,
      undoing a live snapshot), could be done by passing base as the
      destination and flags with a bit requesting a backward merge.
      
      Merging any other part of the image chain, whether forwards (the
      backing image contents are pulled into the newer file) or backwards
      (the deltas recorded in the newer file are merged back into the
      backing file), could also be done by passing a new flag that says
      that base should be treated as an XML snippet rather than an
      absolute path name, where the XML could then supply the additional
      instructions of which part of the image chain is being merged into
      any other part.
      
      * include/libvirt/libvirt.h.in (virDomainBlockRebase): New
      declaration.
      * src/libvirt.c (virDomainBlockRebase): Implement it.
      * src/libvirt_public.syms (LIBVIRT_0.9.10): Export it.
      * src/driver.h (virDrvDomainBlockRebase): New driver callback.
      * src/rpc/gendispatch.pl (long_legacy): Add exemption.
      * docs/apibuild.py (long_legacy_functions): Likewise.
      99fd69c3
  19. 14 9月, 2011 1 次提交
  20. 02 9月, 2011 1 次提交
  21. 22 7月, 2011 1 次提交
    • A
      Add new API virDomainBlockPull* to headers · 152e8103
      Adam Litke 提交于
      Set up the types for the block pull functions and insert them into the
      virDriver structure definition.  Symbols are exported in this patch to
      prevent
      documentation compile failures.
      
      * include/libvirt/libvirt.h.in: new API
      * src/driver.h: add the new entry to the driver structure
      * python/generator.py: fix compiler errors, the actual python bindings
      * are
        implemented later
      * src/libvirt_public.syms: export symbols
      * docs/apibuild.py: Extend 'unsigned long' parameter exception to this
      * API
      152e8103
  22. 19 7月, 2011 1 次提交
    • D
      Quieten build & ensure API build scripts exit with non-zero status · 8665f855
      Daniel P. Berrange 提交于
      The current API build scripts will continue and exit with a zero
      status even if they find problems. This has been the cause of many
      build problems, or hidden build errors, in the past. Change the
      scripts so they always exit with a non-zero status for any problems
      they do not understand. Also turn off all debug output by default
      so they respect $(AM_V_GEN)
      
      * docs/Makefile.am: Use $(AM_V_GEN) for API/HTML scripts
      * docs/apibuild.py, python/generator.py: Exit with non-zero status
        if problems are found. Also be silent, not outputting any debug
        messages.
      * src/Makefile.am: Use $(AM_V_GEN) for ESX generator
      * python/Makefile.am: Tweak rule
      8665f855
  23. 22 6月, 2011 1 次提交
    • D
      Fix to python API extractor and API doc generation · d42ea21a
      Daniel Veillard 提交于
      This fixes a number of issues most of them raised by Eric Blake on the
      generated documentation output:
         - parsing of "long long int" and similar
         - add parsing of unions within a struct
         - remove spurious " * " fron comments on structure fields and enums
         - fix concatenation of base type and name in arrays
         - extend XSLT to cope with union in structs
      
      * docs/apibuild.py: fix and extend API extraction tool
      * docs/newapi.xsl: extend the stylesheets to cope with union in
        public structures
      d42ea21a
  24. 01 6月, 2011 1 次提交
  25. 31 5月, 2011 1 次提交
    • M
      Ignore backward compatibility macros in apibuild.py · 1767c8d7
      Matthias Bolte 提交于
      This fixes this three warnings from the parser by allowing the parser
      to ignore some macros in the same way as it can ignore functions.
      
      Parsing ./../include/libvirt/libvirt.h
      Misformatted macro comment for _virSchedParameter
       Expecting '* _virSchedParameter:' got '* virSchedParameter:'
      Misformatted macro comment for _virBlkioParameter
       Expecting '* _virBlkioParameter:' got '* virBlkioParameter:'
      Misformatted macro comment for _virMemoryParameter
       Expecting '* _virMemoryParameter:' got '* virMemoryParameter:'
      1767c8d7
  26. 16 5月, 2011 1 次提交
    • D
      Introduce yet another migration version in API. · 65043d2d
      Daniel P. Berrange 提交于
      Migration just seems to go from bad to worse. We already had to
      introduce a second migration protocol when adding the QEMU driver,
      since the one from Xen was insufficiently flexible to cope with
      passing the data the QEMU driver required.
      
      It turns out that this protocol still has some flaws that we
      need to address. The current sequence is
      
       *  Src: DumpXML
                - Generate XML to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Kill off VM if successful, resume if failed
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if unsuccessful
      
      The problems with this are:
      
       - Since the first step is a generic 'DumpXML' call, we can't
         add in other migration specific data. eg, we can't include
         any VM lease data from lock manager plugins
       - Since the first step is a generic 'DumpXML' call, we can't
         emit any 'migration begin' event on the source, or have
         any hook that runs right at the start of the process
       - Since there is no final step on the source, if the Finish
         method fails to receive all migration data & has to kill
         the VM, then there's no way to resume the original VM
         on the source
      
      This patch attempts to introduce a version 3 that uses the
      improved 5 step sequence
      
       *  Src: Begin
                - Generate XML to pass to dst
                - Generate optional cookie to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Generate optional cookie to pass to dst
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if failed, resume if success
                - Generate optional cookie to pass to src
      
       *  Src: Confirm
                - Kill off VM if success, resume if failed
      
      The API is designed to allow both input and output cookies
      in all methods where applicable. This lets us pass around
      arbitrary extra driver specific data between src & dst during
      migration. Combined with the extra 'Begin' method this lets
      us pass lease information from source to dst at the start of
      migration
      
      Moving the killing of the source VM out of Perform and
      into Confirm, means we can now recover if the dst host
      can't successfully Finish receiving migration data.
      65043d2d
  27. 18 2月, 2011 1 次提交
  28. 17 2月, 2011 1 次提交
  29. 13 10月, 2010 1 次提交
    • D
      Fixes for documentation extraction · 0df67151
      Daniel Veillard 提交于
      * include/libvirt/libvirt.h.in: some of the function type description
        were broken so they could not be automatically documented
      * src/util/event.c docs/apibuild.py: event.c exports one public API
        so it needs to be scanned too, avoid a few warnings
      0df67151
  30. 23 3月, 2010 1 次提交
  31. 25 2月, 2010 1 次提交
  32. 06 11月, 2009 1 次提交
    • P
      Add sentinel attribute for NULL terminated arg lists · 649bcd72
      Paolo Bonzini 提交于
      * src/internal.h (ATTRIBUTE_SENTINEL): New, it's a ggc feature and
        protected as such
      * src/util/buf.c (virBufferStrcat): Use it.
      * src/util/ebtables.c (ebtablesAddRemoveRule): Use it.
      * src/util/iptables.c (iptableAddRemoveRule: Use it.
      * src/util/qparams.h (new_qparam_set, append_qparams): Use it.
      * docs/apibuild.py: avoid breaking the API generator with that new
        internal keyword macro
      649bcd72
  33. 06 10月, 2009 1 次提交