]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
i386/xen: register exit notifier
authorJoao Martins <joao.m.martins@oracle.com>
Fri, 28 Sep 2018 17:05:22 +0000 (13:05 -0400)
committerJoao Martins <joao.m.martins@oracle.com>
Tue, 19 Feb 2019 14:00:57 +0000 (09:00 -0500)
This allows us to free resources and/or connections to
other resources/domains.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
target/i386/xen-proto.h
target/i386/xen.c

index 2c5acd443fc5cf8287bc95b42ed8c60340bc3bc2..0965ea7624769c635700a96e8e012ac9478f06de 100644 (file)
@@ -54,6 +54,7 @@ typedef struct XenState {
     int domid;
     int port;
     QemuMutex port_lock;
+    Notifier exit;
     struct XenGrantTable gnttab;
 } XenState;
 
index 959c4cf9fc55390ffd072de32b74e20ee25d8d09..ce3062b974d6c418101003385ef0422859a69548 100644 (file)
@@ -21,6 +21,7 @@
 #include "sysemu/sysemu.h"
 #include "monitor/monitor.h"
 #include "qapi/qmp/qdict.h"
+#include "qapi/error.h"
 #include "qom/cpu.h"
 #include "hw/xen/xen.h"
 
@@ -140,6 +141,10 @@ int kvm_xen_set_hypercall_page(CPUState *env)
     return kvm_vm_ioctl(env->kvm_state, KVM_XEN_HVM_CONFIG, &cfg);
 }
 
+static void kvm_xen_exit(Notifier *n, void *data)
+{
+}
+
 void kvm_xen_init(XenState *xen)
 {
     kvm_xen_set_domid(kvm_state, xen);
@@ -147,6 +152,9 @@ void kvm_xen_init(XenState *xen)
     qemu_mutex_init(&xen_global_mutex);
     qemu_mutex_init(&xen->port_lock);
 
+    xen->exit.notify = kvm_xen_exit;
+    qemu_add_exit_notifier(&xen->exit);
+
     kvm_xen_evtchn_init(xen);
 }