summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorEduardo Habkost2020-12-11 23:05:15 +0100
committerEduardo Habkost2020-12-18 21:20:17 +0100
commite68c2cb75af2960dc6ad9705e71ab9cd97b901f6 (patch)
tree0a1a6a4c923be21946272df8d8efe8d157d6cd4a /hw/core
parentsparc: Use DEFINE_PROP for nwindows property (diff)
downloadqemu-e68c2cb75af2960dc6ad9705e71ab9cd97b901f6.tar.gz
qemu-e68c2cb75af2960dc6ad9705e71ab9cd97b901f6.tar.xz
qemu-e68c2cb75af2960dc6ad9705e71ab9cd97b901f6.zip
qdev: Get just property name at error_set_from_qdev_prop_error()
Replace `Property *prop` parameter with `char *name`, to reduce dependency of getter and setter functions on the Property struct (which will be changed in following patches). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20201211220529.2290218-19-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev-properties-system.c12
-rw-r--r--hw/core/qdev-properties.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index e2d523b27a..9cf9bcb39d 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -354,7 +354,7 @@ static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque,
return;
inval:
- error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
g_free(str);
}
@@ -442,7 +442,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,
peers_ptr->queues = queues;
out:
- error_set_from_qdev_prop_error(errp, err, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, err, obj, name, str);
g_free(str);
}
@@ -494,7 +494,7 @@ static void set_audiodev(Object *obj, Visitor *v, const char* name,
card->state = state;
out:
- error_set_from_qdev_prop_error(errp, err, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, err, obj, name, str);
g_free(str);
}
@@ -792,7 +792,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
return;
invalid:
- error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
g_free(str);
}
@@ -916,7 +916,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
return;
inval:
- error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
g_free(str);
}
@@ -1146,7 +1146,7 @@ static void set_uuid(Object *obj, Visitor *v, const char *name, void *opaque,
if (!strcmp(str, UUID_VALUE_AUTO)) {
qemu_uuid_generate(uuid);
} else if (qemu_uuid_parse(str, uuid) < 0) {
- error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+ error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str);
}
g_free(str);
}
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index a2eaa43831..7495798a66 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -679,21 +679,21 @@ static Property *qdev_prop_find(DeviceState *dev, const char *name)
}
void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj,
- Property *prop, const char *value)
+ const char *name, const char *value)
{
switch (ret) {
case -EEXIST:
error_setg(errp, "Property '%s.%s' can't take value '%s', it's in use",
- object_get_typename(obj), prop->name, value);
+ object_get_typename(obj), name, value);
break;
default:
case -EINVAL:
error_setg(errp, QERR_PROPERTY_VALUE_BAD,
- object_get_typename(obj), prop->name, value);
+ object_get_typename(obj), name, value);
break;
case -ENOENT:
error_setg(errp, "Property '%s.%s' can't find value '%s'",
- object_get_typename(obj), prop->name, value);
+ object_get_typename(obj), name, value);
break;
case 0:
break;