[Top][All Lists]

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

Re: [PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for

From: Marc-André Lureau
Subject: Re: [PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for UUID property
Date: Fri, 30 Oct 2020 21:06:34 +0400

On Fri, Oct 30, 2020 at 2:22 AM Eduardo Habkost <ehabkost@redhat.com> wrote:
Just setting a reasonable error string using error_setg() is
simpler and makes error messages clearer.


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


  $ qemu-system-x86_64 -device vmgenid,guid=x
  qemu-system-x86_64: -device vmgenid,guid=x: invalid UUID: 'x'

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

It looks like we agree that error_set_from_qdev_prop_error() should eventually be replaced :)

Reviewed-by: Marc-André Lureau <marcandre.lureau@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.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 59d65a7362..5b9907e8ba 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -509,7 +509,7 @@ static void set_uuid(Object *obj, Visitor *v, const char *name, void *opaque,
     if (!strcmp(str, UUID_VALUE_AUTO)) {
     } else if (qemu_uuid_parse(str, uuid) < 0) {
-        error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str);
+        error_setg(errp, "invalid UUID: '%s'", str);

Marc-André Lureau

reply via email to

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