1. 22 5月, 2010 1 次提交
    • J
      Add simple bitmap operations to utils · 2f32d7af
      Jim Fehlig 提交于
      V2:
        - Move bitmap impl to src/util/bitmap.[ch]
        - Use CHAR_BIT instead of explicit '8'
        - Use size_t instead of unsigned int
        - Fix calculation of bitmap size in virBitmapAlloc
        - Ensure bit is within range of map in the set, clear, and get
          operations
        - Use bool in virBitmapGetBit
        - Add virBitmapFree to free-like funcs in cfg.mk
      
      V3:
        - Check for overflow in virBitmapAlloc
        - Fix copy and paste bug in virBitmapAlloc
        - Use size_t in prototypes
        - Add ATTRIBUTE_NONNULL in prototypes where appropriate
          and remove NULL check from impl
      
      V4:
        - Add ATTRIBUTE_RETURN_CHECK in prototypes where appropriate.
      2f32d7af
  2. 20 5月, 2010 2 次提交
    • E
      docs: distribute more coding convention documentation · 33c721d3
      Eric Blake 提交于
      These files may be useful for anyone making modifications to
      source files in a tarball distribution.
      
      * src/Makefile.am (EXTRA_DIST): Add THREADS.txt.
      * daemon/Makefile.am (EXTRA_DIST): Add THREADING.txt.
      33c721d3
    • J
      tests: the remote_protocol check also accommodates older pdwtags · 10c68162
      Jim Meyering 提交于
      This test was failing on systems using pdwtags from dwarves-1.3.
      Reported by Matthias Bolte.
      Two-pronged fix:
        - use --verbose to work also with dwarves-1.3; adapt regular
          expressions to handle now-varying separators
        - require a minimum number of post-split clauses, in order to
          skip upon any future format change.
          Currently there are 318; if there are 300 or fewer,
          give a warning similar to when pdwtags is missing.
      * src/Makefile.am (remote_protocol-structs): Use pdwtags' --verbose
      option to make 1.3 emit member sizes and offsets.
      Consistently output WARNING messages to stderr.
      10c68162
  3. 18 5月, 2010 1 次提交
    • E
      build: fix cygwin build, correctly this time · b0aaed65
      Eric Blake 提交于
      Fix the cygwin regression introduced in commit 48445ccf, but
      without repeating the fresh build regression of commit
      2d550542.
      
      * src/Makefile.am (libvirt_test_la_LIBADD): Split out subset of
      locally-built libraries...
      (libvirt_test_la_BUILT_LIBADD): ...into new variable.
      (libvirt_test_la_DEPENDENCIES): Depend only on the subset that
      automake would have given us for free if we didn't have to add our
      own extra file.
      b0aaed65
  4. 17 5月, 2010 1 次提交
    • E
      build: fix up some compiler flags · 6e5b5bbc
      Eric Blake 提交于
      Matthias noted that the line:
      virt_aa_helper_LDFLAGS = $(WARN_CFLAGS)
      looks inconsistent, so I did an audit.
      
      Currently, the set of compiler warning flags passed to gcc as $CC are
      equally permitted as the set of linker flags passed to gcc as $LD, so
      there was no problem with that usage.  But if we ever get in a
      situation where $CC and $LD treat particular flags differently, using
      the right variable form will make it easier.
      
      In the process, I spotted a couple of typos that were omitting useful
      flags, as well as specifying a -l under the wrong variable.
      
      * acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Define WARN_LDFLAGS as
      an alias for WARN_CFLAGS.
      * tools/Makefile.am (virsh_LDFLAGS): Use more canonical spelling.
      * proxy/Makefile.am (libvirt_proxy_LDFLAGS): Likewise. Move
      library...
      (libvirt_proxy_LDADD): ...here.
      * src/Makefile.am (virt_aa_helper_LDFLAGS): Use more canonical
      spelling of WARN_LDFLAGS.
      (libvirt_parthelper_LDFLAGS, libvirt_lxc_LDFLAGS): Likewise.  Use
      correct spelling of COVERAGE_LDFLAGS.
      Reported by Matthias Bolte.
      6e5b5bbc
  5. 15 5月, 2010 2 次提交
    • E
      Revert "build: fix cygwin build" · 39b3845f
      Eric Blake 提交于
      This reverts commit 2d550542.
      
      The patch worked for incremental builds, but broke fresh
      builds, because it interfered with automake's automatic
      dependency generation.  Until I figure out how to make
      automake do what we want, I'd rather leave cygwin broken
      but fresh Linux builds working.
      39b3845f
    • E
      build: fix cygwin build · 2d550542
      Eric Blake 提交于
      make[3]: *** No rule to make target `-lxml2', needed by `libvirt.la'.  Stop.
      
      Due to treating the wrong string as a dependency.
      
      * src/Makefile.am (libvirt_la_DEPENDENCIES): Depend only on
      locally-built file, not on strings that might resolve as '-lxml2'.
      2d550542
  6. 11 5月, 2010 2 次提交
    • E
      maint: allow VPATH use of remote_protocol-structs · 3876e010
      Eric Blake 提交于
      * src/Makefile.am (remote_protocol-structs): Ensure file lives in srcdir.
      3876e010
    • E
      maint: avoid spurious output if program not present · 7cdf2663
      Eric Blake 提交于
      Some shells warn about missing programs before redirection;
      the idiomatic way to silence them is to run the program check
      inside a subshell, with the redirections outside the subshell.
      But a subshell is only needed in places where it is reasonable
      to expect the use of such a noisy shell in the first place.
      
      * src/Makefile.am (remote_protocol-structs): Use subshell, for
      FreeBSD 8.0 /bin/sh.
      * cfg.mk (sc_preprocessor_indentation): Avoid subshell, since the
      only users running cfg.mk can be assumed to have decent tools.
      7cdf2663
  7. 08 5月, 2010 4 次提交
    • J
      help avoid accidental remote_protocol.x changes · 180d4b2b
      Jim Meyering 提交于
      Now, if you update remote_protocol.x without also updating
      remote_protocol-structs to match, then "make check" will fail.
      * src/Makefile.am (remote_protocol-structs): Extract list of
      structs and member names from remote_protocol.o.
      (check-local): Depend on it.
      * src/remote_protocol-structs: New file.
      180d4b2b
    • M
      Manually revert "Fix pthread related link error for virt-aa-helper" · cc04c4ca
      Matthias Bolte 提交于
      This reverts commit b5b8a6db.
      
      That commit was not necessary. The problem is fixed by commit
      0e9b3a26, but I didn't rebuild
      it properly after pulling in the commit and didn't notice it.
      cc04c4ca
    • E
      build: use LIBADD, not LDFLAGS, for adding libraries · 48445ccf
      Eric Blake 提交于
      Per automake, LDFLAGS is used early in the line, and LIBADD
      (libraries) or LDADD (programs) is used late.  On platforms like
      cygwin, without lazy linking, this order matters.  Therefore, libtool
      commands, -L, and similar should be in LDFLAGS, but -l should be in
      L*ADD.
      
      * src/Makefile.am (*_LDFLAGS): Move libraries...
      (*_LIBADD): ...to their LIBADD counterpart.
      48445ccf
    • E
      maint: whitespace cleanups · e6125e49
      Eric Blake 提交于
      * src/Makefile.am: Fix some space-tab issues.
      e6125e49
  8. 07 5月, 2010 3 次提交
    • M
      Fix pthread related link error for virt-aa-helper · b5b8a6db
      Matthias Bolte 提交于
      Link virt-aa-helper explicitly with pthread. This is at least
      required on Ubuntu 10.04.
      b5b8a6db
    • J
      avoid link error in tests using libvirt_util; due to pthread_sigmask · 0e9b3a26
      Jim Meyering 提交于
      * src/Makefile.am (libvirt_util_la_LDFLAGS): Add $(LIB_PTHREAD),
      required, now that we're using gnulib's pthread module.
      0e9b3a26
    • 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
  9. 29 4月, 2010 1 次提交
    • C
      Fix build on Ubuntu. · 50250aba
      Chris Lalancette 提交于
      When building on Ubuntu with make -j3 (or more), it would always
      fail when trying to build virt-aa-helper.  I'm not an expert in
      automake by any means, but I think the entry for virt-aa-helper
      is mis-using LDADD; it shouldn't be putting direct paths to
      libvirt_conf.la and libvirt_util.la, but instead referencing those
      names.  With this patch in place, I'm able to successfully build
      on Ubuntu 9.04 with make -j3.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      50250aba
  10. 28 4月, 2010 1 次提交
    • D
      Move dnsmasq host file to a separate directory · 4e041189
      Daniel Veillard 提交于
      use /var/lib/libvirt/dnsmasq since /var/lib/libvirt/network is
      unreadable by the dnsmasq binary
      
      * src/network/bridge_driver.c: update DNSMASQ_STATE_DIR
      * src/Makefile.am: create it on make install
      * libvirt.spec.in: take the new directory into account
      4e041189
  11. 26 4月, 2010 2 次提交
  12. 24 4月, 2010 1 次提交
  13. 16 4月, 2010 1 次提交
  14. 13 4月, 2010 1 次提交
    • S
      Consolidate interface related functions in interface.c · 5174b02f
      Stefan Berger 提交于
      Changes from v1 to v2:
      - changed function name prefixes to 'iface' from previous 'Iface'
      
      - Further to make make syntax-check pass:
       - indentation fix in interface.h
       - added entry to POTFILES.in
      
      I am consolidating network interface related functions used in nwfilter
      and macvtap code in utils/interface.c. All function names are prefixed
      with 'Iface'. The following functions are now available through
      interface.h:
      
      int ifaceCtrl(const char *name, bool up);
      int ifaceUp(const char *name);
      int ifaceDown(const char *name);
      
      int ifaceCheck(bool reportError, const char *ifname,
                     const unsigned char *macaddr, int ifindex);
      
      int ifaceGetIndex(bool reportError, const char *ifname, int *ifindex);
      
      I added 'int ifindex' as parameter to ifaceCheck to the original
      function and modified the code accordingly.
      5174b02f
  15. 09 4月, 2010 1 次提交
  16. 08 4月, 2010 1 次提交
    • S
      nwfilter: Support for learning a VM's IP address · 3bf24abc
      Stefan Berger 提交于
      This patch implements support for learning a VM's IP address. It uses
      the pcap library to listen on the VM's backend network interface (tap)
      or the physical ethernet device (macvtap) and tries to capture packets
      with source or destination MAC address of the VM and learn from DHCP
      Offers, ARP traffic, or first-sent IPv4 packet what the IP address of
      the VM's interface is. This then allows to instantiate the network
      traffic filtering rules without the user having to provide the IP
      parameter somewhere in the filter description or in the interface
      description as a parameter. This only supports to detect the parameter
      IP, which is for the assumed single IPv4 address of a VM. There is not
      support for interfaces that may have multiple  IP addresses (IP
      aliasing) or IPv6 that may then require more than one valid IP address
      to be detected. A VM can have multiple independent interfaces that each
      uses a different IP address and in that case it will be attempted to
      detect each one of the address independently.
      
      So, when for example an interface description in the domain XML has
      looked like this up to now:
      
          <interface type='bridge'>
            <source bridge='mybridge'/>
            <model type='virtio'/>
            <filterref filter='clean-traffic'>
              <parameter name='IP' value='10.2.3.4'/>
            </filterref>
          </interface>
      
      you may omit the IP parameter:
      
          <interface type='bridge'>
            <source bridge='mybridge'/>
            <model type='virtio'/>
            <filterref filter='clean-traffic'/>
          </interface>
      
      Internally I am walking the 'tree' of a VM's referenced network filters
      and determine with the given variables which variables are missing. Now,
      the above IP parameter may be missing and this causes a libvirt-internal
      thread to be started that uses the pcap library's API to listen to the
      backend interface  (in case of macvtap to the physical interface) in an
      attempt to determine the missing IP parameter. If the backend interface
      disappears the thread terminates assuming the VM was brought down. In
      case of a macvtap device a timeout is being used to wait for packets
      from the given VM (filtering by VM's interface MAC address). If the VM's
      macvtap device disappeared the thread also terminates. In all other
      cases it tries to determine the IP address of the VM and will then apply
      the rules late on the given interface, which would have happened
      immediately if the IP parameter had been explicitly given. In case an
      error happens while the firewall rules are applied, the VM's backend
      interface is 'down'ed preventing it to communicate. Reasons for failure
      for applying the network firewall rules may that an ebtables/iptables
      command failes or OOM errors. Essentially the same failure reasons may
      occur as when the firewall rules are applied immediately on VM start,
      except that due to the late application of the filtering rules the VM
      now is already running and cannot be hindered anymore from starting.
      Bringing down the whole VM would probably be considered too drastic.
      While a VM's IP address is attempted to be determined only limited
      updates to network filters are allowed. In particular it is prevented
      that filters are modified in such a way that they would introduce new
      variables.
      
      A caveat: The algorithm does not know which one is the appropriate IP
      address of a VM. If the VM spoofs an IP address in its first ARP traffic
      or IPv4 packets its filtering rules will be instantiated for this IP
      address, thus 'locking' it to the found IP address. So, it's still
      'safer' to explicitly provide the IP address of a VM's interface in the
      filter description if it is known beforehand.
      
      * configure.ac: detect libpcap
      * libvirt.spec.in: require libpcap[-devel] if qemu is built
      * src/internal.h: add the new ATTRIBUTE_PACKED define
      * src/Makefile.am src/libvirt_private.syms: add the new modules and symbols
      * src/nwfilter/nwfilter_learnipaddr.[ch]: new module being added
      * src/nwfilter/nwfilter_driver.c src/conf/nwfilter_conf.[ch]
        src/nwfilter/nwfilter_ebiptables_driver.[ch]
        src/nwfilter/nwfilter_gentech_driver.[ch]: plu the new functionality in
      * tests/nwfilterxml2xmltest: extend testing
      3bf24abc
  17. 01 4月, 2010 1 次提交
  18. 31 3月, 2010 2 次提交
    • M
      esx: Generate most SOAP mapping and improve inheritance handling · 50723581
      Matthias Bolte 提交于
      The Python script generates the mappings based on the type descriptions
      in the esx_vi_generator.input file.
      
      This also improves the inheritance handling and allows to get rid of the
      ugly, inflexible, and error prone _base/_super approach. Now every struct
      that represents a SOAP type contains a _type member, that allows to
      recreate C++-like dynamic dispatch for "method" calls in C.
      50723581
    • D
      Make sure nwfilter headers are part of distribution · 25d5e16e
      Daniel Veillard 提交于
      * src/Makefile.am: adds a few missing header files in the associated
        file variables, it's needed otherwise the missing headers breaks
        compilation from a distribution tarball
      25d5e16e
  19. 30 3月, 2010 1 次提交
    • D
      Add hook utilities · 2b4e3531
      Daniel Veillard 提交于
      This exports 3 basic routines:
        - virHookInitialize() initializing the hook support by looking for
          scripts availability
        - virHookPresent() used to test if there is a hook for a given driver
        - virHookCall() which actually calls a synchronous script hook with
          the needed parameters
      Note that this doesn't expose any public API except for the locations
      and arguments passed to the scripts
      
      * src/Makefile.am: add the 2 new files
      * src/util/hooks.h src/util/hooks.c: implements the 3 functions
      * src/libvirt_private.syms: export the 3 symbols internally
      * po/POTFILES.in: add src/util/hooks.c to translatables modules
      2b4e3531
  20. 27 3月, 2010 2 次提交
  21. 24 3月, 2010 1 次提交
    • J
      build: suppress distracting build output · 84eb6eff
      Jim Meyering 提交于
      * src/Makefile.am (augeas-check): New target, just to give the existing
      rule a name.  At the same time, prefix the commands with $(AM_V_GEN),
      to avoid unexpected build output with V=0 which is the default.
      84eb6eff
  22. 23 3月, 2010 2 次提交
  23. 18 3月, 2010 1 次提交
  24. 17 3月, 2010 1 次提交
  25. 15 3月, 2010 1 次提交
  26. 13 3月, 2010 1 次提交
  27. 05 3月, 2010 1 次提交
    • D
      build: vbox: avoid build failure when linking with --no-add-needed · c7434706
      Diego Elio Pettenò 提交于
      With the recent changes to the linking defaults in Fedora 13 (namely
      enabling --no-add-needed behaviour by default), we have to pass the
      dlopen()-providing libraries directly at the link of the module; use the
      same AC_SEARCH_LIBS function as used before to look for it and add it to
      the Makefile.
      c7434706
  28. 16 2月, 2010 1 次提交
    • S
      macvtap support for libvirt -- build support · fd5091db
      Stefan Berger 提交于
      This patch adds build support for libvirt checking for certain contents
      of /usr/include/linux/if_link.h to see whether macvtap support is
      compilable on that system. One can disable macvtap support in libvirt
      via --without-macvtap passed to configure.
      * configure.ac src/Makefile.am: new build support
      * src/libvirt_macvtap.syms: list of exported symbols
      * src/util/macvtap.c: empty module to not break compilation
      fd5091db