1. 08 12月, 2009 1 次提交
    • D
      Fix crash when deleting monitor while a command is in progress · 79533da1
      Daniel P. Berrange 提交于
      If QEMU shuts down while we're in the middle of processing a
      monitor command, the monitor will be freed, and upon cleaning
      up we attempt to do  qemuMonitorUnlock(priv->mon) when priv->mon
      is NULL.
      
      To address this we introduce proper reference counting into
      the qemuMonitorPtr object, and hold an extra reference whenever
      executing a command.
      
      * src/qemu/qemu_driver.c: Hold a reference on the monitor while
        executing commands, and only NULL-ify the priv->mon field when
        the last reference is released
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add reference
        counting to handle safe deletion of monitor objects
      79533da1
  2. 10 11月, 2009 6 次提交
    • D
      Fully asynchronous monitor I/O processing · 1dc10a7b
      Daniel P. Berrange 提交于
      Change the QEMU monitor file handle watch to poll for both
      read & write events, as well as EOF. All I/O to/from the
      QEMU monitor FD is now done in the event callback thread.
      
      When the QEMU driver needs to send a command, it puts the
      data to be sent into a qemuMonitorMessagePtr object instance,
      queues it for dispatch, and then goes to sleep on a condition
      variable. The event thread sends all the data, and then waits
      for the reply to arrive, putting the response / error data
      back into the qemuMonitorMessagePtr and notifying the condition
      variable.
      
      There is a temporary hack in the disk passphrase callback to
      avoid acquiring the domain lock.  This avoids a deadlock in
      the command processing, since the domain lock is still held
      when running monitor commands. The next commit will remove
      the locking when running commands & thus allow re-introduction
      of locking the disk passphrase callback
      
      * src/qemu/qemu_driver.c: Temporarily don't acquire lock in
        disk passphrase callback. To be reverted in next commit
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Remove
        raw I/O functions, and a generic qemuMonitorSend() for
        invoking a command
      * src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Remove all low level I/O, and use the new qemuMonitorSend()
        API. Provide a qemuMonitorTextIOProcess() method for detecting
        command/reply/prompt boundaries in the monitor data stream
      1dc10a7b
    • D
      Locking of the qemuMonitorPtr object · 77cfcccf
      Daniel P. Berrange 提交于
      In preparation of the monitor I/O process becoming fully asynchronous,
      it is neccessary to ensure all access to internals of the qemuMonitorPtr
      object is protected by a mutex lock.
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add mutex for locking
        monitor.
      * src/qemu/qemu_driver.c: Add locking around all monitor commands
      77cfcccf
    • D
      Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs · 41d8968d
      Daniel P. Berrange 提交于
      Change the QEMU driver to not directly invoke the text mode monitor
      APIs. Instead add a generic wrapper layer, which will eventually
      invoke either the text or JSON protocol code as needed. Pass an
      qemuMonitorPtr object into the monitor APIs instead of virDomainObjPtr
      to complete the de-coupling of the monitor impl from virDomainObj
      data structures
      
      * src/qemu/qemu_conf.h: Remove qemuDomainObjPrivate definition
      * src/qemu/qemu_driver.c: Add qemuDomainObjPrivate definition.
        Pass qemuMonitorPtr into all monitor APIs instead of the
        virDomainObjPtr instance.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add thin
        wrappers for all qemuMonitorXXX command APIs, calling into
        qemu_monitor_text.c/h
      * src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Rename qemuMonitor -> qemuMonitorText & update to accept
        qemuMonitorPtr instead of virDomainObjPtr
      41d8968d
    • D
      Move encryption lookup back into qemu driver file · 4604c18f
      Daniel P. Berrange 提交于
      Decouple the monitor code from the virDomainDefPtr structure
      by moving the disk encryption lookup code back into the
      qemu_driver.c file. Instead provide a function callback to
      the monitor code which can be invoked to retrieve encryption
      data as required.
      
      * src/qemu/qemu_driver.c: Add findDomainDiskEncryption,
        and findVolumeQcowPassphrase. Pass address of the method
        findVolumeQcowPassphrase into qemuMonitorOpen()
      * src/qemu/qemu_monitor.c: Associate a disk
        encryption function callback with the qemuMonitorPtr
        object.
      * src/qemu/qemu_monitor_text.c: Remove findDomainDiskEncryption
        and findVolumeQcowPassphrase.
      4604c18f
    • D
      Make use of private data structure for monitor state · 1cfd5a00
      Daniel P. Berrange 提交于
      Introduce a new qemuDomainObjPrivate object which is used to store
      the private QEMU specific data associated with each virDomainObjPtr
      instance. This contains a single member, an instance of the new
      qemuMonitorPtr object which encapsulates the QEMU monitor state.
      The internals of the latter are private to the qemu_monitor* files,
      not to be shown to qemu_driver.c
      
      * src/qemu/qemu_conf.h: Definition of qemuDomainObjPrivate.
      * src/qemu/qemu_driver.c: Register a functions for creating
        and freeing qemuDomainObjPrivate instances with the domain
        capabilities. Remove the qemudDispatchVMEvent() watch since
        I/O watches are now handled by the monitor code itself. Pass
        a new qemuHandleMonitorEOF() callback into qemuMonitorOpen
        to allow notification when the monitor quits.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Introduce
        the 'qemuMonitor' object. Temporarily add new APIs
        qemuMonitorWrite, qemuMonitorRead, qemuMonitorWaitForInput
        to allow text based monitor impl to perform I/O.
      * src/qemu/qemu_monitor_text.c: Call APIs for reading/writing
        to monitor instead of accessing the file handle directly.
      1cfd5a00
    • D
      Move code for low level QEMU monitor interaction into separate file · ff261941
      Daniel P. Berrange 提交于
      The qemu_driver.c code should not contain any code that interacts
      with the QEMU monitor at a low level. A previous commit moved all
      the command invocations out. This change moves out the code which
      actually opens the monitor device.
      
      * src/qemu/qemu_driver.c: Remove qemudOpenMonitor & methods called
        from it.
      * src/Makefile.am: Add qemu_monitor.{c,h}
      * src/qemu/qemu_monitor.h: Add qemuMonitorOpen()
      * src/qemu/qemu_monitor.c: All code for opening the monitor
      ff261941
  3. 21 9月, 2009 1 次提交
    • D
      Move network driver into src/network · acfe3f26
      Daniel P. Berrange 提交于
      * daemon/qemud.c, src/Makefile.am: Adapt for changed paths
      * src/network_driver.c: Rename to src/network/bridge_driver.c
      * src/network_driver.h: Rename to src/network/bridge_driver.h
      acfe3f26
  4. 10 10月, 2008 1 次提交
  5. 21 8月, 2008 1 次提交
  6. 08 2月, 2008 1 次提交
    • M
      Fix gcc-4.3.0 "inlining failed" warning. · 3da5504e
      Mark McLoughlin 提交于
      * src/internal.h: move xstrol() variants from here ...
      
      * src/util.[ch]: ... to here and rename to virStrToLong()
      
      * src/libvirt_sym.version: export __virStrToLong_i() for
      virsh and qemud.
      
      * src/nodeinfo.c, src/stats_linux.c, src/virsh.c,
        src/xend_internal.c, qemud/qemud.c: replace xstrtol()
      calls with virStrToLong()
      
      * src/nodeinfo.h: don't include internal.h, which was only
      needed for xstrtol(), but instead include libvirt.h which
      is suffificient for the declarations in the header.
      3da5504e
  7. 26 7月, 2007 1 次提交
  8. 29 6月, 2007 1 次提交
  9. 27 6月, 2007 10 次提交
  10. 16 3月, 2007 1 次提交
  11. 23 2月, 2007 2 次提交
  12. 15 2月, 2007 1 次提交
    • M
      Tue Feb 14 16:17:51 IST 2007 Mark McLoughlin <markmc@redhat.com> · 8356c43e
      Mark McLoughlin 提交于
              * include/libvirt/libvirt.h.in, src/libvirt.c: add
              virNetworkGetBridgeName() to allow finding out what
              bridge to connect to in order to join a network.
      
              * src/driver.h: add networkGetBridgeName() to vtable.
      
              * qemud/protocol.h: add the request and reply to
              the qemud protocol.
      
              * qemud/dispatch.c, qemud/driver.[ch]: handle them
              here.
      
              * src/qemu_internal.c: implement GetBridgeName()
              in the qemu driver.
      
              * src/libvirt_sym.version: add new symbol.
      8356c43e
  13. 14 2月, 2007 2 次提交