From nobody Wed Nov 5 08:30:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504281404767557.4169187855986; Fri, 1 Sep 2017 08:56:44 -0700 (PDT) Received: from localhost ([::1]:46569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnoJH-00084Z-Cs for importer@patchew.org; Fri, 01 Sep 2017 11:56:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dno1W-0006na-L5 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:38:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dno1R-0001og-Oc for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:38:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59066) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dno1R-0001oI-JC for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:38:17 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A099D7D0CA for ; Fri, 1 Sep 2017 15:38:16 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-75.ams2.redhat.com [10.36.116.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C947957B1 for ; Fri, 1 Sep 2017 15:38:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C6CB31132F4E; Fri, 1 Sep 2017 17:37:58 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A099D7D0CA Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=armbru@redhat.com From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 1 Sep 2017 17:37:56 +0200 Message-Id: <20170901153758.8628-46-armbru@redhat.com> In-Reply-To: <20170901153758.8628-1-armbru@redhat.com> References: <20170901153758.8628-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Sep 2017 15:38:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 45/47] qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-Id: <1503564371-26090-15-git-send-email-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/core/qdev-properties.c | 7 +++++-- qapi/qapi-visit-core.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 078fc5d239..7512bd4379 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -72,7 +72,9 @@ static void set_enum(Object *obj, Visitor *v, const char = *name, void *opaque, =20 static void set_default_value_enum(Object *obj, const Property *prop) { - object_property_set_str(obj, prop->info->enum_table[prop->defval.i], + object_property_set_str(obj, + qapi_enum_lookup(prop->info->enum_table, + prop->defval.i), prop->name, &error_abort); } =20 @@ -1095,7 +1097,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char = *name, int value) Property *prop; =20 prop =3D qdev_prop_find(dev, name); - object_property_set_str(OBJECT(dev), prop->info->enum_table[value], + object_property_set_str(OBJECT(dev), + qapi_enum_lookup(prop->info->enum_table, value= ), name, &error_abort); } =20 diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index f285879d72..30dc85b6f3 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -345,7 +345,7 @@ static void output_type_enum(Visitor *v, const char *na= me, int *obj, return; } =20 - enum_str =3D (char *)strings[value]; + enum_str =3D (char *)qapi_enum_lookup(strings, value); visit_type_str(v, name, &enum_str, errp); } =20 --=20 2.13.5