1. 18 9月, 2012 3 次提交
  2. 13 9月, 2012 1 次提交
  3. 07 9月, 2012 3 次提交
    • D
      Don't assume use of /sys/fs/cgroup · a4fd7405
      Daniel P. Berrange 提交于
      The introduction of /sys/fs/cgroup came in fairly recent kernels.
      Prior to that time distros would pick a custom directory like
      /cgroup or /dev/cgroup. We need to auto-detect where this is,
      rather than hardcoding it
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a4fd7405
    • P
      util: Add helper to assign typed params from string · 245cef9f
      Peter Krempa 提交于
      This patch adds a helper to deal with assigning values to
      virTypedParameter structures from strings. The helper parses the value
      from the string and assigns it to the corresponding union value.
      245cef9f
    • E
      build: improved handling of <execinfo.h>, BSD <net/if.h> · ccaf0bee
      Eric Blake 提交于
      FreeBSD and OpenBSD have a <net/if.h> that is not self-contained;
      and mingw lacks the header altogether.  But gnulib has just taken
      care of that for us, so we might as well simplify our code.  In
      the process, I got a syntax-check failure if we don't also take
      the gnulib execinfo module.
      
      * .gnulib: Update to latest, for execinfo and net_if.
      * bootstrap.conf (gnulib_modules): Add execinfo and net_if modules.
      * configure.ac: Let gnulib check for headers.  Simplify check for
      'struct ifreq', while also including enough prereq headers.
      * src/internal.h (IF_NAMESIZE): Drop, now that gnulib guarantees it.
      * src/nwfilter/nwfilter_learnipaddr.h: Use correct header for
      IF_NAMESIZE.
      * src/util/virnetdev.c (includes): Assume <net/if.h> exists.
      * src/util/virnetdevbridge.c (includes): Likewise.
      * src/util/virnetdevtap.c (includes): Likewise.
      * src/util/logging.c (includes): Assume <execinfo.h> exists.
      (virLogStackTraceToFd): Handle gnulib's fallback implementation.
      ccaf0bee
  4. 06 9月, 2012 1 次提交
    • L
      network: prevent infinite hang if ovs-vswitchd isn't running · 98e732fc
      Laine Stump 提交于
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=852984
      
      If a network or interface is configured to use Open vSwitch, but
      ovs-vswitchd (the Open vSwitch database service) isn't running, the
      ovs-vsctl add-port/del-port commands will hang indefinitely rather
      than returning an error. There is a --nowait option, but that appears
      to have no effect on add-port and del-port commands, so instead we add
      a --timeout=5 to the commands - they will retry for up to 5 seconds,
      then fail if there is no response.
      98e732fc
  5. 05 9月, 2012 2 次提交
    • E
      build: use correct libraries for clock_gettime · d74e5a4d
      Eric Blake 提交于
      On OpenBSD, clock_gettime() exists in libc rather than librt, and
      blindly linking with -lrt made the build fail.  Gnulib already
      did the work for determining which libraries to use, so we should
      reuse that work rather than doing it ourselves.
      
      * bootstrap.conf (gnulib_modules): Pull in clock-time.
      * configure.ac (RT_LIBS): Drop.
      * src/Makefile.am (libvirt_util_la_LIBADD): Use gnulib variable
      instead.
      * src/util/virtime.c (includes): Simplify.
      d74e5a4d
    • J
      afa67b77
  6. 31 8月, 2012 6 次提交
    • E
      command: shell-quote when logging commands · 54e99644
      Eric Blake 提交于
      Without this patch, logged command executions can be ambiguous if
      the command contained any shell metacharacters.  This has caused
      more than one person to attempt to patch clients to add unnecessary
      quoting, without realizing that the command itself was run with
      correct args, and only the logged output was ambiguous.
      
      * src/util/command.c (virCommandToString): Add shell escapes.
      * tests/commandtest.c (test16): Test new behavior.
      * tests/commanddata/test16.log: Update expected output.
      * tests/qemuxml2argvdata/qemuxml2argv-*.args: Likewise.
      * tests/networkxml2argvdata/*.argv: Likewise.
      54e99644
    • O
      util: Update the inconsistent and outdated comments · a2145fae
      Osier Yang 提交于
      The codes were updated to allow to reset the device as long as
      there is no devices/functions behind the same bus. However, the
      comments were kept without touched.
      a2145fae
    • G
      cgroup: read more data from cgroup cpuacct.usage_percpu · c402eebc
      Guannan Ren 提交于
      On NUMA machine, the length of string got from file
      cpuacct.usage_percpu is quite large, so expand the
      limit of 1024 bytes.
      
      errors like:
      Failed to read file \
      '/cgroup/cpuacct/libvirt/qemu/rhel6q/cpuacct.usage_percpu': \
      Value too large for defined data type
      c402eebc
    • S
      Implement virMacAddrIsBroadcastRaw · 46b2cafb
      Stefan Berger 提交于
      Add function for testing for Ethernet broadcast address
      46b2cafb
    • K
      Fix adding ports to OVS bridges without VLAN tags · 7b9d55e6
      Kyle Mestery 提交于
      The introduction of the new VLAN code, along with the fix
      from 5e465df6, caused the
      addition of OVS ports to fail with the following message:
      
      ovs-vsctl: 00002|vsctl|ERR|: missing column name
      
      This fix takes into account the VLAN arguments are optional,
      and correctly sets up the command line to run the "ovs-vsctl"
      command to add ports to the OVS bridge.
      Signed-off-by: NKyle Mestery <kmestery@cisco.com>
      CC: Eric Blake <eblake@redhat.com>
      7b9d55e6
    • N
      Fix issue of PF brought down if VF is 8021.Qbh and pci passthrough · 3044433f
      Nishank Trivedi 提交于
      If a 8021.Qbh network device supports SRIOV and its VF is being used
      in pci passthrough mode, when the guest is shutdown or destroyed, the
      PF inteface is also brought down. qemuDomainHostdevNetConfigRestore()
      finds out the PF for provided hostdev (which is VF) and passes it to
      virNetDevPortProfileDisassociate() as linkdev. Later, linkdev gets passed
      to virNetDevSetOnline() where the interface is brought down by clearing
      IFF_UP flag.
      
      Bringing down a PF, when only VF is being brought down is not expected
      behavior. This patch adds a check so that virNetDevSetOnline() is called
      only for PF and not if device is a VF.
      Signed-off-by: NNishank Trivedi <nistrive@cisco.com>
      3044433f
  7. 30 8月, 2012 2 次提交
  8. 29 8月, 2012 2 次提交
  9. 28 8月, 2012 3 次提交
    • M
      build: define 'inline' iff HAVE_LIBNL1 · 500c2468
      Michal Privoznik 提交于
      Previous commit 0b4b53bb defined 'inline' to prevent broken build on
      systems with libnl1 headers. However, it broke build on systems with
      libnl3 headers. Therefore we must make that fix conditional.
      500c2468
    • E
      build: work with older libnl1 headers · 0b4b53bb
      Eric Blake 提交于
      Ubuntu 10.04 shipped with out-of-the-box libnl1 headers, which
      assumed the old gcc semantics of 'extern inline' as a C89 extension:
      the function will _always_ be inline if it is used, and that
      it may be declared extern inline in headers without a definition,
      as long as the definition occurs before any use.  But when C99
      added 'extern inline' as a mandatory feature of the language, with
      slightly different semantics than gcc (the function MUST have
      external linkage, and the inline definition MUST be present
      alongside any declaration, where the compiler can then choose
      which of the two versions to use), this rendered the use of
      'inline' in libnl's header obsolete.  Most distros already solved
      this by removing 'inline' (the resulting 'extern' is correct,
      regardless of gcc semantics), and libnl-3 does not have the
      problem (where it has switched to 'static inline' instead, again
      with the definition present, and again, our hack will result in
      plain 'static' with no ill effects).  But for the case of building
      out of the box, we hack around the broken Ubuntu header.
      
      * src/util/virnetlink.h: Work around libnl issue.
      0b4b53bb
    • M
      Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code · aa3e8bd4
      Michal Privoznik 提交于
      Currently, when guest agent is configured but not responsive
      (e.g. due to appropriate service not running in the guest)
      we return VIR_ERR_INTERNAL_ERROR. Both are wrong. Therefore
      we need to introduce new error code to reflect this case.
      aa3e8bd4
  10. 24 8月, 2012 1 次提交
    • L
      network: fix virtual network bridge delay setting · ddf1ccb7
      Laine Stump 提交于
      libvirt's network config documents that a bridge's STP "forward delay"
      (called "delay" in the XML) should be specified in seconds, but
      virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
      milliseconds (although the comment at the top of the function
      incorrectly says "seconds".
      
      This fixes the comment, and converts the delay to milliseconds before
      calling virNetDevBridgeSetSTPDelay().
      ddf1ccb7
  11. 23 8月, 2012 2 次提交
    • L
      util: eliminate erroneous VIR_WARNs in (eb|ip)tables.c · 947a51ee
      Laine Stump 提交于
      Several VIR_DEBUG()'s were changed to VIR_WARN() while I was testing
      the firewalld support patch, and I neglected to change them back
      before I pushed.
      
      In the meantime I've decided that it would be useful to have them be
      VIR_INFO(), just so there will be logged evidence of which method is
      being used (firewall-cmd vs. (eb|ip)tables) without needing to crank
      logging to 11. (at most this adds 2 lines to libvirtd's logs per
      libvirtd start).
      947a51ee
    • Y
      Fix some typos in messages, docs and comments. · 66d81129
      Yuri Chornoivan 提交于
      66d81129
  12. 22 8月, 2012 11 次提交
    • D
      Fix parameter list in virNetlinkEvent{Add,Remove}Client Win32 stubs · 34b30de5
      Daniel P. Berrange 提交于
      The virNetlinkEventAddClient / virNetlinkEventRemoveClient stub
      impls had syntax errors in their parameter lists, using a ')'
      after the second-to-last parameter instead of a ','
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      34b30de5
    • T
      Introduce virNetlinkEventServiceStopAll() to stop all netlink services. · 15a71e60
      Tang Chen 提交于
      This patch introduce virNetlinkEventServiceStopAll() to stop
      all the monitors to receive netlink messages for libvirtd.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      15a71e60
    • T
      Improve netlink to support all protocol. · d5756794
      Tang Chen 提交于
      This patch improve all the API in virnetlink.c to support
      all kinds of netlink protocols, and make all netlink sockets
      be able to join in groups.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      d5756794
    • H
      Enable cpuset cgroup and synchronous vcpupin info to cgroup. · fe1d3259
      Hu Tao 提交于
      vcpu threads pin are implemented using sched_setaffinity(), but
      not controlled by cgroup. This patch does the following things:
      
          1) enable cpuset cgroup
          2) reflect all the vcpu threads pin info to cgroup
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      fe1d3259
    • H
      Introduce the function virCgroupMoveTask · 91028296
      Hu Tao 提交于
      Introduce a new API to move tasks of one controller from a cgroup to another cgroup
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      91028296
    • W
      Introduce the function virCgroupForEmulator · 92741ef3
      Wen Congyang 提交于
      Introduce the function virCgroupForEmulator() to create sub directory
      for simulator thread(include I/O thread, vhost-net thread)
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      92741ef3
    • E
      atomic: fix whitespace in previous patch · cd8f8c8d
      Eric Blake 提交于
      cd8f8c8d
    • E
      atomic: mark header functions static · bf76174b
      Eric Blake 提交于
      When gcc atomic intrinsics are not available (such as on RHEL 5
      with gcc 4.1.2), we were getting link errors due to multiple
      definitions:
      
      ./.libs/libvirt_util.a(libvirt_util_la-virobject.o): In function `virAtomicIntXor':
      /home/dummy/l,ibvirt/src/util/viratomoic.h:404: multiple definition of `virAtomicIntXor'
      ./.libs/libvirt_util.a(libvirt_util_la-viratomic.o):/home/dummy/libvirt/src/util/viratomic.h:404: first defined here
      
      Solve this by conditionally marking the functions static (the
      condition avoids falling foul of gcc warnings about unused
      static function declarations).
      
      * src/util/viratomic.h: When not using gcc intrinsics, use static
      functions to avoid linker errors on duplicate functions.
      bf76174b
    • E
      build: work with older RHEL 5 kernel · 77de1f35
      Eric Blake 提交于
      We already skip out on building the LXC under RHEL 5, because the
      kernel is too old (commits 4c18acff, 2dee8965); but commit 9612e4b2
      moved some LXC-only code into common files, resulting in this
      build failure:
      
      util/virfile.c: In function 'virFileLoopDeviceAssociate':
      util/virfile.c:580: error: 'LO_FLAGS_AUTOCLEAR' undeclared (first use in this function)
      
      Unfortunately, the kernel folks only made it an enum, rather than
      also a #define, so we have to modify configure.ac to record when
      it is usable.
      
      * configure.ac (with_lxc): Mark when LO_FLAGS_AUTOCLEAR was found.
      * src/util/virfile.c (virFileLoopDeviceAssociate): Avoid
      compilation when kernel is too old.
      77de1f35
    • J
      command: avoid double close in virExecWithHook · 8211c677
      Ján Tomko 提交于
      Fix possible double close in the child process after the fork in case
      infd and outfd are equal, just like they are after being called from
      virNetSocketNewConnectCommand.
      8211c677
    • T
      network: use firewalld instead of iptables, when available · bf156385
      Thomas Woerner 提交于
      * configure.ac, spec file: firewalld defaults to enabled if dbus is
        available, otherwise is disabled. If --with_firewalld is explicitly
        requested and dbus is not available, configure will fail.
      
      * bridge_driver: add dbus filters to get the FirewallD1.Reloaded
        signal and DBus.NameOwnerChanged on org.fedoraproject.FirewallD1.
        When these are encountered, reload all the iptables reuls of all
        libvirt's virtual networks (similar to what happens when libvirtd is
        restarted).
      
      * iptables, ebtables: use firewall-cmd's direct passthrough interface
        when available, otherwise use iptables and ebtables commands. This
        decision is made once the first time libvirt calls
        iptables/ebtables, and that decision is maintained for the life of
        libvirtd.
      
      * Note that the nwfilter part of this patch was separated out into
        another patch by Stefan in V2, so that needs to be revised and
        re-reviewed as well.
      
      ================
      
      All the configure.ac and specfile changes are unchanged from Thomas'
      V3.
      
      V3 re-ran "firewall-cmd --state" every time a new rule was added,
      which was extremely inefficient.  V4 uses VIR_ONCE_GLOBAL_INIT to set
      up a one-time initialization function.
      
      The VIR_ONCE_GLOBAL_INIT(x) macro references a static function called
      vir(Ip|Eb)OnceInit(), which will then be called the first time that
      the static function vir(Ip|Eb)TablesInitialize() is called (that
      function is defined for you by the macro). This is
      thread-safe, so there is no chance of any race.
      
      IMPORTANT NOTE: I've left the VIR_DEBUG messages in these two init
      functions (one for iptables, on for ebtables) as VIR_WARN so that I
      don't have to turn on all the other debug message just to see
      these. Even if this patch doesn't need any other modification, those
      messages need to be changed to VIR_DEBUG before pushing.
      
      This one-time initialization works well. However, I've encountered
      problems with testing:
      
      1) Whenever I have enabled the firewalld service, *all* attempts to
      call firewall-cmd from within libvirtd end with firewall-cmd hanging
      internally somewhere. This is *not* the case if firewall-cmd returns
      non-0 in response to "firewall-cmd --state" (i.e. *that* command runs
      and returns to libvirt successfully.)
      
      2) If I start libvirtd while firewalld is stopped, then start
      firewalld later, this triggers libvirtd to reload its iptables rules,
      however it also spits out a *ton* of complaints about deletion failing
      (I suppose because firewalld has nuked all of libvirt's rules). I
      guess we need to suppress those messages (which is a more annoying
      problem to fix than you might think, but that's another story).
      
      3) I noticed a few times during this long line of errors that
      firewalld made a complaint about "Resource Temporarily
      unavailable. Having libvirtd access iptables commands directly at the
      same time as firewalld is doing so is apparently problematic.
      
      4) In general, I'm concerned about the "set it once and never change
      it" method - if firewalld is disabled at libvirtd startup, causing
      libvirtd to always use iptables/ebtables directly, this won't cause
      *terrible* problems, but if libvirtd decides to use firewall-cmd and
      firewalld is later disabled, libvirtd will not be able to recover.
      bf156385
  13. 21 8月, 2012 1 次提交
    • P
      libssh2_transport: add main libssh2 transport implementation · 1193fc5f
      Peter Krempa 提交于
      This patch adds helper functions that enable us to use libssh2 in
      conjunction with libvirt's virNetSockets for ssh transport instead of
      spawning "ssh" client process.
      
      This implemetation supports tunneled plaintext, keyboard-interactive,
      private key, ssh agent based and null authentication. Libvirt's Auth
      callback is used for interaction with the user. (Keyboard interactive
      authentication, adding of host keys, private key passphrases). This
      enables seamless integration into the application using libvirt. No
      helpers as "ssh-askpass" are needed.
      
      Reading and writing of OpenSSH style "known_hosts" files is supported.
      
      Communication is done using SSH exec channel, where the user may specify
      arbitrary command to be executed on the remote side and reads and writes
      to/from stdin/out are sent through the ssh channel. Usage of stderr is
      not (yet) supported.
      1193fc5f
  14. 18 8月, 2012 2 次提交