diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-02-08 11:01:55 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-02-14 21:12:05 +0100 |
commit | 104059da546c5cae03767c519013704d0baa0896 (patch) | |
tree | 76f6fed6efd4492a2afc2ffca6385b8d0a83b0f0 /hw/core/qdev-properties.c | |
parent | f31c41ff5e7d64680382e94b9ea35d52ab4ca045 (diff) |
qdev: Add enum property types to QAPI schema
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/core/qdev-properties.c')
-rw-r--r-- | hw/core/qdev-properties.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 76a0c4dd11..0a2ca058dc 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -449,36 +449,22 @@ PropertyInfo qdev_prop_macaddr = { /* --- lost tick policy --- */ -static const char *lost_tick_policy_table[LOST_TICK_MAX+1] = { - [LOST_TICK_DISCARD] = "discard", - [LOST_TICK_DELAY] = "delay", - [LOST_TICK_MERGE] = "merge", - [LOST_TICK_SLEW] = "slew", - [LOST_TICK_MAX] = NULL, -}; - QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != sizeof(int)); PropertyInfo qdev_prop_losttickpolicy = { .name = "LostTickPolicy", - .enum_table = lost_tick_policy_table, + .enum_table = LostTickPolicy_lookup, .get = get_enum, .set = set_enum, }; /* --- BIOS CHS translation */ -static const char *bios_chs_trans_table[] = { - [BIOS_ATA_TRANSLATION_AUTO] = "auto", - [BIOS_ATA_TRANSLATION_NONE] = "none", - [BIOS_ATA_TRANSLATION_LBA] = "lba", - [BIOS_ATA_TRANSLATION_LARGE] = "large", - [BIOS_ATA_TRANSLATION_RECHS] = "rechs", -}; +QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int)); PropertyInfo qdev_prop_bios_chs_trans = { .name = "bios-chs-trans", - .enum_table = bios_chs_trans_table, + .enum_table = BiosAtaTranslation_lookup, .get = get_enum, .set = set_enum, }; |