1. 07 5月, 2010 2 次提交
    • E
      build: use gnulib's uname · 5349cf1e
      Eric Blake 提交于
      * bootstrap.conf (gnulib_modules): Add uname.
      * configure.ac: Drop uname and sys/utsname.h checks.
      * src/nodeinfo.c (nodeGetInfo): Use uname unconditionally.
      5349cf1e
    • E
      build: rely on gnulib's pthread module · 9017b9bc
      Eric Blake 提交于
      Gnulib can guarantee that pthread.h exists, but for now, it is a dummy
      header with no support for most pthread_* functions.  Modify our
      use of pthread to use function checks, rather than header checks,
      to determine how much pthread support is present.
      
      * bootstrap.conf (gnulib_modules): Add pthread.
      * configure.ac: Drop all pthread.h checks.  Optimize function
      checks.  Add check for pthread functions.
      * src/Makefile.am (libvirt_lxc_LDADD): Ensure proper link.
      * src/remote/remote_driver.c (remoteIOEventLoop): Depend on
      pthread_sigmask, now that gnulib guarantees pthread.h.
      * src/util/util.c (virFork): Likewise.
      * src/util/threads.c (threads-pthread.c): Depend on
      pthread_mutexattr_init, as a witness of full pthread support.
      * src/util/threads.h (threads-pthread.h): Likewise.
      9017b9bc
  2. 06 5月, 2010 2 次提交
  3. 05 5月, 2010 3 次提交
    • E
      util: fix va_start usage bug · 62ee19c7
      Eric Blake 提交于
      Detected by clang.  POSIX requires that the second argument to
      va_start be the name of the last variable; and in some implementations,
      passing *path instead of path would dereference bogus memory instead
      of pulling arguments off the stack.
      
      * src/util/util.c (virBuildPathInternal): Use correct argument to
      va_start.
      62ee19c7
    • K
      qemu: live migration with non-shared storage for kvm · b0a3f8b6
      Kenneth Nagin 提交于
      Support for live migration between hosts that do not share storage was
      added to qemu-kvm release 0.12.1.
      It supports two flags:
      -b migration without shared storage with full disk copy
      -i migration without shared storage with incremental copy (same base image
      shared between source and destination).
      
      I tested the live migration without shared storage (both flags) for native
      and p2p with and without tunnelling.  I also verified that the fix doesn't
      affect normal migration with shared storage.
      b0a3f8b6
    • M
      configure.ac: Avoid uname, which breaks cross-compilation · 9537c3d0
      Matthias Bolte 提交于
      When cross-compiling on Linux, configure will misdetect the target as
      Linux because it uses uname instead of relying on the $host variable.
      This results in including libvirt_linux.syms into libvirt.syms and
      therefore trying to export undefined symbols.
      
      Replace uname checks with $host checks to fix this.
      9537c3d0
  4. 04 5月, 2010 15 次提交
    • J
      Don't wipe generated iface target in active domains · 362bc09a
      Jiri Denemark 提交于
      Wipe generated interface target only when reading configuration of
      inactive domains.
      362bc09a
    • D
      Various fixes for the spec file · 7efa3937
      Daniel Veillard 提交于
      This includes various things:
       - fix the Requires: libvirt-client to use %{name} to allow easy
         renaming
       - when building ESX support one need libcurl-devel
       - remove Makefile[.in] from xml/nwfilter in the docs, as this breaks
         parallel install ation of i686 and x86_64 packages
       - don't include nwfilter config files if not building with the daemon
      all relatively trivial which is why I packed them together
      * libvirt.spec.in: fix various small bugs
      7efa3937
    • J
      docs: hacking: explain why using curly braces well is important · 44258473
      Jim Meyering 提交于
      * docs/hacking.html.in: Use the "curly braces" section from coreutils'
      HACKING, adapting for libvirt's different formatting style.
      * HACKING: Sync from the above, still mostly manually.
      44258473
    • J
      lxc: Check domain is active/inactive as required by operation · eca81e08
      Jiri Denemark 提交于
      Report VIR_ERR_OPERATION_INVALID when operation which requires running
      domain is called on inactive domain and vice versa.
      eca81e08
    • J
      lxc: Make SetMemory work for active domains only · b94b72b4
      Jiri Denemark 提交于
      b94b72b4
    • J
      lxc: Use virDomainFindByUUID for domain lookup · e1fa3fb0
      Jiri Denemark 提交于
      Consistently use virDomainFindByUUID instead of virDomainFindByID and
      virDomainFindByName and report VIR_ERR_NO_DOMAIN when domain cannot be
      found.
      e1fa3fb0
    • M
      mingw: Fix two undefined symbols · ee234bfd
      Matthias Bolte 提交于
      Add an empty body for virCondWaitUntil and move virPipeReadUntilEOF
      out of the '#ifndef WIN32' block, because it compiles fine with MinGW
      in combination with gnulib.
      ee234bfd
    • E
      build: avoid compiler warning · 7f31e28c
      Eric Blake 提交于
      Necessary on cygwin, where uid_t and gid_t are 4-byte long rather
      than int, causing gcc -Wformat warnings.
      
      * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork)
      (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and
      gid_t before passing to printf.
      * .gitignore: Ignore Windows executables.
      7f31e28c
    • S
      nwfilter: skip some interfaces on filter update · 018fd697
      Stefan Berger 提交于
      When a filter is updated, only those interfaces must have their old
      rules cleared that either reference the filter directly or indirectly
      through another filter. Remember between the different steps of the
      instantiation of the filters which interfaces must be skipped. I am
      using a hash map to remember the names of the interfaces and store a
      bogus pointer to ~0 into it that need not be freed.
      018fd697
    • S
      pass info where request stems from to have rules applied · 5c77fddf
      Stefan Berger 提交于
      For the decision on whether to instantiate the rules, the check for a
      pending IP address learn request is not sufficient since then only the
      thread could instantiate the rules. So, a boolean needs to be passed
      when the thread instantiates the filter rules late and the IP address
      learn request is still pending in order to override the check for the
      pending learn request. If the rules are to be updated while the thread
      is active, this will not be done immediately but the thread will do that
      later on.
      5c77fddf
    • E
      build: prefer WIN32 over __MINGW32__ checks · 9f87b631
      Eric Blake 提交于
      WIN32 is always defined when __MINGW32__ is defined, but the
      converse is not true.  WIN32 is more generic, if someone were
      to ever attempt porting to a microsoft compiler.  This does
      not affect Cygwin, which intentionally does not define WIN32.
      
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Use more
      generic flag macro.
      * src/storage/storage_backend.c
      (virStorageBackendUpdateVolTargetInfoFD)
      (virStorageBackendRunProgRegex): Likewise.
      * tools/console.h (vshRunConsole): Likewise.
      9f87b631
    • R
      cgroup: Fix possible memory leak in virCgroupMakeGroup · c4157e52
      Ryota Ozaki 提交于
      * src/util/cgroup.c: free temporal path string before breaking loop
      c4157e52
    • E
      dnsmasqReload: avoid mingw link failure · b9c4db0d
      Eric Blake 提交于
      * src/util/dnsmasq.c (dnsmasqReload): Mingw lacks kill, but is not
      running a dnsmasq daemon either.
      b9c4db0d
    • M
      mingw: Fix symbol export · 38eb50ae
      Matthias Bolte 提交于
      In commit 98fb83ce I changed the
      version script handling. But it seems that I didn't test this properly
      and broke it. The .def file is passed to the compiler directly, but it
      should get passed to the linker instead.
      
      Set VERSION_SCRIPT_FLAGS to -Wl, to pass the .def file correctly to
      the linker.
      
      This fixes the undefined symbol errors while linking virsh.
      38eb50ae
    • M
      dnsmasq.c: Fix OOM error reporting · 254ade37
      Matthias Bolte 提交于
      Also do some indentation clean up.
      254ade37
  5. 03 5月, 2010 2 次提交
    • L
      Fix memory leaks in cmdInterfaceEdit and cmdNWFilterEdit. · 2b50cae5
      Laine Stump 提交于
      This applies a fix to thos functions similar to that made to cmdEdit
      in 27089506, thus fnixing a memory
      leak - if tmp is unlinked and NULLed early in the function, the memory
      used by tmp is never freed. Since we will always unlink tmp prior to
      freeing its memory at the end of the function, just remove the earlier
      code and let cleanup: do the cleanup.
      2b50cae5
    • R
      lxc: Fix failure on starting a domain with multiple interfaces · d2ac3c2f
      Ryota Ozaki 提交于
      [Error message]
      error: Failed to start domain lxc_test1
      error: internal error Failed to create veth device pair: 512
      
      The reason of the failure is that lxc driver unexpectedly re-uses
      an auto-assigned veth name and tries to create the created veth
      again. The failure will happen when a domain has multiple network
      interfaces and the names of those are not specified in XML.
      
      The patch fixes the problem by resetting buffers of veth names
      in every iteration of creating veth.
      
      * src/lxc/lxc_driver.c: prevent re-using auto-assigned veth name
        Reported by Kumar L Srikanth-B22348.
      d2ac3c2f
  6. 01 5月, 2010 3 次提交
    • E
      autobuild.sh: provide default prefix · 94f71441
      Eric Blake 提交于
      Without this patch and with a clean environment, ./autobuild.sh
      tried to use ./configure --prefix=/, and fails.
      
      * autobuild.sh (AUTOBUILD_INSTALL_ROOT): Provide sensible
      default.  Suggested by Daniel P. Berrange.
      94f71441
    • D
      Release of libvirt-0.8.1 · 5d65d32f
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: updates for release
      * po/*.po*: updated localizations and regenerated
      5d65d32f
    • C
      domain: Fix PCI address decimal parsing regression · e9840196
      Cole Robinson 提交于
      <hostdev> address parsing previously attempted to detect the number
      base: currently it is hardcoded to base 16, which can break PCI
      assignment via virt-manager. Revert to the previous behavior.
      
      * src/conf/domain_conf.c: virDomainDevicePCIAddressParseXML, switch to
        virStrToLong_ui(bus, NULL, 0, ...) to autodetect base
      e9840196
  7. 30 4月, 2010 13 次提交
    • D
      Add support for another explicit IO error event · 34dcbbb4
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
      
      This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
      event, but also includes a string describing the cause of
      the event.
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
                                                                 virDomainPtr dom,
                                                                 const char *srcPath,
                                                                 const char *devAlias,
                                                                 int action,
                                                                 const char *reason,
                                                                 void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      34dcbbb4
    • J
      c90a1ad7
    • S
      Prevent updates while IP address learn thread is running · 5054e892
      Stefan Berger 提交于
      Prevent updating and tearing down of filter while the IP
      address learning thread is running and has its own filtering
      rules applied.
      5054e892
    • S
      Syncronize the teardown of rules with the thread · ebacb31f
      Stefan Berger 提交于
      Introduce a function to notify the IP address learning
      thread to terminate and thus release the lock on the interface.
      Notify the thread before grabbing the lock on the interface
      and tearing down the rules. This prevents a 'virsh destroy' to
      tear down the rules that the IP address learning thread has
      applied.
      ebacb31f
    • S
      Clean all tables before applying 'basic' rules · 59fe163f
      Stefan Berger 提交于
      The functions invoked by the IP address learning thread
      that apply some basic filtering rules did not clean up
      any previous filtering rules that may still be there
      (due to a libvirt restart for example). With the
      patch below all the rules are cleaned up first.
      
      Also, I am introducing a function to drop all traffic
      in case the IP address learning thread could not apply
      the rules.
      59fe163f
    • D
      MAke virFileHasSuffix case insensitive · b9efc7dc
      Daniel Veillard 提交于
      * src/util/util.c: as it's used for checking things like .iso suffixes
      b9efc7dc
    • S
      nwfilter: Also pick IP address from a DHCP ACK message · 7c66c033
      Stefan Berger 提交于
      The local DHCP server on virtbr0 sends DHCP ACK messages when a VM is
      started and requests an IP address while the initial DHCP lease on the
      VM's MAC address hasn't expired. So, also pick the IP address of the VM
      if that type of message is seen.
      Thanks to Gerhard Stenzel for providing a test case for this.
      
      Changes from V1 to V2:
      - cleanup: replacing DHCP option numbers through constants
      7c66c033
    • D
      Fix virt-pki-validate's determination of CN · c179a0f6
      Dustin Kirkland 提交于
      Ubuntu's gntls package generates an Issuer line that looks like this:
              Issuer: C=US,ST=NY,L=Rochester,O=example.com,CN=example.com CA,EMAIL=hostmaster@example.com
      
      While Red Hat's looks like this
      Issuer: CN=Red Hat Emerging Technologies
      
      Note the leading whitespace, and the additional fields in the former.
      
      This patch updates the regular expression to:
       * trim leading characters before "Issuer:"
       * trim anything between Issuer: and CN=
       * trim anything after the next ,
      
      I've tested this against the certool output of both RH and Ubuntu
      generated certs.
      Signed-off-by: NDustin Kirkland <kirkland@canonical.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c179a0f6
    • J
      qemudDomainSaveFlag: remove dead store · 5b0aed68
      Jim Meyering 提交于
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Remove dead store to "rc".
      5b0aed68
    • D
      Fix detection of disk in IO events · 0eecdd68
      Daniel P. Berrange 提交于
      When using -device syntax, the IO event will have a different
      prefix, 'drive-' that needs to be skipped over before matching
      against the libvirt disk alias
      
      * src/qemu/qemu_driver.c: Skip QEMU_DRIVE_HOST_PREFIX in IO event
      0eecdd68
    • D
      Implement python binding for virDomainGetBlockInfo · 05776e09
      Daniel P. Berrange 提交于
      This binds the virDomainGetBlockInfo API to python's blockInfo
      method on the domain object
      
      >>> c = libvirt.openReadOnly('qemu:///session')
      >>> d = c.lookupByName('demo')
      >>> f = d.blockInfo("/dev/loop0", 0)
      >>> print f
      [1048576000L, 104857600L, 104857600L]
      
      * python/libvirt-override-api.xml: Define override signature
      * python/generator.py: Skip C impl generator for virDomainGetBlockInfo
      * python/libvirt-override.c: Manual impl of virDomainGetBlockInfo
      05776e09
    • D
      Add new domblkinfo command to virsh · 7703c2c9
      Daniel P. Berrange 提交于
        virsh # domblkinfo demoguest /dev/hda2
        Capacity:       1048576000
        Allocation:     104857600
        Physical:       104857600
      
      * tools/virsh.c: Implement domblkinfo command mapping to the
        new virDomainGetBlockInfo API
      7703c2c9
    • D
      Implement virDomainGetBlockInfo in QEMU driver · db57a7be
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Implementation of virDomainGetBlockInfo
      * src/util/storage_file.h: Add DEV_BSIZE
      * src/storage/storage_backend.c: Remove DEV_BSIZE
      db57a7be