1. 22 8月, 2012 37 次提交
    • P
      client: Change default location of known_hosts file for libssh2 layer · 225f2807
      Peter Krempa 提交于
      Unfortunately libssh2 doesn't support all types of host keys that can be
      saved in the known_hosts file. Also it does not report that parsing of
      the file failed. This results into truncated known_hosts files where the
      standard client stores keys also in other formats (eg.
      ecdsa-sha2-nistp256).
      
      This patch changes the default location of the known_hosts file into the
      libvirt private configuration directory, where it will be only written
      by the libssh2 layer itself. This prevents trashing user's known_host
      file.
      225f2807
    • P
      libssh2_session: Add support for creating known_hosts file · f1d0b92a
      Peter Krempa 提交于
      The libssh2 code wasn't supposed to create the known_hosts file, but
      recent findings show, that we can't use the default created by OpenSSH
      as libssh2 might damage it. We need to create a private known_hosts file
      in the config path.
      
      This patch adds support for skipping error if the known_hosts file is
      not present and let libssh2 create a new one.
      f1d0b92a
    • W
      qemu: support of emulator_period and emulator_quota's modification · 50659420
      Wen Congyang 提交于
      allow the user change/get emulator's period and quota when the vm is running.
      50659420
    • H
      new interface to control emulator_period/emulator_quota · e051c482
      Hu Tao 提交于
      This patch adds two macros: VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD,
      VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA for controlling cpu bandwidth
      for emulator activities not tied to vcpus
      e051c482
    • H
      qemu: introduce period/quota tuning for emulator · b65dafa8
      Hu Tao 提交于
      This patch introduces support of setting emulator's period and
      quota to limit cpu bandwidth when the vm starts.  Also updates
      XML Schema for new entries and docs.
      b65dafa8
    • H
      limit cpu bandwidth only for vcpus · 1d4395eb
      Hu Tao 提交于
      This patch changes the behaviour of xml element cputune.period
      and cputune.quota to limit cpu bandwidth only for vcpus, and no
      longer limit cpu bandwidth for the whole guest.
      
      The reasons to do this are:
      
        - This matches docs of cputune.period and cputune.quota.
        - The other parts excepting vcpus are treated as "emulator",
          and there are separate period/quota settings for emulator
          in the subsequent patches
      1d4395eb
    • H
      new command emulatorpin · 48605960
      Hu Tao 提交于
      48605960
    • H
      Add a new function vshPrintPinInfo. · 272570df
      Hu Tao 提交于
      This is a helper function to print vcpu pin info.
      272570df
    • T
      remote: introduce emulator pinning RPCs · ca5c99ae
      Tang Chen 提交于
      Introduce 2 APIs to support emulator threads in remote driver.
          1) remoteDomainPinEmulator: call driver api, such as qemudDomainPinEmulator.
          2) remoteDomainGetEmulatorPinInfo: call driver api, such as qemudDomainGetEmulatorPinInfo.
      They are similar to remoteDomainPinVcpuFlags and remoteDomainGetVcpuPinInfo.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      ca5c99ae
    • H
      qemu: support emulator pinning · 3dbf4838
      Hu Tao 提交于
      Introduce 2 APIs to support emulator threads pin in qemu driver.
      
          1) qemudDomainPinEmulator: setup emulator threads pin info.
          2) qemudDomainGetEmulatorPinInfo: get all emulator threads pin info.
      
      They are similar to qemudDomainPinVcpuFlags and qemudDomainGetVcpuPinInfo.
      And also, remoteDispatchDomainPinEmulatorFlags and remoteDispatchDomainGetEmulatorPinInfo
      functions are introduced.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      3dbf4838
    • T
      Introduce virDomainEmulatorPinAdd and virDomainEmulatorPinDel functions · 151eee5a
      Tang Chen 提交于
      Introduce 2 APIs to support emulator threads pin.
          1) virDomainEmulatorPinAdd: setup emulator threads pin with a given cpumap string.
          2) virDomainEmulatorPinDel: remove all emulator threads pin.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      151eee5a
    • T
      Introduce virDomainPinEmulator and virDomainGetEmulatorPinInfo functions. · c152bf94
      Tang Chen 提交于
      Introduce 2 APIs to set/get physical cpu pinning info of emulator threads.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      c152bf94
    • T
      Add qemuProcessSetEmulatorAffinites and set emulator threads affinities · 6db98e8a
      Tang Chen 提交于
      Emulator threads should also be pinned by sched_setaffinity(), just
      the same as vcpu threads.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      6db98e8a
    • T
      qemu: synchronize emulatorpin info to cgroup · a1249489
      Tang Chen 提交于
      Introduce qemuSetupCgroupEmulatorPin() function to add emulator
      threads pin info to cpuset cgroup, the same as vcpupin.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      a1249489
    • T
      Support emulatorpin xml parse. · 19630db3
      Tang Chen 提交于
      This patch adds a new xml element <emulatorpin>, which is a sibling
      to the existing <vcpupin> element under the <cputune>, to pin emulator
      threads to specified physical CPUs.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      19630db3
    • H
      ed922850
    • 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
      updates of some vcpupin related functions · a5dd8b80
      Hu Tao 提交于
      1. add a new function virDomainVcpuPinDefCopy
      2. make virDomainVcpuPinDefFree non-static
      a5dd8b80
    • H
      refactor virDomainVcpuPinAdd() · fd8fd0f9
      Hu Tao 提交于
      fd8fd0f9
    • H
      1fea5667
    • W
      create a new cgroup and move all emulator threads to the new cgroup · 4b03d591
      Wen Congyang 提交于
      Create a new cgroup and move all emulator threads to the new cgroup.
      And then we can do the other things:
      1. limit only vcpu usage rather than the whole qemu
      2. limit for emulator threads(include vhost-net threads)
      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>
      4b03d591
    • 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
    • G
      output status information during guest shutdown again · c18dc28b
      Gerd v. Egidy 提交于
      Since the move to systemd libvirt-guests doesn't output this progress
      information anymore. This patch brings back this feature.
      
      It is helpful to show the admin what the system is waiting for and what
      is left of the timeout (e.g. for calibrating the shutdown timing of a ups).
      
      Rewriting the current line with \r doesn't work anymore in the context
      of systemd. So always write new lines, but move to 5 second intervals
      to avoid flooding the console.
      c18dc28b
    • J
      qemu: Disk Geometry Override Support · a46af260
      J.B. Joret 提交于
      Qemu command line generation for geometry override and testcases.
      Signed-off-by: NJ.B. Joret <jb@linux.vnet.ibm.com>
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      a46af260
    • J
      Support for Disk Geometry Override · 5d4f8d97
      J.B. Joret 提交于
      A hypervisor may allow to override the disk geometry of drives.
      Qemu, as an example with cyls=,heads=,secs=[,trans=].
      This patch extends the domain config to allow the specification of
      disk geometry with libvirt.
      Signed-off-by: NJ.B. Joret <jb@linux.vnet.ibm.com>
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      5d4f8d97
    • E
      build: avoid $(builddir) in Makefile · 4fce1c43
      Eric Blake 提交于
      Older automake 1.9.6 (hello there, RHEL 5) did not populate
      $(builddir), which meant 'make check' failed with:
      
      make[3]: *** No rule to make target `/.libs/libvirt.la', needed by `check-symfile'.  Stop.
      
      For that matter, even newer automake doesn't directly emit rules
      to build .libs/libvirt.la; we are better off basing our rules
      on the public ./libvirt.la.
      
      * src/Makefile.am (check-symfile): Delete useless variable.
      4fce1c43
    • E
      build: network requires location of dbus headers · f97d02d7
      Eric Blake 提交于
      Without this patch, RHEL 5 fails to compile, since the dbus
      files lives under /usr/include/dbus-1.0/dbus/dbus.h, and
      DBUS_CFLAGS contains -I/usr/include/dbus-1.0.
      
      In file included from network/bridge_driver.c:67:
      ../src/util/virdbus.h:26:25: error: dbus/dbus.h: No such file or directory
      
      * src/Makefile.am (libvirt_driver_network_impl_la_CFLAGS): Add
      DBUS_CFLAGS.
      f97d02d7
    • 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 glibc that lacks CPU_COUNT · 0d03735f
      Eric Blake 提交于
      Building on RHEL 5 warned:
      
      nodeinfo.c: 305: warning: implicit declaration of function 'CPU_COUNT'
      
      This extension macro in <sched.h> was not added until later glibc.
      
      * src/nodeinfo.c (CPU_COUNT): Add fallback implementation.
      0d03735f
    • 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
    • S
      nwfilter: provide basic support for firewalld · 4efde75f
      Stefan Berger 提交于
      This patch provides basic support for using firewalld's firewall-cmd
      rather than then plain eb/ip(6)tables commands.
      4efde75f
    • 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
    • J
      sanlock: Provide better error if lockspace directory is missing · 2560a51e
      Jiri Denemark 提交于
      Generating "Unable to add lockspace /lock/space/dir/__LIBVIRT__DISKS__:
      No such file or directory" is correct but not exactly clear. This patch
      changes the error message to "Unable to create lockspace
      /lock/space/dir/__LIBVIRT__DISKS__: parent directory does not exist or
      is not a directory".
      2560a51e
    • J
      daemon: Autodetect lock driver directory · 15f5e16f
      Jiri Denemark 提交于
      When running libvirtd from a build directory, libvirtd would load lock
      drivers from system directory unless explicitly overridden by setting
      LIBVIRT_LOCK_MANAGER_PLUGIN_DIR environment variable. Since we already
      autodetect driver directory if libvirt is build with driver modules, we
      can use the same trick to automagically set lock driver directory.
      15f5e16f
  2. 21 8月, 2012 3 次提交
    • E
      build: split driver_storage into convenience library · 1a4379cb
      Eric Blake 提交于
      Commit 1d22ba95 was complete at the time, but we have since
      reintroduced a warning that is fixed in the same manner:
      
        CCLD   storagebackendsheepdogtest
      
      *** Warning: Linking the executable storagebackendsheepdogtest against the loadable module
      *** libvirt_driver_storage.so is not portable!
      
      * src/Makefile.am (libvirt_driver_storage.la): Factor into new
      convenience library libvirt_driver_storage_impl.la.
      * tests/Makefile.am (storagebackendsheepdogtest_LDADD): Link to
      convenience library, not shared library.
      1a4379cb
    • E
      build: silence stupid gcc warning on STREQ_NULLABLE · 8d8527de
      Eric Blake 提交于
      Our existing STRNEQ_NULLABLE() triggered a warning in gcc 4.7 when
      used with a literal NULL argument:
      
      qemumonitorjsontest.c: In function 'testQemuMonitorJSONGetMachines':
      qemumonitorjsontest.c:289:5: error: null argument where non-null required (argument 1) [-Werror=nonnull]
      
      even though the strcmp is provably dead when a null argument is
      present.  Squelch the warning by refactoring things so that gcc
      never sees strcmp() called with NULL arguments (we still compare
      NULL as not equal to "", this rewrite merely aids gcc).
      
      Next, gcc has a valid warning about a literal NULLSTR(NULL):
      
      qemumonitorjsontest.c:289:5: error: invalid application of 'sizeof' to a void type [-Werror=pointer-arith]
      
      Of course, you'd never write NULLSTR(NULL) directly, but it is
      handy to use through macros.  But the entire part about verify_true()
      is unnecessary - gcc already warns about type mismatch with ?:,
      without needing to make it more complex.
      
      * src/internal.h (STREQ_NULLABLE, STRNEQ_NULLABLE): Avoid gcc 4.7
      stupidity.
      (NULLSTR): Simplify, to allow passing compile-time constants.
      8d8527de
    • D
      Fix parsing of uid/gid on Mingw32 · 7272a92c
      Daniel P. Berrange 提交于
      The DAC security driver uses the virStrToLong_ui function to
      parse the uid/gid out of the seclabel string. This works on
      Linux where 'uid_t' is an unsigned int, but on Mingw32 it is
      just an 'int'. This causes compiler warnings about signed/
      unsigned int pointer mis-match.
      
      To avoid this, use explicit 'unsigned int ouruid' local
      vars to pass into virStrToLong_ui, and then simply assign
      to the 'uid_t' type after parsing
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7272a92c