1. 01 2月, 2010 1 次提交
  2. 27 1月, 2010 1 次提交
  3. 12 1月, 2010 2 次提交
    • C
      libvirt.c: Preserve MigratePerform failure · e85065b8
      Cole Robinson 提交于
      e85065b8
    • D
      Ensure error handling callback functions are called from safe context · 3a80f2f7
      Daniel P. Berrange 提交于
      The virRaiseErrorFull() may invoke the error handler callback
      functions an application has registered. This is not good
      because the connection object may not be available at this
      point, and the caller may be holding locks. This creates a
      problem if the error handler calls back into libvirt.
      
      The solutuon is to move invocation of the handler into the
      final cleanup code in the public API entry points, where it
      is guarenteed to have safe state.
      
      * src/libvirt.c: Invoke virDispatchError() in all error paths
      * src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
        replacing with virDispatchError(). Move invocation of the
        error callbacks into virDispatchError() instead of the
        virRaiseErrorFull function which is not in a safe context
      3a80f2f7
  4. 20 12月, 2009 1 次提交
  5. 19 12月, 2009 1 次提交
    • M
      Fix compilation with gcrypt < 1.4.2 · 1c5c6333
      Matthias Bolte 提交于
      Commit 33a198c1 increased the gcrypt
      version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
      define was added in this version.
      
      The configure script doesn't check for the gcrypt version. To support
      gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
      to use GCRY_THREAD_OPTION_VERSION only if it's defined.
      1c5c6333
  6. 18 12月, 2009 2 次提交
    • J
      Public API implementation · 0b7d2ae6
      Jiri Denemark 提交于
      * src/libvirt.c: adds the public entry point virConnectCompareCPU()
      0b7d2ae6
    • D
      Initialize gcrypt threading · 33a198c1
      Daniel P. Berrange 提交于
      GNUTLS uses gcrypt for its crypto functions. gcrypt requires
      that the app/library initializes threading before using it.
      We don't want to force apps using libvirt to know about
      gcrypt, so we make virInitialize init threading on their
      behalf. This location also ensures libvirtd has initialized
      it correctly. This initialization is required even if libvirt
      itself were only using one thread, since another non-libvirt
      library (eg GTK-VNC) could also be using gcrypt from another
      thread
      
      * src/libvirt.c: Register thread functions for gcrypt
      * configure.in: Add -lgcrypt to linker flags
      33a198c1
  7. 16 12月, 2009 1 次提交
  8. 11 12月, 2009 2 次提交
    • P
      retrieve paused/running state at migration start · 5de41c06
      Paolo Bonzini 提交于
      This patch fixes the bug where paused/running state is not
      transmitted during migration.  As a result, in the QEMU driver
      for example the machine was always started on the destination
      end.
      
      In order to do so, just read the state and if it is appropriate and
      set the VIR_MIGRATE_PAUSED flag.
      
      * src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
        Automatically add VIR_MIGRATE_PAUSED when appropriate.
      * src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
        error message when migration of paused domains is attempted.
      5de41c06
    • P
      add virsh --suspend arg to migrate command · edc9e78b
      Paolo Bonzini 提交于
      This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
      the migrated VM before starting it.
      
      * include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
      * src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
      * tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
      * tools/virsh.pod (migrate): Document it.
      edc9e78b
  9. 12 11月, 2009 1 次提交
    • C
      Add virConnectGetLibvirtVersion API · ce4c0bf5
      Cole Robinson 提交于
      There is currently no way to determine the libvirt version of a remote
      libvirtd we are connected to. This is a useful piece of data to enable
      feature detection.
      ce4c0bf5
  10. 11 11月, 2009 2 次提交
    • D
      New APIs for checking some object properties · c04498b3
      Daniel P. Berrange 提交于
      Introduce a number of new APIs to  expose some boolean properties
      of objects, which cannot otherwise reliably determined, nor are
      aspects of the XML configuration.
      
       * virDomainIsActive: Checking virDomainGetID is not reliable
         since it is not possible to distinguish between error condition
         and inactive domain for ID of -1.
       * virDomainIsPersistent: Check whether a persistent config exists
         for the domain
      
       * virNetworkIsActive: Check whether the network is active
       * virNetworkIsPersistent: Check whether a persistent config exists
         for the network
      
       * virStoragePoolIsActive: Check whether the storage pool is active
       * virStoragePoolIsPersistent: Check whether a persistent config exists
         for the storage pool
      
       * virInterfaceIsActive: Check whether the host interface is active
      
       * virConnectIsSecure: whether the communication channel to the
         hypervisor is secure
       * virConnectIsEncrypted: whether any network based commnunication
         channels are encrypted
      
      NB, a channel can be secure, even if not encrypted, eg if it does
      not involve the network, like a UNIX socket, or pipe.
      
       * include/libvirt/libvirt.h.in: Define public API
       * src/driver.h: Define internal driver API
       * src/libvirt.c: Implement public API entry point
       * src/libvirt_public.syms: Export API symbols
       * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
         src/interface/netcf_driver.c, src/network/bridge_driver.c,
         src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
         src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
         src/remote/remote_driver.c, src/test/test_driver.c,
         src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
         src/xen/xen_driver.c: Stub out driver tables
      c04498b3
    • D
      Various fixes following a code review · 52147a04
      Daniel Veillard 提交于
      * src/libvirt.c src/lxc/lxc_conf.c src/lxc/lxc_container.c
        src/lxc/lxc_controller.c src/node_device/node_device_hal.c
        src/openvz/openvz_conf.c src/qemu/qemu_driver.c
        src/qemu/qemu_monitor_text.c src/remote/remote_driver.c
        src/storage/storage_backend_disk.c src/storage/storage_driver.c
        src/util/logging.c src/xen/sexpr.c src/xen/xend_internal.c
        src/xen/xm_internal.c: Steve Grubb <sgrubb@redhat.com> sent a code
        review and those are the fixes correcting the problems
      52147a04
  11. 04 11月, 2009 1 次提交
    • L
      Support reporting live interface IP/netmask · 753c6c9c
      Laine Stump 提交于
      This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
      virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
      live interface info will be returned in the XML (in particular, the IP
      address(es) and netmask(s) will be retrieved by querying the interface
      directly, rather than  reporting what's in the config file). The
      backend of this is in netcf's ncf_if_xml_state() function.
      
      * configure.in libvirt.spec.in: requires netcf >= 0.1.3
      * include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
      * src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
        update the parsing and backend routines accordingly
      * tools/virsh.c: change interface edit to inactive definition and
        adds the inactive flag for interface dump
      753c6c9c
  12. 03 11月, 2009 1 次提交
    • D
      Fix return value in virStateInitialize impl for LXC · 979218cd
      Daniel P. Berrange 提交于
      The LXC driver was mistakenly returning -1 for lxcStartup()
      in scenarios that are not an error. This caused the libvirtd
      to quit for unprivileged users. This fixes the return code
      of LXC driver, and also adds a "name" field to the virStateDriver
      struct and logging to make it easier to find these problems
      in the future
      
      * src/driver.h: Add a 'name' field to state driver to allow
        easy identification during failures
      * src/libvirt.c: Log name of failed driver for virStateInit
        failures
      * src/lxc/lxc_driver.c: Don't return a failure code for
        lxcStartup() if LXC is not available on this host, simply
        disable the driver.
      * src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
        src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/secret/secret_driver.c, src/storage/storage_driver.c,
        src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
        field in virStateDriver struct
      979218cd
  13. 28 10月, 2009 2 次提交
  14. 27 10月, 2009 1 次提交
  15. 26 10月, 2009 1 次提交
  16. 19 10月, 2009 1 次提交
  17. 14 10月, 2009 1 次提交
    • C
      Finer grained migration control · 2d8d9b10
      Chris Lalancette 提交于
      Normally, when you migrate a domain from host A to host B,
      the domain on host A remains defined but shutoff and the domain
      on host B remains running but is a "transient".  Add a new
      flag to virDomainMigrate() to allow the original domain to be
      undefined on source host A, and a new flag to virDomainMigrate() to
      allow the new domain to be persisted on the destination host B.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d8d9b10
  18. 09 10月, 2009 3 次提交
    • D
      Support a new peer-to-peer migration mode & public API · fae0da5c
      Daniel P. Berrange 提交于
      Introduces several new public API options for migration
      
       - VIR_MIGRATE_PEER2PEER: With this flag the client only
         invokes the virDomainMigratePerform method, expecting
         the source host driver to do whatever is required to
         complete the entire migration process.
       - VIR_MIGRATE_TUNNELLED: With this flag the actual data
         for migration will be tunnelled over the libvirtd RPC
         channel. This requires that VIR_MIGRATE_PEER2PEER is
         also set.
       - virDomainMigrateToURI: This is variant of the existing
         virDomainMigrate method which does not require any
         virConnectPtr for the destination host. Given suitable
         driver support, this allows for all the same modes as
         virDomainMigrate()
      
      The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
      URI. For non-p2p migration a hypervisor specific migration
      URI is used.
      
      virDomainMigrateToURI without a PEER2PEER flag is only
      support for Xen currently, and it involves XenD talking
      directly to XenD, no libvirtd involved at all.
      
      * include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
        flag for migration
      * src/libvirt_internal.h: Add feature flags for peer to
        peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
        migration (VIR_MIGRATE_PEER2PEER mode)
      * src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
        and virDomainMigrateToURI APIs.
      * src/xen/xen_driver.c: Advertise support for DIRECT migration
      * src/xen/xend_internal.c: Add TODO item for p2p migration
      * src/libvirt_public.syms: Export virDomainMigrateToURI
        method
      * src/qemu/qemu_driver.c: Add support for PEER2PEER and
        migration, and adapt TUNNELLED migration.
      * tools/virsh.c: Add --p2p and --direct args and use the
        new virDomainMigrateToURI method where possible.
      fae0da5c
    • D
      Don't force dconn to be NULL in virDomainMigrate · 543e013a
      Daniel P. Berrange 提交于
      The code for tunnelled migration wierdly required the app to pass
      a  NULL 'dconn' parameter, only to have to use virConnectOpen
      itself shortly thereafter to get a 'dconn' object. Remove this
      bogus check & require the app to always pas 'dconn' as before
      
      * src/libvirt.c: Require 'dconn' for virDomainMigrate calls again
        and remove call to virConnectOpen
      543e013a
    • D
      Remove unneccessary uri_in parameter from virMigratePrepareTunnel · f6c66d01
      Daniel P. Berrange 提交于
      Since virMigratePrepareTunnel() is used for migration over the
      native libvirt connection, there is never any need to pass the
      target URI to this method.
      
      * daemon/remote.c, src/driver.h, src/libvirt.c, src/libvirt_internal.h,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/remote/remote_protocol.c, src/remote/remote_protocol.h,
        src/remote/remote_protocol.x: Remove 'uri_in' parameter from
        virMigratePrepareTunnel() method
      f6c66d01
  19. 02 10月, 2009 1 次提交
  20. 01 10月, 2009 1 次提交
    • P
      Fix documentation and comment typos · 36e03729
      Paolo Bonzini 提交于
      Fix a few mispellings :-) of "successfully" and regenerate
      docs/libvirt-*.xml.
      * src/libvirt.c: Fix typos.
      * src/secret/secret_driver.c: Fix typos.
      * docs/libvirt-api.xml: Regenerate.
      * docs/libvirt-refs.xml: Regenerate.
      36e03729
  21. 30 9月, 2009 2 次提交
  22. 29 9月, 2009 2 次提交
    • D
      Remove hand-crafted UUID parsers · d9b285d7
      Daniel P. Berrange 提交于
      * src/libvirt.c: Remove hand-crafted UUID parsers in favour of
        calling virParseUUID
      d9b285d7
    • 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
  23. 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
  24. 22 9月, 2009 1 次提交
  25. 21 9月, 2009 4 次提交
    • D
      Move remote driver to src/remote/ · 8c69a838
      Daniel P. Berrange 提交于
      * daemon/mdns.c: Remove bogus include
      * daemon/qemud.c, src/Makefile.am, src/libvirt.c: Adapt for
        changed paths
      * src/remote_internal.c: Rename to src/remote/remote_driver.c
      * src/remote_internal.h: Rename to src/remote/remote_driver.h
      8c69a838
    • D
      Move test driver into src/test/ · 0b648155
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/libvirt.c: Adjust for changed paths
      * src/test.c: Rename to src/test/test_driver.c,
      * src/test.h: Rename to src/test/test_driver.h
      0b648155
    • D
      Move OpenVZ driver to src/openvz/ · 229c5c9b
      Daniel P. Berrange 提交于
      * src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
        src/openvz_driver.h: Move to src/openvz/
      * src/Makefile.am, src/libvirt.c: Adjust for changed paths
      229c5c9b
    • D
      Move xen driver code into src/xen/ directory · f7a107f7
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/proxy_internal.c, src/proxy_internal.h
        src/sexpr.c, src/sexpr.h, src/xen_unified.c, src/xen_unified.h,
        src/xen_internal.c, src/xen_internal.h, src/xen_inotify.c,
        src/xen_inotify.h, src/xend_internal.c, src/xend_internal.h,
        src/xm_internal.c, src/xm_internal.h, src/xs_internal.c,
        src/xs_internal.h: Move to src/xen/ directory
      * proxy/Makefile.am, proxy/libvirt_proxy.c, src/Makefile.am,
        src/libvirt.c, tests/sexpr2xmltest.c, tests/statstest.c,
        tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
        Adapt to changed xen location
      * src/stats_linux.h, src/stats_linux.c: Remove xen specific block
        stats APIs
      * src/qemu_driver.c, src/uml_driver.c: Add missing sys/un.h include
        uncovered after change to stats_linux.h
      * src/xen/block_stats.h, src/xen/block_stats.c: Add xen specific
        block stats APIs
      f7a107f7
  26. 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
  27. 10 9月, 2009 1 次提交
    • M
      Mask out flags used internally for virSecretGetValue · ecc5c829
      Miloslav Trmač 提交于
      Add a VIR_SECRET_GET_VALUE_INTERNAL_CALL flag value, replacing the
      originally separate libvirt_internal_call parameter.  The flag is used
      to differentiate external virSecretGetValue() calls from internal calls
      by libvirt drivers that need to use the secret even if it is private.
      
      * src/libvirt_internal.h Remove VIR_DOMAIN_XML_FLAGS_MASK
      * src/driver.h Add VIR_SECRET_GET_VALUE_FLAGS_MASK constant and
        VIR_SECRET_GET_VALUE_INTERNAL_CALL. Re-add the
        VIR_DOMAIN_XML_FLAGS_MASK constant
      * src/libvirt.c (virSecretGetValue): Don't allow the user to specify
        internal flags.
      ecc5c829