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 +- tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml | 2 +- .../qemuxml2argv-disk-cdrom-empty.xml | 2 +- ...qemuxml2argv-disk-cdrom-tray-no-device-cap.args | 4 + .../qemuxml2argv-disk-cdrom-tray-no-device-cap.xml | 32 ++++ .../qemuxml2argv-disk-cdrom-tray.args | 10 ++ .../qemuxml2argv-disk-cdrom-tray.xml | 43 ++++++ tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml | 2 +- .../qemuxml2argv-disk-copy_on_read.xml | 2 +- .../qemuxml2argv-disk-drive-boot-cdrom.xml | 2 +- .../qemuxml2argv-disk-drive-boot-disk.xml | 2 +- .../qemuxml2argv-disk-drive-cache-directsync.xml | 2 +- .../qemuxml2argv-disk-drive-cache-unsafe.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v1-none.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wb.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wt.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v2-none.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wb.xml | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wt.xml | 2 +- ...muxml2argv-disk-drive-error-policy-enospace.xml | 2 +- .../qemuxml2argv-disk-drive-error-policy-stop.xml | 2 +- ...rgv-disk-drive-error-policy-wreport-rignore.xml | 2 +- .../qemuxml2argv-disk-drive-fmt-qcow.xml | 2 +- .../qemuxml2argv-disk-drive-no-boot.xml | 4 +- .../qemuxml2argv-disk-drive-readonly-disk.xml | 2 +- .../qemuxml2argv-disk-drive-readonly-no-device.xml | 2 +- .../qemuxml2argv-disk-drive-shared.xml | 2 +- ...emuxml2argv-disk-floppy-tray-no-device-cap.args | 4 + ...qemuxml2argv-disk-floppy-tray-no-device-cap.xml | 37 +++++ .../qemuxml2argv-disk-floppy-tray.args | 10 ++ .../qemuxml2argv-disk-floppy-tray.xml | 37 +++++ .../qemuxml2argvdata/qemuxml2argv-disk-floppy.xml | 4 +- .../qemuxml2argv-disk-ioeventfd.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml | 2 +- .../qemuxml2argv-disk-snapshot.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-virtio.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml | 2 +- .../qemuxml2argv-floppy-drive-fat.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-lease.xml | 2 +- .../qemuxml2argv-net-bandwidth.xml | 2 +- tests/qemuxml2argvtest.c | 6 + .../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +- tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 2 +- tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 2 +- tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 2 +- tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 2 +- tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 8 +- tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 4 +- tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml | 2 +- tests/vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml | 2 +- tests/vmx2xmldata/vmx2xml-floppy-device.xml | 2 +- tests/vmx2xmldata/vmx2xml-floppy-file.xml | 2 +- tests/vmx2xmldata/vmx2xml-ws-in-the-wild-1.xml | 2 +- tests/vmx2xmldata/vmx2xml-ws-in-the-wild-2.xml | 2 +- tools/virsh.c | 12 ++ tools/virsh.pod | 7 +- 89 files changed, 1277 insertions(+), 99 deletions(-) Osier -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list