aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorLi Qiang <liq3ea@gmail.com>2018-10-19 03:50:35 -0700
committerGerd Hoffmann <kraxel@redhat.com>2018-10-29 10:46:07 +0100
commitca1d410285203b61520d25281ee2c5934cf3a32c (patch)
treee073e9fbfbad3f1cfdf0e13e3d01560d8987a26d /hw/usb
parentb9a3a4f206019862575bd4f9cb6c1b6b1933f8fb (diff)
downloadqemu-ca1d410285203b61520d25281ee2c5934cf3a32c.zip
qemu-ca1d410285203b61520d25281ee2c5934cf3a32c.tar.gz
qemu-ca1d410285203b61520d25281ee2c5934cf3a32c.tar.bz2
hw: ccid-card-emulated: introduce clean_event_notifier
Call it in device unrealize function. Signed-off-by: Li Qiang <liq3ea@gmail.com> Message-id: 1539946236-18028-2-git-send-email-liq3ea@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/ccid-card-emulated.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 5c8b3c9..b356edb 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -409,6 +409,12 @@ static int init_event_notifier(EmulatedState *card, Error **errp)
return 0;
}
+static void clean_event_notifier(EmulatedState *card)
+{
+ event_notifier_set_handler(&card->notifier, NULL);
+ event_notifier_cleanup(&card->notifier);
+}
+
#define CERTIFICATES_DEFAULT_DB "/etc/pki/nssdb"
#define CERTIFICATES_ARGS_TEMPLATE\
"db=\"%s\" use_hw=no soft=(,Virtual Reader,CAC,,%s,%s,%s)"
@@ -556,6 +562,7 @@ static void emulated_unrealize(CCIDCardState *base, Error **errp)
qemu_cond_signal(&card->handle_apdu_cond);
qemu_thread_join(&card->apdu_thread_id);
+ clean_event_notifier(card);
/* threads exited, can destroy all condvars/mutexes */
qemu_cond_destroy(&card->handle_apdu_cond);
qemu_mutex_destroy(&card->handle_apdu_mutex);