1. 06 10月, 2009 7 次提交
    • C
      python: Add a newline after custom classes · ee8240b2
      Cole Robinson 提交于
      In the generated bindings, custom classes are squashed against the following
      class, which hurts readability.
      ee8240b2
    • C
      python: Fix generated virInterface method names · 1e87ecd1
      Cole Robinson 提交于
      A mistake in the generator was causing virInterface methods to be generated
      with unpredicatable names ('ceUndefine', instead of just 'undefine'). This
      fixes the method names to match existing convention.
      
      Does anyone care if we are breaking API compat? My guess is that no one is
      using the python interface bindings yet.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      1e87ecd1
    • C
      python: Use a pure python implementation of 'vir*GetConnect' · 9e09f313
      Cole Robinson 提交于
      The API docs explictly warn that we shouldn't use the C vir*GetConnect calls
      in bindings: doing so can close the internal connection pointer and cause
      things to get screwy. Implement these calls in python.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      9e09f313
    • C
      python: Don't generate bindings for vir*Ref · 97648a97
      Cole Robinson 提交于
      They are only for use in implementing the bindings, so shouldn't be
      exposed to regular API users.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      97648a97
    • C
      python: Don't generate conflicting conn.createXML functions. · 3f935df0
      Cole Robinson 提交于
      A special case in the generator wasn't doing its job, and duplicate
      conn.createXML functions were being generated. The bindings diff is:
      
      @@ -1079,14 +1079,6 @@ class virConnect:
               return __tmp
      
           def createXML(self, xmlDesc, flags):
      -        """Create a new device on the VM host machine, for example,
      -           virtual HBAs created using vport_create. """
      -        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
      -        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
      -        __tmp = virNodeDevice(self, _obj=ret)
      -        return __tmp
      -
      -    def createXML(self, xmlDesc, flags):
               """Launch a new guest domain, based on an XML description
                 similar to the one returned by virDomainGetXMLDesc() This
                 function may requires privileged access to the hypervisor.
      @@ -1327,6 +1319,14 @@ class virConnect:
               __tmp = virNetwork(self, _obj=ret)
               return __tmp
      
      +    def nodeDeviceCreateXML(self, xmlDesc, flags):
      +        """Create a new device on the VM host machine, for example,
      +           virtual HBAs created using vport_create. """
      +        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
      +        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
      +        __tmp = virNodeDevice(self, _obj=ret)
      +        return __tmp
      +
           def nodeDeviceLookupByName(self, name):
               """Lookup a node device by its name. """
               ret = libvirtmod.virNodeDeviceLookupByName(self._o, name)
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      3f935df0
    • C
      python: Remove use of xmllib in generator.py · fca27ca2
      Cole Robinson 提交于
      xmllib has been deprecated since python 2.0, and running the generator throws
      a warning. Move to using xml.sax
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      fca27ca2
    • C
      python: Remove FastParser from generator. · 547d8e3a
      Cole Robinson 提交于
      FastParser uses sgmlop, a non-standard python module meant as a replacement
      for xmllib (which is deprecated since python 2.0). Fedora doesn't even carry
      this module, and the generator doesn't have high performance requirements, so
      just rip the code out.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      547d8e3a
  2. 29 9月, 2009 1 次提交
    • D
      Add public API definition for data stream handling · 182eba1b
      Daniel P. Berrange 提交于
      * include/libvirt/libvirt.h.in: Public API contract for
        virStreamPtr object
      * src/libvirt_public.syms: Export data stream APIs
      * src/libvirt_private.syms: Export internal helper APIs
      * src/libvirt.c: Data stream API driver dispatch
      * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr
        object
      * src/driver.h: Define internal driver API for streams
      * .x-sc_avoid_write: Ignore src/libvirt.c because it trips
        up on comments including write()
      * python/Makefile.am: Add libvirt-override-virStream.py
      * python/generator.py: Add rules for virStreamPtr class
      * python/typewrappers.h, python/typewrappers.c: Wrapper
        for virStreamPtr
      * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate
        with new APIs
      182eba1b
  3. 28 9月, 2009 1 次提交
    • D
      Fix API doc extractor to stop munging comment formatting · 5486abfe
      Daniel P. Berrange 提交于
      The python method help docs are copied across from the C
      funtion comments, but in the process all line breaks and
      indentation was being lost. This made the resulting text
      and code examples completely unreadable. Both the API
      doc extractor and the python generator were destroying
      whitespace & this fixes them to preserve it exactly.
      
      * docs/apibuild.py: Preserve all whitespace when extracting
        function comments. Print function comment inside a <![CDATA[
        section to fully preserve all whitespace. Look for the
        word 'returns' to describe return values, instead of 'return'
        to avoid getting confused with code examples including the
        C 'return' statement.
      * python/generator.py: Preserve all whitespace when printing
        function help docs
      * src/libvirt.c: Change any return parameter indicated by
        'return' to be 'returns', to avoid confusing the API extractor
      * docs/libvirt-api.xml: Re-build for fixed descriptions
      5486abfe
  4. 21 9月, 2009 1 次提交
    • D
      Re-arrange python generator to make it clear what's auto-generated · f991a006
      Daniel P. Berrange 提交于
      * README: New file describing what each file is used for
      * livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
        libvirt-override-virConnect.py: Manually written code overriding
        the generator
      * typewrappers.c, typewrappers.h: Data type wrappers
      * generator.py: Automatically pre-prend contents of libvirt-override.py
        to generated libvirt.py. Output into libvirt.py directly instead of
        libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
        files into libvirt.c/.h directly
      * Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
        and libvirtclass.py, since generator.py does it directly
      f991a006
  5. 15 9月, 2009 2 次提交
    • D
      Add usage type/id as a public API property of virSecret · a2a30038
      Daniel P. Berrange 提交于
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
        virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
      * python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
        as not throwing exceptions
      * qemud/remote.c: Implement dispatch for virLookupSecretByUsage
      * qemud/remote_protocol.x: Add usage type & ID as attributes of
        remote_nonnull_secret. Add RPC calls for new public APIs
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.c, src/datatypes.h: Add usageType and usageID as
        properties of virSecretPtr
      * src/driver.h: Add virLookupSecretByUsage driver entry point
      * src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
        and virLookupSecretByUsage
      * src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
        and virLookupSecretByUsage
      * src/remote_internal.c: Implement virLookupSecretByUsage entry
      * src/secret_conf.c, src/secret_conf.h: Remove the
        virSecretUsageType enum, now in public API. Make volume
        path mandatory when parsing XML
      * src/secret_driver.c: Enforce usage uniqueness when defining secrets.
        Implement virSecretLookupByUsage api method
      * src/virsh.c: Include usage for secret-list command
      a2a30038
    • D
      Fix UUID handling in secrets/storage encryption APIs · 47e7a258
      Daniel P. Berrange 提交于
      Convert all the secret/storage encryption APIs / wire format to
      handle UUIDs in raw format instead of non-canonical printable
      format. Guarentees data format correctness.
      
      * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
        and validate fully
      * docs/schemas/secret.rng: Fully validate UUID
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
        virSecretLookupByUUID and virSecretGetUUID. Make
        virSecretGetUUIDString follow normal API design pattern
      * python/generator.py: Skip generation of virSecretGetUUID,
        virSecretGetUUIDString and virSecretLookupByUUID
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl
        of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
      * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
        Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
      * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
        remote_uuid instead of remote_nonnull_string for UUID field.
        Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
        REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
        remote_uuid  value
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
        of printable. Change virGetSecret to use raw format UUID
      * src/driver.h: Rename virDrvSecretLookupByUUIDString to
        virDrvSecretLookupByUUID and use raw format UUID
      * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
        and re-implement virSecretLookupByUUIDString and
        virSecretGetUUIDString in terms of those
      * src/libvirt_public.syms: Add virSecretLookupByUUID and
        virSecretGetUUID
      * src/remote_internal.c: Rename remoteSecretLookupByUUIDString
        to remoteSecretLookupByUUID. Fix typo in args for
        remoteSecretDefineXML impl. Use raw UUID format for
        get_nonnull_secret and make_nonnull_secret
      * src/storage_encryption_conf.c, src/storage_encryption_conf.h:
        Storage UUID in raw format, and require it to be present in
        XML. Use UUID parser to validate.
      * secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
        Storage UUID in raw format.
      * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
        in a filed with printable UUID, instead of base64 UUID.
      * src/virsh.c: Adjust for changed public API contract of
        virSecretGetUUIDString.
      * src/storage_Backend.c: DOn't undefine secret we just generated
        upon successful volume creation. Fix to handle raw UUIDs. Generate
        a non-clashing UUID
      * src/qemu_driver.c: Change to use lookupByUUID instead of
        lookupByUUIDString
      47e7a258
  6. 02 9月, 2009 1 次提交
    • M
      Secret manipulation API docs refresh & wire up python generator · 9dc3b993
      Miloslav Trmač 提交于
      Sample session:
      
      >>> import libvirt
      >>> c = libvirt.open('qemu:///session')
      
      >>> c.listSecrets()
      ['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc']
      
      >>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n")
      
      >>> s.UUIDString()
      '340c2dfb-811b-eda8-da9e-25ccd7bfd650'
      
      >>> s.XMLDesc()
      "<secret ephemeral='no' private='no'>\n  <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n  <description>Something for use</description>\n  <volume>/foo/bar</volume>\n</secret>\n"
      
      >>> s.setValue('abc\0xx\xffx')
      0
      
      >>> s.value()
      'abc\x00xx\xffx'
      
      >>> s.undefine()
      0
      
      * python/generator.py: Add rules for virSecret APIs
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl of
        virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs
      * python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects
      * docs/libvirt-api.xml, docs/libvirt-refs.xml,
        docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html,
        docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html:
        Re-generate with 'make api'
      9dc3b993
  7. 27 7月, 2009 1 次提交
  8. 21 5月, 2009 1 次提交
  9. 01 4月, 2009 2 次提交
  10. 03 3月, 2009 1 次提交
  11. 17 2月, 2009 1 次提交
  12. 21 11月, 2008 1 次提交
  13. 31 10月, 2008 1 次提交
    • D
      * python/Makefile.am python/generator.py python/libvir.c · 7b716fce
      Daniel Veillard 提交于
        python/libvir.py python/libvirt_wrap.h python/types.c:
        adds support for events from the python bindings, also
        improves the generator allowing to embbed per function
        definition files, patch by Ben Guthro
      * examples/domain-events/events-python/event-test.py: also
        adds a programming example
      Daniel
      7b716fce
  14. 23 10月, 2008 1 次提交
    • D
      Massive patch adding event APIs by Ben Guthro · 1509b802
      Daniel Veillard 提交于
      * include/libvirt/libvirt.h include/libvirt/libvirt.h.in
        src/libvirt.c src/libvirt_sym.version: new libvirt event entry
        points, big patch provided by Ben Guthro
      * Makefile.am configure.in src/driver.h src/event.c src/event.h
        src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c
        src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c
        src/remote_internal.c src/storage_backend_fs.c src/test.c
        qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c
        qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h
        qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h
        qemud/remote_protocol.c qemud/remote_protocol.h
        qemud/remote_protocol.x proxy/Makefile.am python/generator.py:
        Not much is left untouched by the patch adding the events support
      * docs/libvirt-api.xml docs/libvirt-refs.xml
        docs/html/libvirt-libvirt.html: regenerated the docs
      * examples/domain-events/events-c/Makefile.am
        examples/domain-events/events-c/event-test.c: a test example
      * AUTHORS: added Ben Guthro
      daniel
      1509b802
  15. 12 8月, 2008 1 次提交
  16. 25 7月, 2008 1 次提交
  17. 10 6月, 2008 1 次提交
  18. 22 5月, 2008 1 次提交
  19. 08 4月, 2008 1 次提交
  20. 20 2月, 2008 1 次提交
  21. 06 2月, 2008 1 次提交
  22. 30 1月, 2008 1 次提交
    • J
      Given code like if (foo) free (foo); remove the useless "if (foo) " part. · acff2d11
      Jim Meyering 提交于
      Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.
      
      * proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
      * python/generator.py: Likewise.
      * qemud/qemud.c: Likewise.
      * src/buf.c: Likewise.
      * src/conf.c: Likewise.
      * src/hash.c: Likewise.
      * src/iptables.c: Likewise.
      * src/libvirt.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/qemu_conf.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/remote_internal.c: Likewise.
      * src/test.c: Likewise.
      * src/virsh.c: Likewise.
      * src/virterror.c: Likewise.
      * src/xen_internal.c: Likewise.
      * src/xen_unified.c: Likewise.
      * src/xend_internal.c: Likewise.
      * src/xm_internal.c: Likewise.
      * src/xml.c: Likewise.
      * src/xmlrpc.c: Likewise.
      * src/xs_internal.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      acff2d11
  23. 21 1月, 2008 2 次提交
  24. 07 12月, 2007 1 次提交
  25. 01 10月, 2007 1 次提交
  26. 24 7月, 2007 1 次提交
  27. 25 6月, 2007 1 次提交
  28. 29 5月, 2007 1 次提交
  29. 16 4月, 2007 1 次提交
  30. 28 3月, 2007 1 次提交
  31. 16 3月, 2007 1 次提交