qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 06/20] qdev: Stop using error_set_from_qdev_prop_error() for PCI


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

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 --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);
 }
 
-- 
2.28.0




reply via email to

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