qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eduardo Habkost
Subject: [PATCH 07/20] qdev: Stop using error_set_from_qdev_prop_error() for css devno property
Date: Fri, 30 Oct 2020 16:21:18 -0400

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 --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)) {
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]