]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: implement memory failure event
authorzhenwei pi <pizhenwei@bytedance.com>
Wed, 14 Oct 2020 10:37:51 +0000 (18:37 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 23 Oct 2020 07:42:00 +0000 (09:42 +0200)
commit7555a554706e8a6d492804debbacfaae9f5d8b05
tree49e48f074e4cce0ec3f70cdb1585047a4b4de3d4
parentb866adf8d9233b951e73c4a2ad204c2fae3043e4
qemu: implement memory failure event

Since QEMU 5.2 (commit-77b285f7f6), QEMU supports 'memory failure'
event, posts event to monitor if hitting a hardware memory error.
Fully support this feature for QEMU.

Test with commit 'libvirt: support memory failure event', build a
little complex environment(nested KVM):
1, install newly built libvirt in L1, and start a L2 vm. run command
in L1:
 ~# virsh event l2 --event memory-failure

2, run command in L0 to inject MCE to L1:
 ~# virsh qemu-monitor-command l1 --hmp mce 0 9 0xbd000000000000c0 0xd 0x62000000 0x8c

Test result in l1(recipient hypervisor case):
event 'memory-failure' for domain l2:
recipient: hypervisor
action: ignore
flags:
        action required: 0
        recursive: 0

Test result in l1(recipient guest case):
event 'memory-failure' for domain l2:
recipient: guest
action: inject
flags:
        action required: 0
        recursive: 0

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_process.c