1. 19 1月, 2011 3 次提交
  2. 15 1月, 2011 1 次提交
    • E
      datatypes: avoid redundant __FUNCTION__ · d9b04947
      Eric Blake 提交于
      virLibConnError already includes __FUNCTION__ in its output, so we
      were redundant.  Furthermore, clang warns that __FUNCTION__ is not
      a string literal (at least __FUNCTION__ will never contain %, so
      it was not a security risk).
      
      * src/datatypes.c: Replace __FUNCTION__ with a descriptive string.
      d9b04947
  3. 25 11月, 2010 1 次提交
    • M
      Always close drivers when a virConnectPtr is released · d8b36749
      Matthias Bolte 提交于
      virConnectClose calls virUnrefConnect which in turn closes
      all open drivers when the refcount of that connection dropped
      to zero. This works fine when you free all other objects that
      hold a ref to the connection before you close it, because in
      this case virUnrefConnect is the one that removes the last
      ref to the connection.
      
      But it doesn't work when you close the connection first before
      freeing the other objects. This is because the other virUnref*
      functions call virReleaseConnect when they detect that the
      connection's refcount dropped to zero. In this case another
      virUnref* function (different from virUnrefConnect) removes the
      last ref to the connection. This results in not closing the
      open drivers and leaking things that should have been cleaned
      up in the driver close functions.
      
      To fix this move the driver close calls to virReleaseConnect.
      d8b36749
  4. 21 6月, 2010 4 次提交
    • J
      Misc cleanups · d147b18d
      Jiri Denemark 提交于
      - Fix documentation for virGetStorageVol: it has 'key' argument instead
        of 'uuid'.
      - Remove TODO comment from virReleaseStorageVol: we use volume key as an
        identifier instead of UUID.
      - Print human-readable UUID string in debug message in virReleaseSecret.
      d147b18d
    • J
      Do not free static buffer with UUID · 72a7f8b2
      Jiri Denemark 提交于
      As anywhere else, uuid is defined as a fixed size array inside
      _virSecret structure; we shouldn't try to free it.
      72a7f8b2
    • J
      Remove unnecessary check for non-NULL uuid · c5ec45a3
      Jiri Denemark 提交于
      The first thing we do in all these functions is to check uuid != NULL
      and fail if it isn't.
      c5ec45a3
    • J
      Index hashes by UUID instead of name · 30ec755e
      Jiri Denemark 提交于
      Per-connection hashes for domains, networks, storage pools and network
      filter pools were indexed by names which was not the best choice. UUIDs
      are better identifiers, so lets use them.
      30ec755e
  5. 13 5月, 2010 1 次提交
  6. 18 4月, 2010 1 次提交
  7. 06 4月, 2010 1 次提交
  8. 05 4月, 2010 1 次提交
  9. 27 3月, 2010 1 次提交
  10. 08 3月, 2010 1 次提交
    • E
      build: consistently use C99 varargs macros · 2e56fb2b
      Eric Blake 提交于
      Prior to this patch, there was an inconsistent mix between GNU and C99.
      
      For consistency, and potential portability to other compilers, stick
      with the C99 vararg macro syntax.
      
      * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/conf/domain_conf.c (virDomainReportError): Likewise.
      * src/conf/domain_event.c (eventReportError): Likewise.
      * src/conf/interface_conf.c (virInterfaceReportError): Likewise.
      * src/conf/network_conf.c (virNetworkReportError): Likewise.
      * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
      * src/conf/secret_conf.h (virSecretReportError): Likewise.
      * src/conf/storage_conf.h (virStorageReportError): Likewise.
      * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
        GNU vararg macro syntax.
      * src/esx/esx_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_util.c (ESX_ERROR): Likewise.
      * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vmx.c (ESX_ERROR): Likewise.
      * src/util/hostusb.c (usbReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/util/json.c (virJSONError): Likewise.
      * src/util/macvtap.c (ReportError): Likewise.
      * src/util/pci.c (pciReportError): Likewise.
      * src/util/stats_linux.c (virStatsError): Likewise.
      * src/util/util.c (virUtilError): Likewise.
      * src/util/xml.c (virXMLError): Likewise.
      * src/xen/proxy_internal.c (virProxyError): Use C99 rather than
        GNU vararg macro syntax.
      * src/xen/sexpr.c (virSexprError): Likewise.
      * src/xen/xen_driver.c (xenUnifiedError): Likewise.
      * src/xen/xen_hypervisor.c (virXenError): Likewise.
      * src/xen/xen_inotify.c (virXenInotifyError): Likewise.
      * src/xen/xend_internal.c (virXendError): Likewise.
      * src/xen/xm_internal.c (xenXMError): Likewise.
      * src/xen/xs_internal.c (virXenStoreError): Likewise.
      * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/datatypes.c (virLibConnError): Likewise.
      * src/interface/netcf_driver.c (interfaceReportError): Likewise.
      * src/libvirt.c (virLibStreamError): Likewise.
      * src/lxc/lxc_conf.h (lxcError): Likewise.
      * src/network/bridge_driver.c (networkReportError): Likewise.
      * src/nodeinfo.c (nodeReportError): Likewise.
      * src/opennebula/one_conf.h (oneError): Likewise.
      * src/openvz/openvz_conf.h (openvzError): Likewise.
      * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
      * src/qemu/qemu_conf.h (qemuReportError): Likewise.
      * src/remote/remote_driver.c (errorf): Likewise.
      * src/security/security_driver.h (virSecurityReportError): Likewise.
      * src/test/test_driver.c (testError): Likewise.
      * src/uml/uml_conf.h (umlReportError): Likewise.
      * src/vbox/vbox_driver.c (vboxError): Likewise.
      * src/vbox/vbox_tmpl.c (vboxError): Likewise.
      2e56fb2b
  11. 09 2月, 2010 1 次提交
  12. 03 11月, 2009 1 次提交
    • L
      Allow NULL mac address in virGetInterface · 4728bad4
      Laine Stump 提交于
      There are places where an interface will not have a mac address, and netcf
      returns this as a NULL pointer rather than a pointer to an empty string.
      Rather than checking for this all over the place in libvirt, just save it
      in the virInterface object as an empty string.
      
      * src/datatypes.c: allow NULL mac in virGetInterface()
      4728bad4
  13. 27 10月, 2009 1 次提交
  14. 08 10月, 2009 1 次提交
    • D
      Misc win32 build fixes · 7b1fe89a
      Daniel P. Berrange 提交于
      * daemon/Makefile.am: Fix missing sasl rule
      * src/datatypes.c: Add unistd.h to avoid gnulib bug
      * src/util/cgroup.c: Disable mntent if not available
      7b1fe89a
  15. 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
  16. 23 9月, 2009 1 次提交
    • C
      Introduce virStrncpy. · 03d777f3
      Chris Lalancette 提交于
      Add the virStrncpy function, which takes a dst string, source string,
      the number of bytes to copy and the number of bytes available in the
      dest string.  If the source string is too large to fit into the
      destination string, including the \0 byte, then no data is copied and
      the function returns NULL.  Otherwise, this function copies n bytes
      from source into dst, including the \0, and returns a pointer to the
      dst string.  This function is intended to replace all unsafe uses
      of strncpy in the code base, since strncpy does *not* guarantee that
      the buffer terminates with a \0.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      03d777f3
  17. 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
  18. 02 9月, 2009 1 次提交
    • M
      Secret manipulation internal API · eb42e0ab
      Miloslav Trmač 提交于
      * include/libvirt/virterror.h, src/virterror.c: Add VIR_WAR_NO_SECRET
      * src/libvirt_private.syms, src/datatypes.h, src/datatypes.c: Type
        virSecret struct definition and helper APIs
      * src/driver.h: Sub-driver API definitions for secrets
      * src/libvirt.c: Define new sub-driver for secrets
      eb42e0ab
  19. 18 8月, 2009 1 次提交
    • C
      Fix up connection reference counting. · cb51aa48
      Chris Lalancette 提交于
      Currently the reference counting for connections is busted.  I
      first noticed it while trying to use virConnectRef; it would
      eventually cause a crash in the remote_internal driver, although
      that was really just a victim.  Really, we should only call the
      close callbacks on the methods when the references drop to 0.  To
      accomplish this, move all of the close callbacks into
      virUnrefConnect (since there are lots of internal users of that
      function), and arrange for virConnectClose to call that.
      
      V2: Make sure to drop the connection lock before we call the close
          callbacks, otherwise we could deadlock the daemon
      V3: Fix up a crash when we got an error from one of the drivers
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      cb51aa48
  20. 24 7月, 2009 1 次提交
  21. 23 7月, 2009 1 次提交
  22. 22 7月, 2009 2 次提交
  23. 21 7月, 2009 1 次提交
    • L
      virGetinterface matching of MAC and interface name · 9734c81f
      Laine Stump 提交于
      MAC address of a particular interface may change over time, and the
      reduced virInterface object (which contains just name and mac) needs
      to reflect these changes. Since we can't modify the mac address of an
      existing virInterface (some other thread may currently be using it) we
      just create a new virInterface, and let the old one die a dignified
      death when its refct goes to 0.
      * src/datatypes.c: fix the matching and lifetime of virInterface object
        accordingly
      9734c81f
  24. 29 5月, 2009 1 次提交
  25. 20 5月, 2009 1 次提交
    • D
      Add the Interface config APIs · 73bc0114
      Daniel Veillard 提交于
      * configure.in include/libvirt/libvirt.h[.in]
        include/libvirt/virterror.h qemud/remote.c
        qemud/remote_dispatch_args.h qemud/remote_dispatch_prototypes.h
        qemud/remote_dispatch_ret.h qemud/remote_dispatch_table.h
        qemud/remote_protocol.[chx] src/Makefile.am src/datatypes.c
        src/datatypes.h src/driver.h src/libvirt.c src/remote_internal.c
        src/virterror.c src/libvirt_private.syms src/libvirt_public.syms:
        Add the Interface config APIs and remote stubs for those, patch
        by Laine Stump
      * AUTHORS: add Laine
      daniel
      73bc0114
  26. 11 5月, 2009 1 次提交
  27. 01 4月, 2009 1 次提交
  28. 29 1月, 2009 1 次提交
    • J
      error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead · bc18a91f
      Jim Meyering 提交于
      * src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
      * src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
      * src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
      * src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
      * src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
      * src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
      * src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
      * src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
      * src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
      * src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
      * src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
      Note: this loses config_filename:config_lineno diagnostics,
      but that's ok.
      * src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
      * src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
      * po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
      bc18a91f
  29. 20 1月, 2009 1 次提交
  30. 16 1月, 2009 1 次提交
  31. 05 12月, 2008 1 次提交
  32. 21 11月, 2008 1 次提交
  33. 17 11月, 2008 1 次提交