]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
arm: postpone device listener unregister
authorPeter Xu <peterx@redhat.com>
Mon, 22 Jan 2018 06:02:42 +0000 (14:02 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 7 Feb 2018 13:09:24 +0000 (14:09 +0100)
It's a preparation for follow-up patch to call region_del() in
memory_listener_unregister(), otherwise all device addr attached with
kvm_devices_head will be reset before calling kvm_arm_set_device_addr.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180122060244.29368-3-peterx@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/arm/kvm.c

index 211a7bf7befd9e6988cb3e7c02cadf6de6014a98..1219d0062bdab0e87aaf3f290a0f5ec2eb27087a 100644 (file)
@@ -266,7 +266,6 @@ static void kvm_arm_machine_init_done(Notifier *notifier, void *data)
 {
     KVMDevice *kd, *tkd;
 
-    memory_listener_unregister(&devlistener);
     QSLIST_FOREACH_SAFE(kd, &kvm_devices_head, entries, tkd) {
         if (kd->kda.addr != -1) {
             kvm_arm_set_device_addr(kd);
@@ -274,6 +273,7 @@ static void kvm_arm_machine_init_done(Notifier *notifier, void *data)
         memory_region_unref(kd->mr);
         g_free(kd);
     }
+    memory_listener_unregister(&devlistener);
 }
 
 static Notifier notify = {