diff mbox series

[06/20] qdev: Stop using error_set_from_qdev_prop_error() for PCI host device property

Message ID 20201030202131.796967-7-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-x86_64 -device vfio-pci,host=x
  qemu-system-x86_64: -device vfio-pci,host=x: Property 'vfio-pci.host' doesn't take value 'x'

After:

  $ qemu-system-x86_64 -device vfio-pci,host=x
  qemu-system-x86_64: -device vfio-pci,host=x: Property 'vfio-pci.host' can't take value 'x': invalid host device 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 mbox series

Patch

diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 5d3cb32708..0290d64bf1 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -859,7 +859,7 @@  static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
     return;
 
 inval:
-    error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+    error_setg(errp, "invalid host device address");
     g_free(str);
 }