summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-19 13:20:23 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 17:45:26 +0100
commitfdcfa190ab3f042339bcd77c640b20dec73d715e (patch)
tree5f47add22b04ea2e0fee12cd4c38994a220b298d
parent84745d68e7338271f0f7ec567ab52abf20a0ce9c (diff)
downloadqemu-fdcfa190ab3f042339bcd77c640b20dec73d715e.tar.gz
qemu-fdcfa190ab3f042339bcd77c640b20dec73d715e.tar.bz2
qemu-fdcfa190ab3f042339bcd77c640b20dec73d715e.zip
qdev: convert setting device properties to QError
-rw-r--r--hw/qdev-properties.c15
-rw-r--r--hw/qdev.c2
2 files changed, 7 insertions, 10 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 6a524cc107..92d6793747 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -548,25 +548,24 @@ int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
* removed along with it.
*/
if (!prop || !prop->info->parse) {
- fprintf(stderr, "property \"%s.%s\" not found\n",
- dev->info->name, name);
+ qerror_report(QERR_PROPERTY_NOT_FOUND, dev->info->name, name);
return -1;
}
ret = prop->info->parse(dev, prop, value);
if (ret < 0) {
switch (ret) {
case -EEXIST:
- fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",
- dev->info->name, name, value);
+ qerror_report(QERR_PROPERTY_VALUE_IN_USE,
+ dev->info->name, name, value);
break;
default:
case -EINVAL:
- fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
- dev->info->name, name, value);
+ qerror_report(QERR_PROPERTY_VALUE_BAD,
+ dev->info->name, name, value);
break;
case -ENOENT:
- fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",
- dev->info->name, name, value);
+ qerror_report(QERR_PROPERTY_VALUE_NOT_FOUND,
+ dev->info->name, name, value);
break;
}
return -1;
diff --git a/hw/qdev.c b/hw/qdev.c
index 4608169449..36f2bd6189 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -146,8 +146,6 @@ static int set_property(const char *name, const char *value, void *opaque)
return 0;
if (qdev_prop_parse(dev, name, value) == -1) {
- error_report("can't set property \"%s\" to \"%s\" for \"%s\"",
- name, value, dev->info->name);
return -1;
}
return 0;