1. 19 10月, 2012 4 次提交
  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 4 次提交
  4. 22 9月, 2012 5 次提交
    • L
      network: log error for unknown virNetworkUpdate command codes · 5cdcb75d
      Laine Stump 提交于
      Every level of the code for virNetworkUpdate was assuming that some
      other level was checking for validity of the "command" arg, but none
      actually were. The result was that an invalid command code would do
      nothing, but also report success.
      
      Since the command code isn't used until the very lowest level backend
      functions, that's where I put the check. I made a separate one-line
      function to log the error. The compiler would have combined the
      identical strings used by multiple calls if I'd just called
      virReportError directly in each location, but sending them all to the
      same string in the source guards against inadvertant divergence (which
      would lead to extra work for translators.)
      5cdcb75d
    • L
      network: make virNetworkObjUpdate error detection/recovery better · f59e25e0
      Laine Stump 提交于
      1) virNetworkObjUpdate should be an all or none operation, but in the
      case that we want to update both the live state and persistent config
      versions of the network, it was committing the update to the live
      state before starting to update the persistent config. If update of
      the persistent config failed, we would leave with things in an
      inconsistent state - the live state would be updated (even though an
      error was returned), but persistent config unchanged.
      
      This patch changed virNetworkObjUpdate to use a separate pointer for
      each copy of the virNetworkDef, and not commit either of them in the
      virNetworkObj until both live and config parts of the update have
      successfully completed.
      
      2) The parsers for various pieces of the virNetworkDef have all sorts
      of subtle limitations on them that may not be known by the
      Update[section] function, making it possible for one of these
      functions to make a modification directly to the object that may not
      pass the scrutiny of a subsequent parse. But normally another parse
      wouldn't be done on the data until the *next* time the object was
      updated (which could leave the network definition in an unusable
      state).
      
      Rather than fighting the losing battle of trying to duplicate all the
      checks from the parsers into the update functions as well, the more
      foolproof solution to this is to simply do an extra
      virNetworkDefCopy() operation on the updated networkdef -
      virNetworkDefCopy() does a virNetworkFormat() followed by a
      virNetworkParseString(), so it will do all the checks we need. If this
      fails, then we don't commit the changed def.
      f59e25e0
    • L
      network: don't "refresh" iptables rules on rule-less networks · 36ba0ee7
      Laine Stump 提交于
      The bridge driver implementation of virNetworkUpdate() removes and
      re-adds iptables rules any time a network has an <ip>, <forward>, or
      <forward>/<interface> element updated. There are some types of
      networks that have those elements and yet have no iptables rules
      associated with them, and unfortunately the functions that remove/add
      iptables rules don't check the type of network before attempting to
      remove/add the rules, sometimes leading to an erroneous failure of the
      entire update operation.
      
      Under normal circumstances I would refactor the lower level functions
      to be more robust, but to avoid code churn as much as possible, I've
      just added extra checks directly to networkUpdate().
      36ba0ee7
    • M
      Drop unused return value of virLogOutputFunc · fca338a0
      Miloslav Trmač 提交于
      Nothing uses the return value, and creating it requries otherwise
      unnecessary strlen () calls.
      
      This cleanup is conceptually independent from the rest of the series
      (although the later patches won't apply without it).  This just seems
      a good opportunity to clean this up, instead of entrenching the unnecessary
      return value in the virLogOutputFunc instance that will be added in this
      series.
      Signed-off-by: NMiloslav Trmač <mitr@redhat.com>
      fca338a0
    • T
      Remove redundant lines in src/qemu/qemu_driver.c · 9ce64e6a
      Tang Chen 提交于
      maxcpu and hostcpus are defined and calculated in qemudDomainPinVcpuFlags()
      and qemudDomainPinEmulator(), but never used. So remove them including nodeinfo.
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      9ce64e6a
  5. 21 9月, 2012 3 次提交