1. 19 10月, 2012 13 次提交
    • V
      S390: Buffer too small for large CPU numbers. · 1bc28c28
      Viktor Mihajlovski 提交于
      The output buffer for virFileReadAll was too small for systems with
      more than 30 CPUs which leads to a log entry and incorrect behavior.
      The new size will be sufficient for the current
      architectural limits.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      (cherry picked from commit 4bdc8606)
      1bc28c28
    • E
      spec: prefer canonical name of util-linux · 6730e635
      Eric Blake 提交于
      I noticed that in two places, we require util-linux, and in a third,
      we require util-linux-ng.  On Fedora (I tested F15 through rawhide),
      util-linux-ng is obsoleted by util-linux; on RHEL 6, util-linux
      is obsoleted by util-linux-ng.  That is, on either platform, either
      name will get you the correct package installed (where the preferred
      name on fedora is util-linux, and on RHEL 6 is util-linux-ng).  But
      on RHEL 5, there is no util-linux-ng
      
      * libvirt.spec.in (Requires): Use util-linux, not util-linux-ng.
      (cherry picked from commit a9087ad1)
      6730e635
    • E
      docs: fix links in migration.html TOC · 6d4bca5b
      Eric Blake 提交于
      Use of the wrong attribute name caused the table of contents to
      be useless.  Fix suggested by Daniel P. Berrange.
      
      * docs/migration.html.in: Use correct anchoring attribute.
      (cherry picked from commit eeb8c924)
      6d4bca5b
    • K
      Correct checking of virStrcpyStatic() return value · cf2d85cd
      Kyle Mestery 提交于
      Correct the check for the return value of virStrcpyStatic()
      when copying port-profile names. Fixes Open vSwitch ports
      which utilize port-profiles from network definitions.
      Signed-off-by: NKyle Mestery <kmestery@cisco.com>
      (cherry picked from commit 83aebf6d)
      cf2d85cd
    • E
      build: avoid -Wno-format on new-enough gcc · e302d32f
      Eric Blake 提交于
      Commit c579d6b3 added a sledgehammer to silence spurious warnings from
      gcc 4.2, but in the process, it also silenced useful warnings from
      gcc 4.3 through 4.5.  As a result, a bug slipped in to commit 0caccb58.
      
      Tested with FreeBSD (gcc 4.2.1), RHEL 6.3 (gcc 4.4), and F17 (gcc 4.7.2),
      where the former didn't trip on spurious warnings, and where the latter
      two detected a revert of 2b804cfa.
      
      * m4/virt-compile-warnings.m4 (-Wno-format): Probe for the actual
      spurious message, to once again allow gcc 4.4 to use -Wformat.
      (cherry picked from commit 814a8dea)
      e302d32f
    • P
      qemu: Use proper agent entering function when freezing filesystems · ccc76711
      Peter Krempa 提交于
      When doing snapshots, the filesystem freeze function used the agent
      entering function that expects the qemud_driver unlocked. This might
      cause a deadlock of the qemu driver if the agent does not respond.
      
      The only call path of this function has the qemud_driver locked, so this
      patch changes the entering functions to those expecting the driver
      locked.
      (cherry picked from commit e0316b5e)
      ccc76711
    • M
      lxc: Correctly report active cgroups · 5c188057
      Michal Privoznik 提交于
      There was an inverted return value in lxcCgroupControllerActive().
      The function assumes cgroups are active and do couple of checks
      to prove that. If any of them fails, false is returned. Therefore,
      at the end, after all checks are done we must return true, not false.
      (cherry picked from commit 0dddd680)
      5c188057
    • E
      build: fix bitmap conversion when !CPU_ALLOC · 0cfd7b9a
      Eric Blake 提交于
      Commit f1a43a8e missed one side of an #if/#else.
      
      * src/util/processinfo.c (virProcessInfoGetAffinity): Use correct
      bitmap operation.
      (cherry picked from commit 9038ac65)
      0cfd7b9a
    • D
      Add note about numeric domain names to manpage · 72ad93f0
      Dave Allan 提交于
      Clarify that domains with numeric names can only be identified by
      their domain id.
      (cherry picked from commit 13c69cd0)
      72ad93f0
    • D
      build: default selinuxfs mount point to /sys/fs/selinux · 2a85eaee
      Daniel J Walsh 提交于
      Currently if you build on a machine that does not support SELinux we end up
      with the default mount point being /selinux, since this is moved to
      /sys/fs/selinux, we should start defaulting there.
      
      I believe this is causing a bug in libvirt-lxc when /selinux does not exists,
      even though /sys/fs/selinux exists.
      (cherry picked from commit aa696e18)
      2a85eaee
    • C
      ARMHF: implement /proc/cpuinfo parsing · beb9dd9c
      Chuck Short 提交于
      Minimal CPU "parser" for armhf to avoid compile time warning.
      Signed-off-by: NChuck Short <chuck.short@canonical.com>
      (cherry picked from commit 2d0a777b)
      beb9dd9c
    • G
      python: return error if PyObject obj is NULL for unwrapper helper functions · ad9d1863
      Guannan Ren 提交于
      The result is indeterminate for NULL argument to python
      functions as follows. It's better to return negative value in
      these situations.
      
      PyObject_IsTrue will segfault if the argument is NULL
      PyFloat_AsDouble(NULL) is -1.000000
      PyLong_AsUnsignedLongLong(NULL) is 0.000000
      (cherry picked from commit 4c6be02a)
      ad9d1863
    • J
      Fix compilation of legacy xen driver with Xen 4.2 · 9875efbd
      Jim Fehlig 提交于
      In Xen 4.2, xs.h is deprecated in favor of xenstore.h.  xs.h now
      contains
      
      #warning xs.h is deprecated use xenstore.h instead
      #include <xenstore.h>
      
      which fails compilation when warnings are treated as errors.
      
      Introduce a configure-time check for xenstore.h and if found,
      use it instead of xs.h.
      (cherry picked from commit 416eca18)
      9875efbd
  2. 18 10月, 2012 24 次提交
    • D
      Fix handling of itanium arch name in QEMU driver · 440c1544
      Daniel P. Berrange 提交于
      For historical compat we use 'itanium' as the arch name, so
      if the QEMU binary suffix is 'ia64' we need to translate it
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 3887afbb)
      440c1544
    • D
      Fix potential deadlock when agent is closed · eed4cb36
      Daniel P. Berrange 提交于
      If the qemuAgentClose method is called from a place which holds
      the domain lock, it is theoretically possible to get a deadlock
      in the agent destroy callback. This has not been observed, but
      the equivalent code in the QEMU monitor destroy callback has seen
      a deadlock.
      
      Remove the redundant locking while unrefing the object and the
      bogus assignment
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 362d0477)
      eed4cb36
    • D
      Fix (rare) deadlock in QEMU monitor callbacks · b635baf6
      Daniel P. Berrange 提交于
      Some users report (very rarely) seeing a deadlock in the QEMU
      monitor callbacks
      
       Thread 10 (Thread 0x7fcd11e20700 (LWP 26753)):
       #0  0x00000030d0e0de4d in __lll_lock_wait () from /lib64/libpthread.so.0
       #1  0x00000030d0e09ca6 in _L_lock_840 () from /lib64/libpthread.so.0
       #2  0x00000030d0e09ba8 in pthread_mutex_lock () from /lib64/libpthread.so.0
       #3  0x00007fcd162f416d in virMutexLock (m=<optimized out>)
           at util/threads-pthread.c:85
       #4  0x00007fcd1632c651 in virDomainObjLock (obj=<optimized out>)
           at conf/domain_conf.c:14256
       #5  0x00007fcd0daf05cc in qemuProcessHandleMonitorDestroy (mon=0x7fcccc0029e0,
           vm=0x7fcccc00a850) at qemu/qemu_process.c:1026
       #6  0x00007fcd0db01710 in qemuMonitorDispose (obj=0x7fcccc0029e0)
           at qemu/qemu_monitor.c:249
       #7  0x00007fcd162fd4e3 in virObjectUnref (anyobj=<optimized out>)
           at util/virobject.c:139
       #8  0x00007fcd0db027a9 in qemuMonitorClose (mon=<optimized out>)
           at qemu/qemu_monitor.c:860
       #9  0x00007fcd0daf61ad in qemuProcessStop (driver=driver@entry=0x7fcd04079d50,
           vm=vm@entry=0x7fcccc00a850,
           reason=reason@entry=VIR_DOMAIN_SHUTOFF_DESTROYED, flags=flags@entry=0)
           at qemu/qemu_process.c:4057
       #10 0x00007fcd0db323cf in qemuDomainDestroyFlags (dom=<optimized out>,
           flags=<optimized out>) at qemu/qemu_driver.c:1977
       #11 0x00007fcd1637ff51 in virDomainDestroyFlags (
           domain=domain@entry=0x7fccf00c1830, flags=1) at libvirt.c:2256
      
      At frame #10 we are holding the domain lock, we call into
      qemuProcessStop() to cleanup QEMU, which triggers the monitor
      to close, which invokes qemuProcessHandleMonitorDestroy() which
      tries to obtain the domain lock again. This is a non-recursive
      lock, hence hang.
      
      Since qemuMonitorPtr is a virObject, the unref call in
      qemuProcessHandleMonitorDestroy no longer needs mutex
      protection. The assignment of priv->mon = NULL, can be
      instead done by the caller of qemuMonitorClose(), thus
      removing all need for locking.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 25f582e3)
      b635baf6
    • D
      Don't skip over socket label cleanup · 14cf67e6
      Daniel P. Berrange 提交于
      If QEMU quits immediately after we opened the monitor it was
      possible we would skip the clearing of the SELinux process
      socket context
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 0b62c073)
      14cf67e6
    • D
      Don't ignore return value of qemuProcessKill · e37286da
      Daniel P. Berrange 提交于
      When calling qemuProcessKill from the virDomainDestroy impl
      in QEMU, do not ignore the return value. This ensures that
      if QEMU fails to respond to SIGKILL, the caller will know
      about the failure.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit f1b4021b)
      e37286da
    • D
      Fix deadlock in handling EOF in LXC monitor · 650a37fa
      Daniel P. Berrange 提交于
      Depending on the scenario in which LXC containers exit, it is
      possible for the EOF callback of the LXC monitor to deadlock
      the driver.
      
        #0  0x00000038a0a0de4d in __lll_lock_wait () from /lib64/libpthread.so.0
        #1  0x00000038a0a09ca6 in _L_lock_840 () from /lib64/libpthread.so.0
        #2  0x00000038a0a09ba8 in pthread_mutex_lock () from /lib64/libpthread.so.0
        #3  0x00007f4bd9579d55 in virMutexLock (m=<optimized out>) at util/threads-pthread.c:85
        #4  0x00007f4bcacc7597 in lxcDriverLock (driver=0x7f4bc40c8290) at lxc/lxc_conf.h:81
        #5  virLXCProcessMonitorEOFNotify (mon=<optimized out>, vm=0x7f4bb4000b00) at lxc/lxc_process.c:581
        #6  0x00007f4bd9645c91 in virNetClientCloseLocked (client=client@entry=0x7f4bb4009e60)
            at rpc/virnetclient.c:554
        #7  0x00007f4bd96460f8 in virNetClientIOEventLoopPassTheBuck (thiscall=0x0, client=0x7f4bb4009e60)
            at rpc/virnetclient.c:1306
        #8  virNetClientIOEventLoopPassTheBuck (client=0x7f4bb4009e60, thiscall=0x0)
            at rpc/virnetclient.c:1287
        #9  0x00007f4bd96467a2 in virNetClientCloseInternal (reason=3, client=0x7f4bb4009e60)
            at rpc/virnetclient.c:589
        #10 virNetClientCloseInternal (client=0x7f4bb4009e60, reason=3) at rpc/virnetclient.c:561
        #11 0x00007f4bcacc4a82 in virLXCMonitorClose (mon=0x7f4bb4000a00) at lxc/lxc_monitor.c:201
        #12 0x00007f4bcacc55ac in virLXCProcessCleanup (reason=<optimized out>, vm=0x7f4bb4000b00,
            driver=0x7f4bc40c8290) at lxc/lxc_process.c:240
        #13 virLXCProcessStop (driver=0x7f4bc40c8290, vm=vm@entry=0x7f4bb4000b00,
            reason=reason@entry=VIR_DOMAIN_SHUTOFF_DESTROYED) at lxc/lxc_process.c:735
        #14 0x00007f4bcacc5bd2 in virLXCProcessAutoDestroyDom (payload=<optimized out>,
            name=0x7f4bb4003c80, opaque=0x7fff41af2df0) at lxc/lxc_process.c:94
        #15 0x00007f4bd9586649 in virHashForEach (table=0x7f4bc409b270,
            iter=iter@entry=0x7f4bcacc5ab0 <virLXCProcessAutoDestroyDom>, data=data@entry=0x7fff41af2df0)
            at util/virhash.c:514
        #16 0x00007f4bcacc52d7 in virLXCProcessAutoDestroyRun (driver=driver@entry=0x7f4bc40c8290,
            conn=conn@entry=0x7f4bb8000ab0) at lxc/lxc_process.c:120
        #17 0x00007f4bcacca628 in lxcClose (conn=0x7f4bb8000ab0) at lxc/lxc_driver.c:128
        #18 0x00007f4bd95e67ab in virReleaseConnect (conn=conn@entry=0x7f4bb8000ab0) at datatypes.c:114
      
      When the driver calls virLXCMonitorClose, there is really no
      need for the EOF callback to be invoked in this case, since
      the caller can easily handle events itself. In changing this,
      the monitor needs to take a deep copy of the callback list,
      not merely a reference.
      
      Also adds debug statements in various places to aid
      troubleshooting
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 36c1fc18)
      650a37fa
    • J
      Support Xen sysctl version 9 in Xen 4.2 · 7e3dab4b
      Jim Fehlig 提交于
      Xen upstream c/s 24102:dc8e55c9 bumped the sysctl version to 9.
      Support this sysctl version in the xen_hypervisor sub-driver.
      (cherry picked from commit 371ddc98)
      7e3dab4b
    • E
      build: avoid older gcc warning · fdfb1869
      Eric Blake 提交于
      Jim Fehlig reported a compilation error with older gcc 4.3.4:
      
      libvirt.c: In function 'virDomainGetEmulatorPinInfo':
      libvirt.c:9111: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
      
      It looks like someone programmed via too much copy-and-paste.
      
      * src/libvirt.c (virDomainGetEmulatorPinInfo): Multiplying by 1 is
      a no-op, and thus will never overflow.
      (cherry picked from commit 3da355e8)
      fdfb1869
    • D
      parallels: don't give null pointers to virBitmapEqual · e8163274
      Dmitry Guryanov 提交于
      Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
      (cherry picked from commit adae5cf7)
      e8163274
    • D
      parallels: fix memory allocation · 3c860c40
      Dmitry Guryanov 提交于
      size of videos array must be increased.
      Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
      (cherry picked from commit 9ca569de)
      3c860c40
    • D
      Don't use O_TRUNC when opening QEMU logfiles · a8ad9396
      Daniel P. Berrange 提交于
      SELinux wants all log files opened with O_APPEND. When
      running non-root though, libvirtd likes to use O_TRUNC
      to avoid log files growing in size indefinitely. Instead
      of using O_TRUNC though, we can use O_APPEND and then
      call ftruncate() which keeps SELinux happier.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 639d5c49)
      a8ad9396
    • D
      Simplify some redundant locking while unref'ing objects · f4e3a2af
      Daniel P. Berrange 提交于
      There is no need to hold the mutex when unref'ing
      virObject instances
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 7307c3c0)
      f4e3a2af
    • D
      Remove pointless virLXCProcessMonitorDestroy method · c9791620
      Daniel P. Berrange 提交于
      Asynchronously setting priv->mon to NULL was pointless,
      just remove the destroy callback entirely.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit dd037176)
      c9791620
    • D
      Convert virLXCMonitor to use virObject · df2b4be5
      Daniel P. Berrange 提交于
      Remove custom reference counting from virLXCMonitor, using
      virObject instead
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 09e0cb42)
      df2b4be5
    • D
      Move virProcess{Kill,Abort,TranslateStatus} into virprocess.{c,h} · a05d4ca9
      Daniel P. Berrange 提交于
      Continue consolidation of process functions by moving some
      helpers out of command.{c,h} into virprocess.{c,h}
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 9467ab60)
      a05d4ca9
    • D
      Move virProcessKill into virprocess.{h,c} · a5cf2ef4
      Daniel P. Berrange 提交于
      There are a number of process related functions spread
      across multiple files. Start to consolidate them by
      creating a virprocess.{c,h} file
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit e5e2b65c)
      a5cf2ef4
    • D
      Rename virCommandTranslateStatus to virProcessTranslateStatus · 5292eed6
      Daniel P. Berrange 提交于
      The virCommand prefix was inappropriate because the API
      does not use any virCommandPtr object instance. This
      API closely related to waitpid/exit, so use virProcess
      as the prefix
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 49ecf8b4)
      5292eed6
    • D
      Rename virPid{Abort,Wait} to virProcess{Abort,Wait} · 88589de7
      Daniel P. Berrange 提交于
      Change "Pid" to "Process" to align with the virProcessKill
      API naming prefix
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 0fb58ef5)
      88589de7
    • D
      Rename virKillProcess to virProcessKill · 035d998f
      Daniel P. Berrange 提交于
      Changing naming to follow the convention of "object" followed
      by "action"
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit cf470068)
      035d998f
    • D
      Fix start of containers with custom root filesystem · 6b2a4e25
      Daniel P. Berrange 提交于
      A prefix change to unmount the SELinux filesystem broke starting
      of LXC containers with a custom root filesystem
      (cherry picked from commit 1532bd49)
      6b2a4e25
    • D
      Update how to compile with -Werror · b53782f1
      Doug Goldstein 提交于
      --enable-compile-warnings=error has been renamed to --enable-werror so
      update the HACKING and the hacking.html to reflect that.
      (cherry picked from commit 07cbb610)
      b53782f1
    • C
      build: fix detection of netcf linked with libnl1 · f35c18c7
      Christophe Fergeau 提交于
      Commit 9298bfbc introduced code to detect if netcf is linked with
      libnl1, and to prefer libnl1 over libnl3 when this is the case.
      This behaviour can be disabled by setting LIBNL_CFLAGS to any value,
      including the empty string.
      However, configure.ac sets LIBNL_CFLAGS to "" before attempting
      libnl detection, so the libnl1 detection code is always disabled.
      This caused issues on my f17 system where netcf is linked with libnl1
      but libvirt got built with libnl3.
      
      This commit removes the setting of the LIBNL_* variables to "" as
      this does not appear to be needed. After this change, libnl1 is
      used when building libvirt on my f17 system.
      (cherry picked from commit f6c29515)
      f35c18c7
    • R
      command: Change virCommandAddEnv so it replaces existing environment variables. · eeaa15b6
      Richard W.M. Jones 提交于
      (cherry picked from commit 2b32735a)
      eeaa15b6
    • R
      command: Move environ-adding code to common function virCommandAddEnv. · 94090184
      Richard W.M. Jones 提交于
      This is just code motion.  The semantics of the code should be
      identical after this change.
      (cherry picked from commit f644361b)
      94090184
  3. 24 9月, 2012 3 次提交