diff options
author | Paolo Bonzini | 2014-02-08 11:01:46 +0100 |
---|---|---|
committer | Andreas Färber | 2014-02-14 21:12:02 +0100 |
commit | 9e4d9620c42649de7b6a0c5f5e1ed8fa0299b5c3 (patch) | |
tree | d88fb803288be7a64f30126a17e1e2f483d72c1e /hw/core | |
parent | qdev: Sizes are now parsed by StringInputVisitor (diff) | |
download | qemu-9e4d9620c42649de7b6a0c5f5e1ed8fa0299b5c3.tar.gz qemu-9e4d9620c42649de7b6a0c5f5e1ed8fa0299b5c3.tar.xz qemu-9e4d9620c42649de7b6a0c5f5e1ed8fa0299b5c3.zip |
qdev: Remove legacy parsers for hex8/32/64
The hexNN property types have not been accepting values not prefixed
by "0x" since QEMU 1.2. Parse those values as decimals now.
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')
-rw-r--r-- | hw/core/qdev-properties.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index da37710247..e223ce1887 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -189,23 +189,6 @@ PropertyInfo qdev_prop_uint8 = { /* --- 8bit hex value --- */ -static int parse_hex8(DeviceState *dev, Property *prop, const char *str) -{ - uint8_t *ptr = qdev_get_prop_ptr(dev, prop); - char *end; - - if (str[0] != '0' || str[1] != 'x') { - return -EINVAL; - } - - *ptr = strtoul(str, &end, 16); - if ((*end != '\0') || (end == str)) { - return -EINVAL; - } - - return 0; -} - static int print_hex8(DeviceState *dev, Property *prop, char *dest, size_t len) { uint8_t *ptr = qdev_get_prop_ptr(dev, prop); @@ -215,7 +198,6 @@ static int print_hex8(DeviceState *dev, Property *prop, char *dest, size_t len) PropertyInfo qdev_prop_hex8 = { .name = "uint8", .legacy_name = "hex8", - .parse = parse_hex8, .print = print_hex8, .get = get_uint8, .set = set_uint8, @@ -320,23 +302,6 @@ PropertyInfo qdev_prop_int32 = { /* --- 32bit hex value --- */ -static int parse_hex32(DeviceState *dev, Property *prop, const char *str) -{ - uint32_t *ptr = qdev_get_prop_ptr(dev, prop); - char *end; - - if (str[0] != '0' || str[1] != 'x') { - return -EINVAL; - } - - *ptr = strtoul(str, &end, 16); - if ((*end != '\0') || (end == str)) { - return -EINVAL; - } - - return 0; -} - static int print_hex32(DeviceState *dev, Property *prop, char *dest, size_t len) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); @@ -346,7 +311,6 @@ static int print_hex32(DeviceState *dev, Property *prop, char *dest, size_t len) PropertyInfo qdev_prop_hex32 = { .name = "uint32", .legacy_name = "hex32", - .parse = parse_hex32, .print = print_hex32, .get = get_uint32, .set = set_uint32, @@ -387,23 +351,6 @@ PropertyInfo qdev_prop_uint64 = { /* --- 64bit hex value --- */ -static int parse_hex64(DeviceState *dev, Property *prop, const char *str) -{ - uint64_t *ptr = qdev_get_prop_ptr(dev, prop); - char *end; - - if (str[0] != '0' || str[1] != 'x') { - return -EINVAL; - } - - *ptr = strtoull(str, &end, 16); - if ((*end != '\0') || (end == str)) { - return -EINVAL; - } - - return 0; -} - static int print_hex64(DeviceState *dev, Property *prop, char *dest, size_t len) { uint64_t *ptr = qdev_get_prop_ptr(dev, prop); @@ -413,7 +360,6 @@ static int print_hex64(DeviceState *dev, Property *prop, char *dest, size_t len) PropertyInfo qdev_prop_hex64 = { .name = "uint64", .legacy_name = "hex64", - .parse = parse_hex64, .print = print_hex64, .get = get_uint64, .set = set_uint64, |