diff mbox series

[07/20] qdev: Stop using error_set_from_qdev_prop_error() for css devno property

Message ID 20201030202131.796967-8-ehabkost@redhat.com
State New
Headers show
Series qdev/qom: Remove explicit type names from error_setg() calls | expand

Commit Message

Eduardo Habkost Oct. 30, 2020, 8:21 p.m. UTC
Just setting a reasonable error string using error_setg() is
simpler and makes error messages clearer.

Before:

  $ qemu-system-s390x -device x-terminal3270,devno=x
  qemu-system-s390x: -device x-terminal3270,devno=x: Property 'x-terminal3270.devno' doesn't take value 'x'

After:

  $ qemu-system-s390x -device x-terminal3270,devno=x
  qemu-system-s390x: -device x-terminal3270,devno=x: Property 'x-terminal3270.devno' can't take value 'x': invalid devno

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: David Hildenbrand <david@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org
---
 hw/s390x/css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index c8e7ce232a..ad631bad29 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -2384,7 +2384,7 @@  static void set_css_devid(Object *obj, Visitor *v, const char *name,
 
     num = sscanf(str, "%2x.%1x%n.%4x%n", &cssid, &ssid, &n1, &devid, &n2);
     if (num != 3 || (n2 - n1) != 5 || strlen(str) != n2) {
-        error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+        error_setg(errp, "invalid devno");
         goto out;
     }
     if ((cssid > MAX_CSSID) || (ssid > MAX_SSID)) {