qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE
PATCH v3 1/2 qapi/machine-s390x: add QAPI event SCLP_CPI_INFO_AVAILABLE
Add QAPI event SCLP_CPI_INFO_AVAILABLE to notify the availability of Control-Program Identification data in QOM.
--- hw/s390x/sclpcpi.c | 4 ++++ qapi/machine-s390x.json | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+)
hw/s390x/sclpcpi.c +4 -0
@@ -54,6 +54,7 @@#include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" #include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" typedef struct Data {
@@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr) e->timestamp =qemu_clock_get_ns (QEMU_CLOCK_HOST ); cpim->ebh.flags =SCLP_EVENT_BUFFER_ACCEPTED ; + +qapi_event_send_sclp_cpi_info_available (); +return SCLP_RC_NORMAL_COMPLETION ; }
qapi/machine-s390x.json +21 -0
@@ -119,3 +119,24 @@ { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo', 'features': [ 'unstable' ] } + +## +# @SCLP_CPI_INFO_AVAILABLE: +# +# Emitted when the Control-Program Identification data is available +# in the QOM tree. +# +# Features: +# +# @unstable: This event is experimental. +# +# Since: 10.2 +# +# .. qmp-example:: +# +# <- { "event": "SCLP_CPI_INFO_AVAILABLE", +# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } +## +{ 'event': 'SCLP_CPI_INFO_AVAILABLE', + 'features': [ 'unstable' ] +}
Signature · 1 line
2.49.0
PATCH v3 2/2 tests/functional: add tests for SCLP event CPI
Add tests for SCLP event type Control-Program Identification.
--- tests/functional/s390x/test_ccw_virtio.py | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+)
tests/functional/s390x/test_ccw_virtio.py +26 -0
@@ -15,6 +15,7 @@ import tempfile from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command from qemu_test import exec_command_and_wait_for_pattern from qemu_test import wait_for_console_pattern
@@ -270,5 +271,30 @@ def test_s390x_fedora(self): 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' ' sleep 1 ; done', 'Start virtcrypto_remove.') + # Test SCLP event Control-Program Identification (CPI) + cpi = '/sys/firmware/cpi/' + sclpcpi = '/machine/sclp/s390-sclp-event-facility/sclpcpi' + self.log.info("Test SCLP event CPI") + exec_command(self, 'echo TESTVM > ' + cpi + 'system_name') + exec_command(self, 'echo LINUX > ' + cpi + 'system_type') + exec_command(self, 'echo TESTPLEX > ' + cpi + 'sysplex_name') + exec_command(self, 'echo 0x001a000000060b00 > ' + cpi + 'system_level') + exec_command_and_wait_for_pattern(self, + 'echo 1 > ' + cpi + 'set', ':/#') + try: + event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE') + except TimeoutError: + self.fail('Timed out waiting for the SCLP_CPI_INFO_AVAILABLE event') + ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp') + self.assertNotEqual(ts, 0) + name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name') + self.assertEqual(name.strip(), 'TESTVM') + typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type') + self.assertEqual(typ.strip(), 'LINUX') + sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name') + self.assertEqual(sysplex.strip(), 'TESTPLEX') + level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level') + self.assertEqual(level, 0x001a000000060b00) + if __name__ == '__main__': QemuSystemTest.main()
Signature · 1 line
2.49.0
Re: [PATCH v3 2/2] tests/functional: add tests for SCLP event CPI
Quoted 41 lines · Shalini Chellathurai Saroja
Add tests for SCLP event type Control-Program Identification.
Signed-off-by Shalini Chellathurai Saroja <[email protected]>Suggested-by Thomas Huth <[email protected]>--- tests/functional/s390x/test_ccw_virtio.py | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+)tests/functional/s390x/test_ccw_virtio.py +18
-0@@ -15,6 +15,7 @@ import tempfile from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command from qemu_test import exec_command_and_wait_for_pattern from qemu_test import wait_for_console_pattern@@ -270,5 +271,30 @@ def test_s390x_fedora(self): 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' ' sleep 1 ; done', 'Start virtcrypto_remove.') + # Test SCLP event Control-Program Identification (CPI) + cpi = '/sys/firmware/cpi/' + sclpcpi = '/machine/sclp/s390-sclp-event-facility/sclpcpi' + self.log.info("Test SCLP event CPI") + exec_command(self, 'echo TESTVM > ' + cpi + 'system_name') + exec_command(self, 'echo LINUX > ' + cpi + 'system_type') + exec_command(self, 'echo TESTPLEX > ' + cpi + 'sysplex_name') + exec_command(self, 'echo 0x001a000000060b00 > ' + cpi + 'system_level') + exec_command_and_wait_for_pattern(self, + 'echo 1 > ' + cpi + 'set', ':/#') + try: + event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE') + except TimeoutError: + self.fail('Timed out waiting for the SCLP_CPI_INFO_AVAILABLE event') + ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp') + self.assertNotEqual(ts, 0) + name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
tests/functional/s390x/test_ccw_virtio.py def test_s390x_fedora(self): · line 300
Quoted 10 lines
tests/functional/s390x/test_ccw_virtio.py +8
-0+ self.assertEqual(name.strip(), 'TESTVM') + typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type') + self.assertEqual(typ.strip(), 'LINUX') + sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name') + self.assertEqual(sysplex.strip(), 'TESTPLEX') + level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level') + self.assertEqual(level, 0x001a000000060b00) + if __name__ == '__main__': QemuSystemTest.main()
Re: [PATCH v3 2/2] tests/functional: add tests for SCLP event CPI
In reply to Shalini Chellathurai SarojaQuoted 41 lines · Shalini Chellathurai Saroja
Add tests for SCLP event type Control-Program Identification.
Signed-off-by Shalini Chellathurai Saroja <[email protected]>Suggested-by Thomas Huth <[email protected]>--- tests/functional/s390x/test_ccw_virtio.py | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+)tests/functional/s390x/test_ccw_virtio.py +18
-0@@ -15,6 +15,7 @@ import tempfile from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command from qemu_test import exec_command_and_wait_for_pattern from qemu_test import wait_for_console_pattern@@ -270,5 +271,30 @@ def test_s390x_fedora(self): 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' ' sleep 1 ; done', 'Start virtcrypto_remove.') + # Test SCLP event Control-Program Identification (CPI) + cpi = '/sys/firmware/cpi/' + sclpcpi = '/machine/sclp/s390-sclp-event-facility/sclpcpi' + self.log.info("Test SCLP event CPI") + exec_command(self, 'echo TESTVM > ' + cpi + 'system_name') + exec_command(self, 'echo LINUX > ' + cpi + 'system_type') + exec_command(self, 'echo TESTPLEX > ' + cpi + 'sysplex_name') + exec_command(self, 'echo 0x001a000000060b00 > ' + cpi + 'system_level') + exec_command_and_wait_for_pattern(self, + 'echo 1 > ' + cpi + 'set', ':/#') + try: + event = self.vm.event_wait('SCLP_CPI_INFO_AVAILABLE') + except TimeoutError: + self.fail('Timed out waiting for the SCLP_CPI_INFO_AVAILABLE event') + ts = self.vm.cmd('qom-get', path=sclpcpi, property='timestamp') + self.assertNotEqual(ts, 0) + name = self.vm.cmd('qom-get', path=sclpcpi, property='system_name')
tests/functional/s390x/test_ccw_virtio.py def test_s390x_fedora(self): · line 300
Quoted 10 lines
tests/functional/s390x/test_ccw_virtio.py +8
-0+ self.assertEqual(name.strip(), 'TESTVM') + typ = self.vm.cmd('qom-get', path=sclpcpi, property='system_type') + self.assertEqual(typ.strip(), 'LINUX') + sysplex = self.vm.cmd('qom-get', path=sclpcpi, property='sysplex_name') + self.assertEqual(sysplex.strip(), 'TESTPLEX') + level = self.vm.cmd('qom-get', path=sclpcpi, property='system_level') + self.assertEqual(level, 0x001a000000060b00) + if __name__ == '__main__': QemuSystemTest.main()
Quoted 51 lines · Shalini Chellathurai Saroja
Add QAPI event
SCLP_CPI_INFO_AVAILABLEto notify the availability of Control-Program Identification data in QOM.Signed-off-by Shalini Chellathurai Saroja <[email protected]>Suggested-by Thomas Huth <[email protected]>--- hw/s390x/sclpcpi.c | 4 ++++ qapi/machine-s390x.json | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+)hw/s390x/sclpcpi.c +4
-0@@ -54,6 +54,7 @@#include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" #include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" typedef struct Data {@@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr) e->timestamp =qemu_clock_get_ns (QEMU_CLOCK_HOST ); cpim->ebh.flags =SCLP_EVENT_BUFFER_ACCEPTED ; + +qapi_event_send_sclp_cpi_info_available (); +return SCLP_RC_NORMAL_COMPLETION ; }qapi/machine-s390x.json +11
-0@@ -119,3 +119,24 @@ { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo', 'features': [ 'unstable' ] } + +## +# @SCLP_CPI_INFO_AVAILABLE: +# +# Emitted when the Control-Program Identification data is available +# in the QOM tree. +# +# Features: +# +# @unstable: This event is experimental. +#
qapi/machine-s390x.json line 142
Quoted 10 lines
qapi/machine-s390x.json +10
-0+# Since: 10.2 +# +# .. qmp-example:: +# +# <- { "event": "SCLP_CPI_INFO_AVAILABLE", +# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } +## +{ 'event': 'SCLP_CPI_INFO_AVAILABLE', + 'features': [ 'unstable' ] +}
Quoted 51 lines · Shalini Chellathurai Saroja
Add QAPI event
SCLP_CPI_INFO_AVAILABLEto notify the availability of Control-Program Identification data in QOM.Signed-off-by Shalini Chellathurai Saroja <[email protected]>Suggested-by Thomas Huth <[email protected]>--- hw/s390x/sclpcpi.c | 4 ++++ qapi/machine-s390x.json | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+)hw/s390x/sclpcpi.c +4
-0@@ -54,6 +54,7 @@#include "hw/s390x/event-facility.h" #include "hw/s390x/ebcdic.h" #include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-events-machine-s390x.h" #include "migration/vmstate.h" typedef struct Data {@@ -106,6 +107,9 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr) e->timestamp =qemu_clock_get_ns (QEMU_CLOCK_HOST ); cpim->ebh.flags =SCLP_EVENT_BUFFER_ACCEPTED ; + +qapi_event_send_sclp_cpi_info_available (); +return SCLP_RC_NORMAL_COMPLETION ; }qapi/machine-s390x.json +11
-0@@ -119,3 +119,24 @@ { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo', 'features': [ 'unstable' ] } + +## +# @SCLP_CPI_INFO_AVAILABLE: +# +# Emitted when the Control-Program Identification data is available +# in the QOM tree. +# +# Features: +# +# @unstable: This event is experimental. +#
qapi/machine-s390x.json line 142
Quoted 10 lines
qapi/machine-s390x.json +10
-0+# Since: 10.2 +# +# .. qmp-example:: +# +# <- { "event": "SCLP_CPI_INFO_AVAILABLE", +# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } +## +{ 'event': 'SCLP_CPI_INFO_AVAILABLE', + 'features': [ 'unstable' ] +}