1. 27 9月, 2012 10 次提交
    • D
      Remove probing of flags when launching QEMU guests · 15ee6614
      Daniel P. Berrange 提交于
      Remove all use of the existing APIs for querying QEMU
      capability flags. Instead obtain a qemuCapsPtr object
      from the global cache. This avoids the execution of
      'qemu -help' (and related commands) when launching new
      guests.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      15ee6614
    • D
      Switch over to use cache for building QEMU capabilities · 494e2f5c
      Daniel P. Berrange 提交于
      When building up a virCapsPtr instance, the QEMU driver
      was copying the list of machine types across from the
      previous virCapsPtr instance, if the QEMU binary had not
      changed. Replace this ad-hoc caching of data with use
      of the new qemuCapsCache global cache.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      494e2f5c
    • D
      Add a qemu capabilities cache manager · 85a7b5e1
      Daniel P. Berrange 提交于
      Introduce a qemuCapsCachePtr object to provide a global cache
      of capabilities for QEMU binaries. The cache auto-populates
      on first request for capabilities about a binary, and will
      auto-refresh if the binary has changed since a previous cache
      was populated
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      85a7b5e1
    • D
      Fix handling of itanium arch name in QEMU driver · 3887afbb
      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>
      3887afbb
    • D
      Fix potential deadlock when agent is closed · 362d0477
      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>
      362d0477
    • D
      Use size_t instead of int for virDomainDefPtr struct · 5cbb0d37
      Daniel P. Berrange 提交于
      Many parts of virDomainDefPtr were using 'int' variables as
      array length counts. Replace all these with size_t and update
      various format strings & API signatures to adapt
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5cbb0d37
    • D
      Fix (rare) deadlock in QEMU monitor callbacks · 25f582e3
      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>
      25f582e3
    • D
      Don't skip over socket label cleanup · 0b62c073
      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>
      0b62c073
    • D
      Move most of qemuProcessKill into virProcessKillPainfully · 8fd38231
      Daniel P. Berrange 提交于
      In the cgroups APIs we have a virCgroupKillPainfully function
      which does the loop sending SIGTERM, then SIGKILL and waiting
      for the process to exit. There is similar functionality for
      simple processes in qemuProcessKill, but it is tangled with
      the QEMU code. Untangle it to provide a virProcessKillPainfuly
      function
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8fd38231
    • D
      Don't ignore return value of qemuProcessKill · f1b4021b
      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>
      f1b4021b
  2. 26 9月, 2012 5 次提交
  3. 25 9月, 2012 1 次提交
    • P
      qemu: Avoid holding the driver lock in trivial snapshot API's · 35fe4e7e
      Peter Krempa 提交于
      In most of the snapshot API's there's no need to hold the driver lock
      the whole time.
      
      This patch adds helper functions that get the domain object in functions
      that don't require the driver lock and simplifies call paths from
      snapshot-related API's.
      35fe4e7e
  4. 22 9月, 2012 1 次提交
  5. 21 9月, 2012 3 次提交
  6. 20 9月, 2012 4 次提交
    • M
      qemu: add support for dump-guest-core option · ff2d5a3d
      Martin Kletzander 提交于
      The "dump-guest-core' option is new option for the machine type
      (-machine pc,dump-guest-core) that controls whether the guest memory
      will be marked as dumpable.
      
      While testing this, I've found out that the value for the '-M' options
      is not parsed correctly when additional parameters are used. However,
      when '-machine' is used for the same options, it gets parsed as
      expected. That's why this patch also modifies the parsing and creating
      of the command line, so both '-M' and '-machine' are recognized. In
      QEMU's help there is only mention of the 'machine parameter now with
      no sign of the older '-M'.
      ff2d5a3d
    • M
      qemu: Add support for reboot-timeout · 94827a78
      Martin Kletzander 提交于
      This patch adds support for "-boot reboot-timeout=rb_time" that is
      added in QEMU.
      94827a78
    • M
      qemu: Cleanup boot parameter building · 8c952908
      Martin Kletzander 提交于
      This patch cleans up building the "-boot" parameter and while on that
      fixes one inconsistency by modifying these things:
      
       - I completed the unfinished virDomainBootMenu enum by specifying
         LAST, declaring it and also declaring the TypeFromString and
         TypeToString parameters.
       - Previously mentioned TypeFromString and TypeToString are used when
         parsing the XML.
       - Last, but not least, visible change is that the "-boot" parameter
         is built and parsed properly:
          - The "order=" prefix is used only when additional parameters are
            used (menu, etc.).
          - It's rewritten in a way that other parameters can be added
            easily in the future (used in following patch).
          - The "order=" parameter is properly parsed regardless to where it
            is placed in the string (e.g. "menu=on,order=nc").
          - The "menu=" parameter (and others in the future) are created
            when they should be (i.e. even when bootindex is supported and
            used, but not when bootloader is selected).
      8c952908
    • M
      qemu: Transition domain to PAUSED after 'stop' command · a5e8beef
      Michal Privoznik 提交于
      Currently, we mark domain PAUSED (but not emit an event)
      just before we issue 'stop' on monitor; This command can
      take ages to finish, esp. when domain's doing a lot of
      IO - users can enforce qemu to open files with O_DIRECT
      which doesn't return from write() until data reaches the
      block device. Having said that, we report PAUSED even if
      domain is not paused yet.
      a5e8beef
  7. 18 9月, 2012 16 次提交