Re: [libvirt] [PATCH 0/11 v2] Add supports for three new QMP events

2012-03-19 Thread Osier Yang

ping.

On 03/14/2012 11:26 PM, Osier Yang wrote:

v1 ~ v2:
* Two more patches, [5/11] to prohibit tray='open' for
  block type disk. And [9/11] to introduce a new domain
  state 'pmsuspended'

* Definition (including name) for DEVICE_TRAY_MOVED event
  is changed into:

  typedef void
  (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
 virDomainPtr dom,
 const char *devAlias,
 int reason,
 void *opaque);

* Definition for both SUSPEND and WAKEUP event are changed,
  one more parameter 'int reason' for future extension.

* While SUSPEND event is emitted, the running domain will be
  transfered into the new domain state "pmsuspended", instead
  of "paused". And while WAKEUP is emitted, it will transfer
  the domain state to running only if the domain state is
  "pmsuspended".

This patch series adds support for 3 new QMP events: WAKEUP,
SUSPEND, and DEVICE_TRAY_MOVED, and related changes on domain's
conf and status.

[1/11]
   Add support for tray moved event

[2/11] ~ [6/11]:
   New attribute "tray" is added to disk target, it indicates
the tray status of removable disk, i.e. CDROM and Floppy disks,
its value could be either of "open" or "closed", defaults to
"closed", and a removable disk with tray == "open" won't have
the source when domain is started.  The value of "tray" will
be updated while tray moved event is emitted from guest.
   tray status 'open' is prohibited for block type disk.
   Prior to these patches, if the user ejected the medium of
removable disk from guest side, and then do migration or
save/restoring, the guest will still starts the medium source
,and thus the medium will still exists in guest, which is
strange. These patches fix it.

[7/11] + [11/11]:
   Add support for wakeup event, and update the domain status
to running if the domain is in pmsuspended state, while the wakeup
event is emitted.

[9/11]
   Introduce new domain state "pmsuspended", which indicates the
domain has been suspended by guest power management, e.g, entered
into s3 state.

[8/11] + [10/11]:
   Add support for suspend event, and update the domain status
to pmsuspended if the domain was running, while the suspend event
is emitted.

Osier Yang(11)
   Add support for event tray moved of removable disks
   docs: Add documentation for new attribute tray of disk target
   conf: Parse and for the tray attribute
   qemu: Do not start with source for removable disks if tray is open
   qemu: Prohibit setting tray status as open for block type disk
   qemu: Update tray status while tray moved event is emitted
   Add support for the wakeup event
   Add support for the suspend event
   New domain state pmsuspended
   qemu: Update domain state to pmsuspended while suspend event occurs
   qemu: Update domain status to running while wakeup event is emitted

  daemon/remote.c|   79 ++
  docs/formatdomain.html.in  |   13 ++-
  docs/schemas/domaincommon.rng  |8 +
  examples/domain-events/events-c/event-test.c   |   66 +-
  examples/domain-events/events-python/event-test.py |   12 ++
  include/libvirt/libvirt.h.in   |   98 -
  python/libvirt-override-virConnect.py  |   27 
  python/libvirt-override.c  |  150 
  src/conf/domain_conf.c |   71 --
  src/conf/domain_conf.h |9 ++
  src/conf/domain_event.c|  115 +++
  src/conf/domain_event.h|   10 ++
  src/libvirt_private.syms   |6 +
  src/qemu/qemu_command.c|   31 -
  src/qemu/qemu_monitor.c|   33 +
  src/qemu/qemu_monitor.h|   16 ++-
  src/qemu/qemu_monitor_json.c   |   45 ++
  src/qemu/qemu_process.c|  121 
  src/remote/remote_driver.c |   95 
  src/remote/remote_protocol.x   |   19 +++-
  src/remote_protocol-structs|   14 ++
  tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml |2 +-
  .../qemuxml2argv-boot-complex-bootindex.xml|6 +-
  .../qemuxml2argvdata/qemuxml2argv-boot-complex.xml |6 +-
  .../qemuxml2argvdata/qemuxml2argv-boot-floppy.xml  |2 +-
  ...uxml2argv-boot-menu-disable-drive-bootindex.xml |2 +-
  .../qemuxml2argv-boot-menu-disable-drive.xml   |2 +-
  .../qemuxml2argv-boot-menu-disable.xml |2 +-
  .../qemuxml2argv-boot-menu-enable.xml  |2 +-
  tests/qemuxml2ar

