1. 05 12月, 2011 3 次提交
    • J
      qemu: Rework handling of shutdown event · 38527c9a
      Jiri Denemark 提交于
      When QEMU guest finishes its shutdown sequence, qemu stops virtual CPUs
      and when started with -no-shutdown waits for us to kill it using
      SGITERM. Since QEMU is flushing its internal buffers, some time may pass
      before QEMU actually dies. We mistakenly used "paused" state (and
      events) for this which is quite confusing since users may see a domain
      going to pause while they expect it to shutdown. Since we already have
      "shutdown" state with "the domain is being shut down" semantics, we
      should use it for this state.
      
      However, the state didn't have a corresponding event so I created one
      and called its detail as VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED (guest OS
      finished its shutdown sequence) with the intent to add
      VIR_DOMAIN_EVENT_SHUTDOWN_STARTED in the future if we have a
      sufficiently capable guest agent that can notify us when guest OS starts
      to shutdown.
      38527c9a
    • G
      remote_driver: don't fail if keepalive check fails · 8fcee135
      Guido Günther 提交于
      Otherwise connections to older libvirt abort with:
      
      $ virsh -c qemu+ssh://host.example.com/system list
      error: invalid connection pointer in virDrvSupportsFeature
      error: failed to connect to the hypervisor
      
      Tested against 0.8.3 and 0.9.8-rc2.
      8fcee135
    • J
      Add support for QEMU 1.0 · dd8e8956
      Jiri Denemark 提交于
      dd8e8956
  2. 04 12月, 2011 3 次提交
    • E
      maint: fix improper use of 'an' · 3a9ce767
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a
      misuse of 'an' where 'a' is proper; that has since been fixed,
      but a search found other problems (some were a spelling error for
      'and', while most were fixed by 'a').
      
      * daemon/stream.c: Fix grammar.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_vi.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * src/rpc/virnetserverprogram.c: Likewise.
      * src/storage/storage_backend_fs.c: Likewise.
      * src/util/conf.c: Likewise.
      * src/util/dnsmasq.c: Likewise.
      * src/util/iptables.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      3a9ce767
    • E
      command: handle empty buffer argument correctly · 2b045d39
      Eric Blake 提交于
      virBufferContentAndReset (intentionally) returns NULL for a buffer
      with no content, but it is feasible to invoke a command with an
      explicit empty string.
      
      * src/util/command.c (virCommandAddEnvBuffer): Reject empty string.
      (virCommandAddArgBuffer): Allow explicit empty argument.
      * tests/commandtest.c (test9): Test it.
      * tests/commanddata/test9.log: Adjust.
      2b045d39
    • E
      build: fix build on Cygwin · c74a2a03
      Eric Blake 提交于
      The RPC fixups needed on Linux are also needed on cygwin, and
      worked without further tweaking to the list of fixups.  Also,
      unlike BSD, Cygwin exports 'struct ifreq', but unlike Linux,
      Cygwin lacks the ioctls that we were using 'struct ifreq' to
      access.  This patch allows compilation under cygwin.
      
      * src/rpc/genprotocol.pl: Also perform fixups on cygwin.
      * src/util/virnetdev.c (HAVE_STRUCT_IFREQ): Also require AF_PACKET
      definition.
      * src/util/virnetdevbridge.c (virNetDevSetupControlFull): Only
      compile if SIOCBRADDBR works.
      c74a2a03
  3. 03 12月, 2011 1 次提交
    • S
      apparmor: allow tunnelled migrations. · 4cfdbfc4
      Serge Hallyn 提交于
      The pathname for the pipe for tunnelled migration is unresolvable.  The
      libvirt apparmor driver therefore refuses access, causing migration to
      fail.  If we can't resolve the path, the worst that can happen is that
      we should have given permission to the file but didn't.  Otherwise
      (especially since this is a /proc/$$/fd/N file) the file is already open
      and libvirt won't be refused access by apparmor anyway.
      
      Also adjust virt-aa-helper to allow access to the
      *.tunnelmigrate.dest.name files.
      
      For more information, see https://launchpad.net/bugs/869553.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      4cfdbfc4
  4. 02 12月, 2011 4 次提交
    • P
      client: Check if other thread claims it has the buck before claiming it. · fd066925
      Peter Krempa 提交于
      Originaly, the code checked if another client is the queue and infered
      ownership of the buck from that. Commit fa959500
      added a separate variable to track the buck. That caused, that a new
      call might enter claiming it has the buck, while another thread was
      signalled to take the buck. This ends in two threads claiming they hold
      the buck and entering poll(). This happens due to a race on waking up
      threads on the client lock mutex.
      
      This caused multi-threaded clients to hang, most prominently visible and
      reproducible on python based clients, like virt-manager.
      
      This patch causes threads, that have been signalled to take the buck to
      re-check if buck is held by another thread.
      fd066925
    • E
      maint: typo fixes · a6997934
      Eric Blake 提交于
      Many of these were mentioned by Yuri Chornoivan in:
      https://bugzilla.redhat.com/show_bug.cgi?id=669506
      
      * src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
      * src/conf/netdev_vport_profile_conf.c
      (virNetDevVPortProfileParse): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
      * src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemBuild): Likewise.
      * daemon/libvirtd.conf: Likewise.
      * src/util/logging.c (virLogMessage): Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
      * src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
      a6997934
    • 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
  5. 01 12月, 2011 16 次提交
  6. 30 11月, 2011 13 次提交
    • 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