1. 17 10月, 2012 1 次提交
    • M
      qemu: Pin the emulator when only cpuset is specified · ba63d8f7
      Martin Kletzander 提交于
      According to our recent changes (clarifications), we should be pinning
      qemu's emulator processes using the <vcpu> 'cpuset' attribute in case
      there is no <emulatorpin> specified.  This however doesn't work
      entirely as expected and this patch should resolve all the remaining
      issues.
      ba63d8f7
  2. 15 10月, 2012 2 次提交
    • M
      Add support for SUSPEND_DISK event · 7ba5defb
      Martin Kletzander 提交于
      This patch adds support for SUSPEND_DISK event; both lifecycle and
      separated.  The support is added for QEMU, machines are changed to
      PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes
      to shut-off.  This and much more needs to be done in order for libvirt
      to work with transient devices, wake-ups etc.  This patch is not
      aiming for that functionality.
      7ba5defb
    • O
      qemu: Ignore def->cpumask if emulatorpin is specified · 3635b41e
      Osier Yang 提交于
      If the vcpu placement is "static", it's just fine to ignore the
      def->cpumask if emulatorpin is specified.
      3635b41e
  3. 12 10月, 2012 1 次提交
  4. 11 10月, 2012 3 次提交
  5. 27 9月, 2012 6 次提交
    • D
      Move command/event capabilities detection out of QEMU monitor code · 1b21351b
      Daniel P. Berrange 提交于
      The qemuMonitorSetCapabilities() API is used to initialize the QMP
      protocol capabilities. It has since been abused to initialize some
      libvirt internal capabilities based on command/event existance too.
      Move the latter code out into qemuCapsProbeQMP() in the QEMU
      capabilities source file instead
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1b21351b
    • 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
      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
      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
  6. 26 9月, 2012 2 次提交
  7. 21 9月, 2012 1 次提交
  8. 20 9月, 2012 1 次提交
    • 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
  9. 18 9月, 2012 6 次提交
  10. 13 9月, 2012 1 次提交
    • D
      Turn QEMU capabilities object into a full virObjectPtr · beac09fd
      Daniel P. Berrange 提交于
      The current qemu capabilities are stored in a virBitmapPtr
      object, whose type is exposed to callers. We want to store
      more data besides just the flags, so we need to move to a
      struct type. This object will also need to be reference
      counted, since we'll be maintaining a cache of data per
      binary. This change introduces a 'qemuCapsPtr' virObject
      class. Most of the change is just renaming types and
      variables in all the callers
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      beac09fd
  11. 07 9月, 2012 1 次提交
  12. 04 9月, 2012 1 次提交
    • J
      qemu: Fix reboot with guest agent · 03c42a45
      Jiri Denemark 提交于
      When reboot using qemu guest agent was requested, qemu driver kept
      waiting for SHUTDOWN event from qemu. However, such event is never
      emitted during guest reboot and qemu driver would keep waiting forever.
      03c42a45
  13. 31 8月, 2012 1 次提交
    • M
      qemu: fix remote port searching · b805e342
      Martin Kletzander 提交于
      After fixing the last review comments on remote port searching (commit
      a14b4aea), the commit right after that
      wasn't modified accordingly, therefore two values weren't changed as
      they should and the configurable ports don't work as expected.
      
      This simple commit changes last two values missed and fixes the issue.
      b805e342
  14. 27 8月, 2012 1 次提交
    • M
      qemu: fix regression with spice tls port allocation · 340196c4
      Martin Kletzander 提交于
      In my quest for reusing variables I failed to edit one variable when
      fixing details between two patch versions. That results in a failure
      to start qemu with autoport and spice tls, because qemu is trying to
      bind two sockets to the same port.
      340196c4
  15. 22 8月, 2012 2 次提交
  16. 21 8月, 2012 5 次提交
    • M
      qemu: modify 3 error messages · 0c0a8c9f
      Martin Kletzander 提交于
      After the cleanup of remote display port allocation, I noticed some
      messages that didn't make a lot of sense the way they were written. So
      I rephrased them.
      0c0a8c9f
    • M
      qemu: configurable remote display port boundaries · 29226bee
      Martin Kletzander 提交于
      The defines QEMU_REMOTE_PORT_MIN and QEMU_REMOTE_PORT_MAX were used to
      find free port when starting domains. As this was hard-coded to the
      same ports as default VNC servers, there were races with these other
      programs. This patch includes the possibility to change the default
      starting port as well as the maximum port (mostly for completeness) in
      qemu config file.
      
      Support for two new config options in qemu.conf is added:
       - remote_port_min (defaults to QEMU_REMOTE_PORT_MIN and
         must be >= than this value)
       - remote_port_max (defaults to QEMU_REMOTE_PORT_MAX and
         must be <= than this value)
      29226bee
    • M
      qemu: Unify port-wise SPICE and VNC behavior · a14b4aea
      Martin Kletzander 提交于
      Port allocations for SPICE and VNC behave almost the same (with
      default ports), but there is some mess in the code. This patch clears
      these inconsistencies and makes sure the same behavior will be used
      when ports for remote displays are changed.
      
      Changes:
       - hard-coded number 5900 removed (handled elsewhere like with VNC)
       - reservedVNCPorts renamed to reservedRemotePorts (it's not just for
         VNC anymore)
       - QEMU_VNC_PORT_{MIN,MAX} renamed to QEMU_REMOTE_PORT_{MIN,MAX}
       - port allocation unified for VNC and SPICE
      a14b4aea
    • M
      Update security layer to handle many security labels · a994ef2d
      Marcelo Cerri 提交于
      These changes make the security drivers able to find and handle the
      correct security label information when more than one label is
      available. They also update the DAC driver to be used as an usual
      security driver.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      a994ef2d
    • M
      Internal refactory of data structures · 6c3cf57d
      Marcelo Cerri 提交于
      This patch updates the structures that store information about each
      domain and each hypervisor to support multiple security labels and
      drivers. It also updates all the remaining code to use the new fields.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      6c3cf57d
  17. 08 8月, 2012 1 次提交
    • G
      qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers · 015c603b
      Guannan Ren 提交于
      Rename qemuDefaultScsiControllerModel to qemuCheckScsiControllerModel.
      When scsi model is given explicitly in XML(model > 0) checking if the
      underlying QEMU supports it or not first, raise an error on checking
      failure.
      When the model is not given(mode <= 0), return LSI by default, if
      the QEMU doesn't support it, raise an error.
      015c603b
  18. 07 8月, 2012 2 次提交
    • D
      Turn virDomainObjPtr into a virObjectPtr · 31cb030a
      Daniel P. Berrange 提交于
      Switch virDomainObjPtr to use the virObject APIs for reference
      counting. The main change is that virObjectUnref does not return
      the reference count, merely a bool indicating whether the object
      still has any refs left. Checking the return value is also not
      mandatory.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      31cb030a
    • D
      Convert public datatypes to inherit from virObject · 46ec5f85
      Daniel P. Berrange 提交于
      This converts the following public API datatypes to use the
      virObject infrastructure:
      
        virConnectPtr
        virDomainPtr
        virDomainSnapshotPtr
        virInterfacePtr
        virNetworkPtr
        virNodeDevicePtr
        virNWFilterPtr
        virSecretPtr
        virStreamPtr
        virStorageVolPtr
        virStoragePoolPtr
      
      The code is significantly simplified, since the mutex in the
      virConnectPtr object now only needs to be held when accessing
      the per-connection virError object instance. All other operations
      are completely lock free.
      
      * src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
        public datatypes to use virObject
      * src/conf/domain_event.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/storage/storage_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
        tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
        to use virObjectUnref/virObjectRef
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      46ec5f85
  19. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  20. 21 7月, 2012 1 次提交
    • D
      Only enforce check for YAJL when starting a VM · 33998759
      Daniel P. Berrange 提交于
      The previous check for YAJL would have many undesirable
      consequences, the most important being that it caused the
      capabilities XML to lose all <guest> elements. There is
      no user visible feedback as to what is wrong in this respect,
      merely a syslog message. The empty capabilities causes
      libvirtd to then throw away all guest XML configs that are
      stored.
      
      This changes the code so that the check for YAJL is only
      performed at the time we attempt to spawn a QEMU process
      
      error: Failed to start domain vm-vnc
      error: unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      33998759