1. 15 4月, 2016 1 次提交
  2. 22 3月, 2016 4 次提交
  3. 01 3月, 2016 1 次提交
    • M
      qemu: Shorten per-domain directory names · a89f05ba
      Martin Kletzander 提交于
      Per-domain directories were introduced in order to be able to
      completely separate security labels for each domain (commit
      f1f68ca3).  However when the domain
      name is long (let's say a ridiculous 110 characters), we cannot
      connect to the monitor socket because on length of UNIX socket address
      is limited.  In order to get around this, let's shorten it in similar
      fashion and in order to avoid conflicts, throw in an ID there as well.
      Also save that into the status XML and load the old status XMLs
      properly (to clean up after older domains).  That way we can change it
      in the future.
      
      The shortening can be seen in qemuxml2argv tests, for example in the
      hugepages-pages2 case.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a89f05ba
  4. 19 2月, 2016 3 次提交
    • J
      qemu: Avoid calling qemuProcessStop without a job · 81f50cb9
      Jiri Denemark 提交于
      Calling qemuProcessStop without a job opens a way to race conditions
      with qemuDomainObjExitMonitor called in another thread. A real world
      example of such a race condition:
      
        - migration thread (A) calls qemuMigrationWaitForSpice
        - another thread (B) starts processing qemuDomainAbortJob API
        - thread B signals thread A via qemuDomainObjAbortAsyncJob
        - thread B enters monitor (qemuDomainObjEnterMonitor)
        - thread B calls qemuMonitorSend
        - thread A awakens and calls qemuProcessStop
        - thread A calls qemuMonitorClose and sets priv->mon to NULL
        - thread B calls qemuDomainObjExitMonitor with priv->mon == NULL
        => monitor stays ref'ed and locked
      
      Depending on how lucky we are, the race may result in a memory leak or
      it can even deadlock libvirtd's event loop if it tries to lock the
      monitor to process an event received before qemuMonitorClose was called.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      81f50cb9
    • J
      qemu: Introduce qemuProcessBeginStopJob · 4d0c535a
      Jiri Denemark 提交于
      When destroying a domain we need to make sure we will be able to start a
      job no matter what other operations are running or even stuck in a job.
      This is done by killing the domain before starting the destroy job.
      
      Let's introduce qemuProcessBeginStopJob which combines killing a domain
      and starting a job in a single API which can be called everywhere we
      need a job to stop a domain.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      4d0c535a
    • J
      qemu: Pass async job to qemuProcessInit · b7a948be
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      b7a948be
  5. 11 2月, 2016 1 次提交
    • M
      qemu: Connect to guest agent iff needed · 88ed9d77
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1293351
      
      Since we already have virtio channel events, we know when guest
      agent within guest has (dis-)connected. Instead of us blindly
      connecting to a socket that no one is listening to, we can just
      follow what qemu-ga does. This has a nice benefit that we don't
      need to 'guest-ping' the agent just to timeout and find out
      nobody is listening.
      
      The way that this commit is implemented:
      - don't connect in qemuProcessLaunch directly, defer that to event
        callback (which already follows the agent) -
        processSerialChangedEvent
      - after migration is settled, before we resume vCPUs, ask qemu
        whether somebody is listening on the socket and if so, connect
        to it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      88ed9d77
  6. 09 2月, 2016 2 次提交
    • P
      qemu: iothread: Aggregate code to set IOThread tuning · 1dcc4c7f
      Peter Krempa 提交于
      Rather than iterating 3 times for various settings this function
      aggregates all the code into single place. One of the other advantages
      is that it can then be reused for properly setting IOThread info on
      hotplug.
      1dcc4c7f
    • P
      qemu: vcpu: Aggregate code to set vCPU tuning · 56971667
      Peter Krempa 提交于
      Rather than iterating 3 times for various settings this function
      aggregates all the code into single place. One of the other advantages
      is that it can then be reused for properly setting vCPU info on hotplug.
      
      With this approach autoCpuset is also used when setting the process
      affinity rather than just via cgroups.
      56971667
  7. 08 2月, 2016 1 次提交
  8. 01 2月, 2016 1 次提交
  9. 08 1月, 2016 1 次提交
  10. 26 11月, 2015 2 次提交
    • D
      qemu: convert monitor to use qemuDomainLogContextPtr indirectly · a48539c0
      Daniel P. Berrange 提交于
      Currently the QEMU monitor is given an FD to the logfile. This
      won't work in the future with virtlogd, so it needs to use the
      qemuDomainLogContextPtr instead, but it shouldn't directly
      access that object either. So define a callback that the
      monitor can use for reporting errors from the log file.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a48539c0
    • D
      qemu: unify code for reporting errors from QEMU log files · 69b09921
      Daniel P. Berrange 提交于
      There are two pretty similar functions qemuProcessReadLog and
      qemuProcessReadChildErrors. Both read from the QEMU log file
      and try to strip out libvirt messages. The latter then reports
      an error, while the former lets the callers report an error.
      
      Re-write qemuProcessReadLog so that it uses a single read
      into a dynamically allocated buffer. Then introduce a new
      qemuProcessReportLogError that calls qemuProcessReadLog
      and reports an error.
      
      Convert all callers to use qemuProcessReportLogError.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      69b09921
  11. 25 11月, 2015 3 次提交
  12. 19 11月, 2015 3 次提交
    • J
      qemu: Use -incoming defer for migrations · 2c4ba8b4
      Jiri Denemark 提交于
      Traditionally, we pass incoming migration URI on QEMU command line,
      which has some drawbacks. Depending on the URI QEMU may initialize its
      migration state immediately without giving us a chance to set any
      additional migration parameters (this applies mainly for fd: URIs). For
      some URIs the monitor may be completely blocked from the beginning until
      migration is finished, which means we may be stuck in qmp_capabilities
      command without being able to send any QMP commands.
      
      QEMU solved this by introducing "defer" parameter for -incoming command
      line option. This will tell QEMU to prepare for an incoming migration
      while the actual incoming URI is sent using migrate-incoming QMP
      command. Before calling this command we can normally talk to the
      monitor and even set any migration parameters which will be honored by
      the incoming migration.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      2c4ba8b4
    • J
      qemu: Always set async job when starting a domain · 04c721f2
      Jiri Denemark 提交于
      We only started an async job for incoming migration from another host.
      When we were starting a domain from scratch or restoring from a saved
      state (migration from file) we didn't set any async job. Let's introduce
      a new QEMU_ASYNC_JOB_START for these cases.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      04c721f2
    • J
      qemu: Introduce qemuProcessIncomingDef · 2bf5333f
      Jiri Denemark 提交于
      Incoming migration may require quite a few parameters (URI, fd, path) to
      be considered while starting QEMU and we will soon add another one.
      Let's group all of them in a single struct.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      2bf5333f
  13. 26 4月, 2015 1 次提交
    • P
      qemu: Connect to guest agent after channel hotplug · a03e2d3a
      Peter Krempa 提交于
      If a user hot-attaches the guest agent channel libvirt would ignore it
      until the restart of libvirtd or shutdown/destroy and start of the VM
      itself.
      
      This patch adds code that opens or closes the guest agent connection
      according to the state of the guest agent channel according to
      connect/disconnect events.
      
      To allow opening the channel from the event handler qemuConnectAgent
      needed to be exported.
      a03e2d3a
  14. 02 4月, 2015 1 次提交
  15. 16 3月, 2015 1 次提交
  16. 03 3月, 2015 1 次提交
  17. 12 2月, 2015 1 次提交
  18. 14 8月, 2014 1 次提交
  19. 25 6月, 2014 1 次提交
    • J
      qemu: enum cleanups in "src/qemu/*" · aa990efe
      Julio Faracco 提交于
      As we are doing with the enum structures, a cleanup in "src/qemu/"
      directory was done now. All the enums that were defined in the
      header files were converted to typedefs in this directory. This
      patch includes all the adjustments to remove conflicts when you do
      this kind of change. "Enum-to-typedef"'s conversions were made in
      "src/qemu/qemu_{capabilities, domain, migration, hotplug}.h".
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      aa990efe
  20. 06 5月, 2014 1 次提交
  21. 25 9月, 2013 1 次提交
  22. 26 8月, 2013 1 次提交
  23. 03 7月, 2013 1 次提交
  24. 17 5月, 2013 1 次提交
  25. 28 2月, 2013 1 次提交
  26. 21 2月, 2013 1 次提交
    • O
      qemu: Merge qemuCheckSharedDisk into qemuAddSharedDisk · 371df778
      Osier Yang 提交于
      Based on moving various checking into qemuAddSharedDisk, this
      avoids the caller using it in wrong ways. Also this adds two
      new checking for qemuCheckSharedDisk (disk device not 'lun'
      and kernel doesn't support unpriv_sgio simply returns 0).
      371df778
  27. 13 2月, 2013 1 次提交
    • D
      Remove qemuDriverLock from almost everywhere · a9e97e0c
      Daniel P. Berrange 提交于
      With the majority of fields in the virQEMUDriverPtr struct
      now immutable or self-locking, there is no need for practically
      any methods to be using the QEMU driver lock. Only a handful
      of helper APIs in qemu_conf.c now need it
      a9e97e0c
  28. 11 2月, 2013 1 次提交
  29. 05 2月, 2013 1 次提交
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d