qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 05/20] qdev: Stop using error_set_from_qdev_prop_error() for devf


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

Just setting a reasonable error string using error_setg() is
simpler and makes error messages clearer.

Before:

  $ qemu-system-x86_64 -device e1000,addr=x
  qemu-system-x86_64: -device e1000,addr=x: Property 'e1000.addr' doesn't take 
value 'x'

After:

  $ qemu-system-x86_64 -device e1000,addr=x
  qemu-system-x86_64: -device e1000,addr=x: Property 'e1000.addr' can't take 
value 'x': invalid PCI address

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
---
 hw/core/qdev-properties-system.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index fc0abcae17..5d3cb32708 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -742,7 +742,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_setg(errp, "invalid PCI address");
     g_free(str);
 }
 
-- 
2.28.0




reply via email to

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