Patchwork [RFC,29/48] qdev: convert setting device properties to QError

login
register
mail settings
Submitter Markus Armbruster
Date Feb. 24, 2010, 5:55 p.m.
Message ID <1267034160-3517-30-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/46198/
State New
Headers show

Comments

Markus Armbruster - Feb. 24, 2010, 5:55 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/qdev-properties.c |    6 ++----
 hw/qdev.c            |    2 --
 2 files changed, 2 insertions(+), 6 deletions(-)

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 8e96805..a3572b0 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -544,13 +544,11 @@  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);
+        qemu_error_new(QERR_PROPERTY_NOT_FOUND, dev->info->name, name);
         return -1;
     }
     if (prop->info->parse(dev, prop, value) != 0) {
-        fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
-                dev->info->name, name, value);
+        qemu_error_new(QERR_PROPERTY_VALUE_BAD, dev->info->name, name, value);
         return -1;
     }
     return 0;
diff --git a/hw/qdev.c b/hw/qdev.c
index 4d5ede7..b170081 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) {
-        qemu_error("can't set property \"%s\" to \"%s\" for \"%s\"",
-                   name, value, dev->info->name);
         return -1;
     }
     return 0;