mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qdev: wrap default property value in an union
Wrap the Property default value (an int64_t) in a union, to prepare for the next patch adding a uint64_t. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-17-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
85bbd1e7a4
commit
76318657a8
3 changed files with 10 additions and 8 deletions
|
@ -71,7 +71,7 @@ static void set_enum(Object *obj, Visitor *v, const char *name, void *opaque,
|
|||
|
||||
static void set_default_value_enum(Object *obj, const Property *prop)
|
||||
{
|
||||
object_property_set_str(obj, prop->info->enum_table[prop->defval],
|
||||
object_property_set_str(obj, prop->info->enum_table[prop->defval.i],
|
||||
prop->name, &error_abort);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ static void prop_set_bit(Object *obj, Visitor *v, const char *name,
|
|||
|
||||
static void set_default_value_bool(Object *obj, const Property *prop)
|
||||
{
|
||||
object_property_set_bool(obj, prop->defval, prop->name, &error_abort);
|
||||
object_property_set_bool(obj, prop->defval.i, prop->name, &error_abort);
|
||||
}
|
||||
|
||||
PropertyInfo qdev_prop_bit = {
|
||||
|
@ -261,7 +261,7 @@ static void set_uint8(Object *obj, Visitor *v, const char *name, void *opaque,
|
|||
|
||||
static void set_default_value_int(Object *obj, const Property *prop)
|
||||
{
|
||||
object_property_set_int(obj, prop->defval, prop->name, &error_abort);
|
||||
object_property_set_int(obj, prop->defval.i, prop->name, &error_abort);
|
||||
}
|
||||
|
||||
PropertyInfo qdev_prop_uint8 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue