1. 10 11月, 2009 10 次提交
    • D
      Add reference counting on virDomainObjPtr objects · a340f913
      Daniel P. Berrange 提交于
      Add reference counting on the virDomainObjPtr objects. With the
      forthcoming asynchronous QEMU monitor, it will be neccessary to
      release the lock on virDomainObjPtr while waiting for a monitor
      command response. It is neccessary to ensure one thread can't
      delete a virDomainObjPtr while another is waiting. By introducing
      reference counting threads can make sure objects they are using
      are not accidentally deleted while unlocked.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Add
        virDomainObjRef/Unref APIs, remove virDomainObjFree
      * src/openvz/openvz_conf.c: replace call to virDomainObjFree
        with virDomainObjUnref
      a340f913
    • 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
    • D
      Add a new timed condition variable wait API · e40438fa
      Daniel P. Berrange 提交于
      * src/util/threads.h, src/util/threads-pthread.c,
        src/libvirt_private.syms: Add virCondWaitUntil()
      e40438fa
    • D
      Fix errno handling for pthreads wrappers · 15a91446
      Daniel P. Berrange 提交于
      * src/util/threads-pthread.c: pthreads APIs do not set errno, instead
        the return value is the positive errno. Set errno based on the return
        value in the wrappers
      15a91446
    • D
      Make pciDeviceList struct opaque · dd9e9c3b
      Daniel P. Berrange 提交于
      * src/util/pci.c, src/util/pci.h: Make the pciDeviceList struct
        opaque to callers of the API. Add accessor methods for managing
        devices in the list
      * src/qemu/qemu_driver.c: Update to use APIs instead of directly
        accessing pciDeviceList fields
      dd9e9c3b
    • M
      Add missing OOM error checks, reports and cleanups · 790f0b30
      Matthias Bolte 提交于
      790f0b30
  2. 09 11月, 2009 3 次提交
  3. 08 11月, 2009 2 次提交
  4. 07 11月, 2009 12 次提交
  5. 06 11月, 2009 12 次提交
  6. 05 11月, 2009 1 次提交
    • M
      Ensure guestfwd address is IPv4 and various cleanups · 3023ec5e
      Matthew Booth 提交于
      * include/libvirt/virterror.h src/util/virterror.c: add a new error
        VIR_ERR_CONFIG_UNSUPPORTED for valid but unsupported configuration options
      * src/conf/domain_conf.c: Throw an error if guestfwd address isn't IPv4
        and cleanup a number of parsing return error values.
      3023ec5e