[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for UUID
From: |
Eduardo Habkost |
Subject: |
[PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for UUID property |
Date: |
Thu, 29 Oct 2020 18:02:41 -0400 |
Just setting a reasonable error string using error_setg() is
simpler and makes error messages clearer.
Before:
$ qemu-system-x86_64 -device vmgenid,guid=x
qemu-system-x86_64: -device vmgenid,guid=x: Property 'vmgenid.guid' doesn't
take value 'x'
After:
$ 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>
---
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)) {
qemu_uuid_generate(uuid);
} 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);
}
g_free(str);
}
--
2.28.0
- [PATCH 18/36] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen(), (continued)
- [PATCH 18/36] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen(), Eduardo Habkost, 2020/10/29
- [PATCH 22/36] qdev: Make qdev_prop_allow_set() a property allow_set callback, Eduardo Habkost, 2020/10/29
- [PATCH 24/36] qdev: Rename qdev_propinfo_* to object_propinfo_*, Eduardo Habkost, 2020/10/29
- [PATCH 23/36] qdev: Make qdev_propinfo_get_uint16() static, Eduardo Habkost, 2020/10/29
- [PATCH 26/36] qdev: Move softmmu properties to qdev-properties-system.h, Eduardo Habkost, 2020/10/29
- [PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for UUID property,
Eduardo Habkost <=
- [PATCH 25/36] qdev: Rename qdev_get_prop_ptr() to object_static_prop_ptr(), Eduardo Habkost, 2020/10/29
- [PATCH 28/36] qdev: Move core static property code to QOM, Eduardo Habkost, 2020/10/29
- [PATCH 30/36] qdev: Rename qdev_prop_* to prop_info_*, Eduardo Habkost, 2020/10/29
- [PATCH 34/36] machine: Use DEFINE_PROP_STRING for string properties, Eduardo Habkost, 2020/10/29