1. 02 12月, 2011 2 次提交
    • D
      Fix build for platforms lacking struct ifreq · 949e1091
      Daniel P. Berrange 提交于
      This ought to fix the build if you have net/if.h but do
      not have struct ifreq
      
      * configure.ac: Check for struct ifreq in net/if.h
      * src/util/virnetdev.c: Conditionalize to avoid use of
        struct ifreq if it does not exist
      949e1091
    • E
      build: fix 'make dist' without dtrace · 55d76a72
      Eric Blake 提交于
      probes.h can only be generated on Linux, and then only with dtrace
      installed.  If it is part of the tarball, then either 'make dist'
      will fail if you don't have that setup, or we would have to start
      keeping probes.h in libvirt.git.  Since we only need it to be
      generated when dtrace is in use, it's better to avoid shipping
      it in the first place, and avoid tracking it in git.
      
      Meanwhile, there is a build dependency - since the RPC code is
      generated, it can be built early; but when dtrace is enabled, we
      must ensure probes.h is built even earlier.  Commit 1afcfbdd tried
      to fix this, but did so in a way that added probes.h into the
      tarball, and broke VPATH as well.  Commit ecbca767 fixed VPATH,
      but didn't fix the more fundamental problem.  This patch solves
      the issue by adding a dependency instead.
      
      Tested with 'make dist' in a clean VPATH builds, for both
      './configure --without-dtrace' and './configure --with-dtrace';
      all configurations were able to correctly build a tarball, and
      the dtrace configuration no longer sticks probes.h in the tarball.
      
      * src/Makefile.am (REMOTE_DRIVER_GENERATED): Don't ship probes.h;
      rather, make it a dependency.
      55d76a72
  2. 01 12月, 2011 23 次提交
  3. 30 11月, 2011 15 次提交
    • D
      Fix leak build config file path · 87e8ff1b
      Daniel P. Berrange 提交于
      * src/libvirt.c: Free user directory path
      87e8ff1b
    • D
      Remove time APIs from src/util/util.h · a8bb75a3
      Daniel P. Berrange 提交于
      The virTimestamp and virTimeMs functions in src/util/util.h
      duplicate functionality from virtime.h, in a non-async signal
      safe manner. Remove them, and convert all code over to the new
      APIs.
      
      * src/util/util.c, src/util/util.h: Delete virTimeMs and virTimestamp
      * src/lxc/lxc_driver.c, src/qemu/qemu_domain.c,
        src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/util/event_poll.c: Convert to use
        virtime APIs
      a8bb75a3
    • D
      Make logging async signal safe wrt time stamp generation · 32d3ec74
      Daniel P. Berrange 提交于
      Use the new virTimeStringNowRaw() API for generating log timestamps
      in an async signal safe manner
      
      * src/util/logging.c: Use virTimeStringNowRaw
      32d3ec74
    • D
      Add internal APIs for dealing with time · 3ec12898
      Daniel P. Berrange 提交于
      The logging APIs need to be able to generate formatted timestamps
      using only async signal safe functions. This rules out using
      gmtime/localtime/malloc/gettimeday(!) and much more.
      
      Introduce a new internal API which is async signal safe.
      
        virTimeMillisNowRaw replacement for gettimeofday. Uses clock_gettime
                            where available, otherwise falls back to the unsafe
                            gettimeofday
      
        virTimeFieldsNowRaw  replacements for gmtime(), convert a timestamp
        virTimeFieldsThenRaw into a broken out set of fields. No localtime()
                             replacement is provided, because converting to
                             local time is not practical with only async signal
                             safe APIs.
      
        virTimeStringNowRaw  replacements for strftime() which print a timestamp
        virTimeStringThenRaw into a string, using a pre-determined format, with
                             a fixed size buffer (VIR_TIME_STRING_BUFLEN)
      
      For each of these there is also a version without the Raw postfix
      which raises a full libvirt error. These versions are not async
      signal safe
      
      * src/Makefile.am, src/util/virtime.c, src/util/virtime.h: New files
      * src/libvirt_private.syms: New APis
      * configure.ac: Check for clock_gettime in -lrt
      * tests/virtimetest.c, tests/Makefile.am: Test new APIs
      3ec12898
    • D
      Remove obsolete virGetPMCapabilities sym from private symbols file · 380110cf
      Daniel P. Berrange 提交于
      Fix the build on Mingw32 by removing the now obsolete
      virGetPMCapabilities symbol from the private exports file
      
      * src/libvirt_private.syms: Remove virGetPMCapabilities
      380110cf
    • D
      Don't mark suspend as active until we know it is running · a82ed6a0
      Daniel P. Berrange 提交于
      If suspend failed for some reason (e.g. too short duration) then
      subsequent attempts to trigger suspend were rejected because we
      had already marked a suspend as being in progress
      
      * src/util/virnodesuspend.c: Don't mark suspend as active
        until we've successfully triggered it
      a82ed6a0
    • D
      Add suspend info to Xen, LXC and UML hypervisor capabilities · 9ae0b834
      Daniel P. Berrange 提交于
      * src/lxc/lxc_conf.c, src/uml/uml_conf.c,
        src/xen/xen_hypervisor.c: Initialize suspend capabilities
      * tests/xencapsdata/*xml: Add empty powermgmt capabilities
      9ae0b834
    • D
      Remove pointless strdup in node suspend code · 8c60bc16
      Daniel P. Berrange 提交于
      The command name for the suspend action does not need to be
      strdup'd. The constant string can be used directly. This
      also means the code can be trivially rearranged to make the
      switch clearer
      
      * src/util/virnodesuspend.c: Remove strdup of cmdString
      8c60bc16
    • D
      Do lazy init of host PM features · 2fc056c1
      Daniel P. Berrange 提交于
      To avoid probing the host power management features on any
      call to virInitialize, only initialize the mutex in
      virNodeSuspendInit. Do lazy load of the supported PM target
      mask when it is actually needed
      
      * src/util/virnodesuspend.c: Lazy init of supported features
      2fc056c1
    • D
      Remove powerMgmt_valid field from capabilities struct · f1f28611
      Daniel P. Berrange 提交于
      If we ensure that virNodeSuspendGetTargetMask always resets
      *bitmask to zero upon failure, there is no need for the
      powerMgmt_valid field.
      
      * src/util/virnodesuspend.c: Ensure *bitmask is zero upon
        failure
      * src/conf/capabilities.c, src/conf/capabilities.h: Remove
        powerMgmt_valid field
      * src/qemu/qemu_capabilities.c: Remove powerMgmt_valid
      f1f28611
    • D
      Add export of node suspend capabilities APIs · f5272027
      Daniel P. Berrange 提交于
      * src/libvirt_private.syms: Export virNodeSuspendSupportsTarget
        and virNodeSuspendGetTargetMask
      f5272027
    • D
      Move suspend capabilities APIs out of util.h into virnodesuspend.c · c92653f4
      Daniel P. Berrange 提交于
      The node suspend capabilities APIs should not have been put into
      util.[ch]. Instead move them into virnodesuspend.[ch]
      
      * src/util/util.c, src/util/util.h: Remove suspend capabilities APIs
      * src/util/virnodesuspend.c, src/util/virnodesuspend.h: Add
        suspend capabilities APIs
      * src/qemu/qemu_capabilities.c: Include virnodesuspend.h
      c92653f4
    • D
      Rename suspend capabilities APIs · 53c2aad8
      Daniel P. Berrange 提交于
      Rename virGetPMCapabilities to virNodeSuspendGetTargetMask and
      virDiscoverHostPMFeature to virNodeSuspendSupportsTarget.
      
      * src/util/util.c, src/util/util.h: Rename APIs
      * src/qemu/qemu_capabilities.c, src/util/virnodesuspend.c: Adjust
        for new names
      53c2aad8
    • D
      Sanitize virDiscoverHostPMFeature to return a boolean · 33386276
      Daniel P. Berrange 提交于
      Since virDiscoverHostPMFeature is just checking one feature,
      there is no reason for it to return a bitmask. Change it to
      return a boolean
      
      * src/util/util.c, src/util/util.h: Make virDiscoverHostPMFeature
        return a boolean
      33386276
    • D
      Move the virHostPMCapability enum helpers into capabilities.c · 6ea25cd9
      Daniel P. Berrange 提交于
      The virHostPMCapability enum helper was declared in util.h
      but implemented in capabilities.c, which is in a completely
      separate library at link time. Move the declaration into the
      capabilities.c file and rename it to match normal conventions
      
      * src/util/util.h: Remove virHostPMCapability enum decl
      * src/conf/capabilities.c: Add virCapsHostPMTarget enum
      6ea25cd9