[PATCH 10/20] memfd: Remove unnecessary prefix from error message

Eduardo Habkost posted 20 patches 5 years, 3 months ago
Maintainers: Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Markus Armbruster <armbru@redhat.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Jason Wang <jasowang@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Richard Henderson <rth@twiddle.net>, Halil Pasic <pasic@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Li Zhijian <lizhijian@cn.fujitsu.com>, "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Zhang Chen <chen.zhang@intel.com>
[PATCH 10/20] memfd: Remove unnecessary prefix from error message
Posted by Eduardo Habkost 5 years, 3 months ago
object_property_parse() will add a
  "Property '<TYPE>.<PROP>' can't take value '<VALUE>'"
prefix automatically for us.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org
---
 backends/hostmem-memfd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index e5626d4330..05cf743fe8 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -87,8 +87,7 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, const char *name,
         return;
     }
     if (!value) {
-        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu64 "'",
-                   object_get_typename(obj), name, value);
+        error_setg(errp, "hugetlbsize can't be zero");
         return;
     }
     m->hugetlbsize = value;
-- 
2.28.0


Re: [PATCH 10/20] memfd: Remove unnecessary prefix from error message
Posted by Igor Mammedov 5 years, 3 months ago
On Fri, 30 Oct 2020 16:21:21 -0400
Eduardo Habkost <ehabkost@redhat.com> wrote:

> object_property_parse() will add a
>   "Property '<TYPE>.<PROP>' can't take value '<VALUE>'"
> prefix automatically for us.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  backends/hostmem-memfd.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
> index e5626d4330..05cf743fe8 100644
> --- a/backends/hostmem-memfd.c
> +++ b/backends/hostmem-memfd.c
> @@ -87,8 +87,7 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, const char *name,
>          return;
>      }
>      if (!value) {
> -        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu64 "'",
> -                   object_get_typename(obj), name, value);
> +        error_setg(errp, "hugetlbsize can't be zero");
>          return;
>      }
>      m->hugetlbsize = value;