[libvirt] [PATCH 0/11 v2] Add supports for three new QMP events

2012-03-14 Thread Osier Yang
v1 ~ v2:
   * Two more patches, [5/11] to prohibit tray='open' for
 block type disk. And [9/11] to introduce a new domain
 state 'pmsuspended'

   * Definition (including name) for DEVICE_TRAY_MOVED event
 is changed into:

 typedef void
 (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *devAlias,
int reason,
void *opaque);

   * Definition for both SUSPEND and WAKEUP event are changed,
 one more parameter 'int reason' for future extension.

   * While SUSPEND event is emitted, the running domain will be
 transfered into the new domain state "pmsuspended", instead
 of "paused". And while WAKEUP is emitted, it will transfer
 the domain state to running only if the domain state is
 "pmsuspended".
 
This patch series adds support for 3 new QMP events: WAKEUP,
SUSPEND, and DEVICE_TRAY_MOVED, and related changes on domain's
conf and status.

[1/11]
  Add support for tray moved event

[2/11] ~ [6/11]:
  New attribute "tray" is added to disk target, it indicates
the tray status of removable disk, i.e. CDROM and Floppy disks,
its value could be either of "open" or "closed", defaults to
"closed", and a removable disk with tray == "open" won't have
the source when domain is started.  The value of "tray" will
be updated while tray moved event is emitted from guest.
  tray status 'open' is prohibited for block type disk.
  Prior to these patches, if the user ejected the medium of
removable disk from guest side, and then do migration or
save/restoring, the guest will still starts the medium source
,and thus the medium will still exists in guest, which is
strange. These patches fix it.

[7/11] + [11/11]:
  Add support for wakeup event, and update the domain status
to running if the domain is in pmsuspended state, while the wakeup
event is emitted.

[9/11]
  Introduce new domain state "pmsuspended", which indicates the
domain has been suspended by guest power management, e.g, entered
into s3 state.

[8/11] + [10/11]:
  Add support for suspend event, and update the domain status
to pmsuspended if the domain was running, while the suspend event
is emitted.

Osier Yang(11)
  Add support for event tray moved of removable disks
  docs: Add documentation for new attribute tray of disk target
  conf: Parse and for the tray attribute
  qemu: Do not start with source for removable disks if tray is open
  qemu: Prohibit setting tray status as open for block type disk
  qemu: Update tray status while tray moved event is emitted
  Add support for the wakeup event
  Add support for the suspend event
  New domain state pmsuspended
  qemu: Update domain state to pmsuspended while suspend event occurs
  qemu: Update domain status to running while wakeup event is emitted

 daemon/remote.c|   79 ++
 docs/formatdomain.html.in  |   13 ++-
 docs/schemas/domaincommon.rng  |8 +
 examples/domain-events/events-c/event-test.c   |   66 +-
 examples/domain-events/events-python/event-test.py |   12 ++
 include/libvirt/libvirt.h.in   |   98 -
 python/libvirt-override-virConnect.py  |   27 
 python/libvirt-override.c  |  150 
 src/conf/domain_conf.c |   71 --
 src/conf/domain_conf.h |9 ++
 src/conf/domain_event.c|  115 +++
 src/conf/domain_event.h|   10 ++
 src/libvirt_private.syms   |6 +
 src/qemu/qemu_command.c|   31 -
 src/qemu/qemu_monitor.c|   33 +
 src/qemu/qemu_monitor.h|   16 ++-
 src/qemu/qemu_monitor_json.c   |   45 ++
 src/qemu/qemu_process.c|  121 
 src/remote/remote_driver.c |   95 
 src/remote/remote_protocol.x   |   19 +++-
 src/remote_protocol-structs|   14 ++
 tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml |2 +-
 .../qemuxml2argv-boot-complex-bootindex.xml|6 +-
 .../qemuxml2argvdata/qemuxml2argv-boot-complex.xml |6 +-
 .../qemuxml2argvdata/qemuxml2argv-boot-floppy.xml  |2 +-
 ...uxml2argv-boot-menu-disable-drive-bootindex.xml |2 +-
 .../qemuxml2argv-boot-menu-disable-drive.xml   |2 +-
 .../qemuxml2argv-boot-menu-disable.xml |2 +-
 .../qemuxml2argv-boot-menu-enable.xml  |2 +-
 tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml |2 +-
 tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml |4 +-
 test