• 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
qemu_monitor.c 10.7 KB