[{"id":1759781,"web_url":"http://patchwork.ozlabs.org/comment/1759781/","msgid":"<33183CC9F5247A488A2544077AF19020DA395F0A@DGGEMA505-MBX.china.huawei.com>","list_archive_url":null,"date":"2017-08-30T00:33:53","subject":"Re: [Qemu-devel] [PATCH] qom: Remove unused errp parameter from\n\tcan_be_deleted()","submitter":{"id":35948,"url":"http://patchwork.ozlabs.org/api/people/35948/","name":"Gonglei (Arei)","email":"arei.gonglei@huawei.com"},"content":"> -----Original Message-----\r\n> From: Eduardo Habkost [mailto:ehabkost@redhat.com]\r\n> Sent: Wednesday, August 30, 2017 6:04 AM\r\n> To: qemu-devel@nongnu.org\r\n> Cc: Gonglei (Arei); Paolo Bonzini; Igor Mammedov; Andreas Färber; Lin Ma\r\n> Subject: [PATCH] qom: Remove unused errp parameter from can_be_deleted()\r\n> \r\n> The errp argument is ignored by all implementations of the\r\n> method, and user_creatable_del() would break if any\r\n> implementation set an error (because it calls error_setg(errp) if\r\n> the function returns false).  Remove the unused parameter.\r\n> \r\n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\r\n> ---\r\n>  include/qom/object_interfaces.h | 5 ++---\r\n>  backends/cryptodev.c            | 2 +-\r\n>  backends/hostmem.c              | 2 +-\r\n>  qom/object_interfaces.c         | 6 +++---\r\n>  4 files changed, 7 insertions(+), 8 deletions(-)\r\n> \r\n\r\nReviewed-by: Gonglei <arei.gonglei@huawei.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhmjk5B35z9s8w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 10:34:47 +1000 (AEST)","from localhost ([::1]:47529 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmqxw-000667-GO\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 20:34:44 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33123)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <arei.gonglei@huawei.com>) id 1dmqxW-00065q-07\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 20:34:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <arei.gonglei@huawei.com>) id 1dmqxR-0004K6-Vu\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 20:34:18 -0400","from szxga02-in.huawei.com ([45.249.212.188]:4418)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)\n\t(envelope-from <arei.gonglei@huawei.com>) id 1dmqxR-0004J0-4j\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 20:34:13 -0400","from 172.30.72.55 (EHLO DGGEMA405-HUB.china.huawei.com)\n\t([172.30.72.55])\n\tby dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued)\n\twith ESMTP id AUK70674; Wed, 30 Aug 2017 08:34:00 +0800 (CST)","from DGGEMA505-MBX.china.huawei.com ([169.254.1.46]) by\n\tDGGEMA405-HUB.china.huawei.com ([10.3.20.46]) with mapi id\n\t14.03.0301.000; Wed, 30 Aug 2017 08:33:53 +0800"],"From":"\"Gonglei (Arei)\" <arei.gonglei@huawei.com>","To":"Eduardo Habkost <ehabkost@redhat.com>, \"qemu-devel@nongnu.org\"\n\t<qemu-devel@nongnu.org>","Thread-Topic":"[PATCH] qom: Remove unused errp parameter from can_be_deleted()","Thread-Index":"AQHTIRKwIWBXFGbVLE+K4CPqlkw8+aKcDMBg","Date":"Wed, 30 Aug 2017 00:33:53 +0000","Message-ID":"<33183CC9F5247A488A2544077AF19020DA395F0A@DGGEMA505-MBX.china.huawei.com>","References":"<20170829220337.23427-1-ehabkost@redhat.com>","In-Reply-To":"<20170829220337.23427-1-ehabkost@redhat.com>","Accept-Language":"zh-CN, en-US","Content-Language":"zh-CN","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-originating-ip":"[10.177.18.62]","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A0B0201.59A607F9.00A3, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=169.254.1.46,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"34305d0ad5c0bf6a191a3865f6293cbb","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]\n\t[fuzzy]","X-Received-From":"45.249.212.188","Subject":"Re: [Qemu-devel] [PATCH] qom: Remove unused errp parameter from\n\tcan_be_deleted()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, Lin Ma <lma@suse.com>,\n\t=?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>,\n\tIgor Mammedov <imammedo@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759904,"web_url":"http://patchwork.ozlabs.org/comment/1759904/","msgid":"<20170830082001.7c9346dc@nial.brq.redhat.com>","list_archive_url":null,"date":"2017-08-30T06:20:01","subject":"Re: [Qemu-devel] [PATCH] qom: Remove unused errp parameter from\n\tcan_be_deleted()","submitter":{"id":11305,"url":"http://patchwork.ozlabs.org/api/people/11305/","name":"Igor Mammedov","email":"imammedo@redhat.com"},"content":"On Tue, 29 Aug 2017 19:03:37 -0300\nEduardo Habkost <ehabkost@redhat.com> wrote:\n\n> The errp argument is ignored by all implementations of the\n> method, and user_creatable_del() would break if any\n> implementation set an error (because it calls error_setg(errp) if\n> the function returns false).  Remove the unused parameter.\n> \n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\nReviewed-by: Igor Mammedov <imammedo@redhat.com>\n\n> ---\n>  include/qom/object_interfaces.h | 5 ++---\n>  backends/cryptodev.c            | 2 +-\n>  backends/hostmem.c              | 2 +-\n>  qom/object_interfaces.c         | 6 +++---\n>  4 files changed, 7 insertions(+), 8 deletions(-)\n> \n> diff --git a/include/qom/object_interfaces.h b/include/qom/object_interfaces.h\n> index fdd7603..d63c1c2 100644\n> --- a/include/qom/object_interfaces.h\n> +++ b/include/qom/object_interfaces.h\n> @@ -51,7 +51,7 @@ typedef struct UserCreatableClass {\n>  \n>      /* <public> */\n>      void (*complete)(UserCreatable *uc, Error **errp);\n> -    bool (*can_be_deleted)(UserCreatable *uc, Error **errp);\n> +    bool (*can_be_deleted)(UserCreatable *uc);\n>  } UserCreatableClass;\n>  \n>  /**\n> @@ -68,12 +68,11 @@ void user_creatable_complete(Object *obj, Error **errp);\n>  /**\n>   * user_creatable_can_be_deleted:\n>   * @uc: the object whose can_be_deleted() method is called if implemented\n> - * @errp: if an error occurs, a pointer to an area to store the error\n>   *\n>   * Wrapper to call can_be_deleted() method if one of types it's inherited\n>   * from implements USER_CREATABLE interface.\n>   */\n> -bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp);\n> +bool user_creatable_can_be_deleted(UserCreatable *uc);\n>  \n>  /**\n>   * user_creatable_add_type:\n> diff --git a/backends/cryptodev.c b/backends/cryptodev.c\n> index 1764c17..67edfa5 100644\n> --- a/backends/cryptodev.c\n> +++ b/backends/cryptodev.c\n> @@ -215,7 +215,7 @@ bool cryptodev_backend_is_ready(CryptoDevBackend *backend)\n>  }\n>  \n>  static bool\n> -cryptodev_backend_can_be_deleted(UserCreatable *uc, Error **errp)\n> +cryptodev_backend_can_be_deleted(UserCreatable *uc)\n>  {\n>      return !cryptodev_backend_is_used(CRYPTODEV_BACKEND(uc));\n>  }\n> diff --git a/backends/hostmem.c b/backends/hostmem.c\n> index 4606b73..34550b9 100644\n> --- a/backends/hostmem.c\n> +++ b/backends/hostmem.c\n> @@ -342,7 +342,7 @@ out:\n>  }\n>  \n>  static bool\n> -host_memory_backend_can_be_deleted(UserCreatable *uc, Error **errp)\n> +host_memory_backend_can_be_deleted(UserCreatable *uc)\n>  {\n>      if (host_memory_backend_is_mapped(MEMORY_BACKEND(uc))) {\n>          return false;\n> diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c\n> index ff27e06..3bb8959 100644\n> --- a/qom/object_interfaces.c\n> +++ b/qom/object_interfaces.c\n> @@ -23,13 +23,13 @@ void user_creatable_complete(Object *obj, Error **errp)\n>      }\n>  }\n>  \n> -bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp)\n> +bool user_creatable_can_be_deleted(UserCreatable *uc)\n>  {\n>  \n>      UserCreatableClass *ucc = USER_CREATABLE_GET_CLASS(uc);\n>  \n>      if (ucc->can_be_deleted) {\n> -        return ucc->can_be_deleted(uc, errp);\n> +        return ucc->can_be_deleted(uc);\n>      } else {\n>          return true;\n>      }\n> @@ -178,7 +178,7 @@ void user_creatable_del(const char *id, Error **errp)\n>          return;\n>      }\n>  \n> -    if (!user_creatable_can_be_deleted(USER_CREATABLE(obj), errp)) {\n> +    if (!user_creatable_can_be_deleted(USER_CREATABLE(obj))) {\n>          error_setg(errp, \"object '%s' is in use, can not be deleted\", id);\n>          return;\n>      }","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=imammedo@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhwNp3PSmz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 16:20:42 +1000 (AEST)","from localhost ([::1]:48589 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmwMi-0006mj-BP\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 02:20:40 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36713)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dmwMG-0006m3-Vk\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 02:20:14 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dmwMB-00037d-Tf\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 02:20:12 -0400","from mx1.redhat.com ([209.132.183.28]:60120)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <imammedo@redhat.com>) id 1dmwMB-00036C-KV\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 02:20:07 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id ABEE7267DF;\n\tWed, 30 Aug 2017 06:20:06 +0000 (UTC)","from nial.brq.redhat.com (unknown [10.43.2.241])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 258BF956D3;\n\tWed, 30 Aug 2017 06:20:02 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com ABEE7267DF","Date":"Wed, 30 Aug 2017 08:20:01 +0200","From":"Igor Mammedov <imammedo@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170830082001.7c9346dc@nial.brq.redhat.com>","In-Reply-To":"<20170829220337.23427-1-ehabkost@redhat.com>","References":"<20170829220337.23427-1-ehabkost@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 30 Aug 2017 06:20:06 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] qom: Remove unused errp parameter from\n\tcan_be_deleted()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Paolo Bonzini <pbonzini@redhat.com>, Gonglei <arei.gonglei@huawei.com>,\n\tLin Ma <lma@suse.com>, qemu-devel@nongnu.org, Andreas =?utf-8?b?RsOk?=\n\t=?utf-8?q?rber?= <afaerber@suse.de>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]