summaryrefslogtreecommitdiff
path: root/hw/ccid-card-emulated.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 12:34:10 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commitba7c05205c4ba2fd08096b0083fc1e5decf3c342 (patch)
tree4f51677a29c97582ae914b94d6884e8857284aba /hw/ccid-card-emulated.c
parent62aed76583fe8bf8e6ba5955b2ecfa3619ea3540 (diff)
downloadqemu-ba7c05205c4ba2fd08096b0083fc1e5decf3c342.zip
ccid: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ccid-card-emulated.c')
-rw-r--r--hw/ccid-card-emulated.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c
index 2d2ebce852..6dabe7af60 100644
--- a/hw/ccid-card-emulated.c
+++ b/hw/ccid-card-emulated.c
@@ -564,16 +564,23 @@ static int emulated_exitfn(CCIDCardState *base)
return 0;
}
-static CCIDCardInfo emulated_card_info = {
- .qdev.name = EMULATED_DEV_NAME,
- .qdev.desc = "emulated smartcard",
- .qdev.size = sizeof(EmulatedState),
- .initfn = emulated_initfn,
- .exitfn = emulated_exitfn,
- .get_atr = emulated_get_atr,
- .apdu_from_guest = emulated_apdu_from_guest,
- .qdev.unplug = qdev_simple_unplug_cb,
- .qdev.props = (Property[]) {
+static void emulated_class_initfn(ObjectClass *klass, void *data)
+{
+ CCIDCardClass *cc = CCID_CARD_CLASS(klass);
+
+ cc->initfn = emulated_initfn;
+ cc->exitfn = emulated_exitfn;
+ cc->get_atr = emulated_get_atr;
+ cc->apdu_from_guest = emulated_apdu_from_guest;
+}
+
+static DeviceInfo emulated_card_info = {
+ .name = EMULATED_DEV_NAME,
+ .desc = "emulated smartcard",
+ .size = sizeof(EmulatedState),
+ .unplug = qdev_simple_unplug_cb,
+ .class_init = emulated_class_initfn,
+ .props = (Property[]) {
DEFINE_PROP_STRING("backend", EmulatedState, backend_str),
DEFINE_PROP_STRING("cert1", EmulatedState, cert1),
DEFINE_PROP_STRING("cert2", EmulatedState, cert2),