From nobody Sat Oct 11 04:29:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544806760053423.67796863195304; Fri, 14 Dec 2018 08:59:20 -0800 (PST) Received: from localhost ([::1]:34498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqnt-0007ui-Ev for importer@patchew.org; Fri, 14 Dec 2018 11:59:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqm4-0005fZ-Ks for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXqm2-00024X-7y for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:16 -0500 Received: from mail-eopbgr80118.outbound.protection.outlook.com ([40.107.8.118]:22409 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXqm1-0001B5-RY for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:14 -0500 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com (20.179.10.210) by DB8PR08MB4010.eurprd08.prod.outlook.com (20.179.9.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 14 Dec 2018 16:57:06 +0000 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407]) by DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407%3]) with mapi id 15.20.1425.021; Fri, 14 Dec 2018 16:57:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eKM5IIDoFnP5W7dP0bARCtLt1iK8oWGTegqjKqceU6g=; b=R0sbl2+tTCMUWjVpwqz7fldxQOLemwlkO1jO5vaNIEnx4wPTWXo3qRB9laBXPlu2LmLVeSGLtASkXLfI4Jcit84vFZwcSU8flZF7jqcmpQ1PBzj4Q3R6GHY5XjDOoRr+zpOPhGpfDh0jx+KzPOqZN454OF//fhScmLuHGXPZxIw= From: Roman Kagan To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH 1/5] qom: preserve get/set presence in aliased properties Thread-Index: AQHUk84LeeJQlcq0qUeD2xgF7dLiJA== Date: Fri, 14 Dec 2018 16:57:06 +0000 Message-ID: <20181214165657.749-2-rkagan@virtuozzo.com> References: <20181214165657.749-1-rkagan@virtuozzo.com> In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR0401CA0073.eurprd04.prod.outlook.com (2603:10a6:3:19::41) To DB8PR08MB4092.eurprd08.prod.outlook.com (2603:10a6:10:ab::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB8PR08MB4010; 20:8ib7rRtKLibqfTOvAnDqZ25gEemA7c1s3lFHIBFxruZgD35OMbX9RiTUq73WDurDT4VBFkwGV5hOEJZNTn2i4yRC8s2LGQ24H4YriIYJAb9uoGXp66I2p/5e/A7vgvjnfpm2F4mB6/jg2QLP8RBsUzX/w4q5tUJwGb4wub4wb2s= x-ms-office365-filtering-correlation-id: 82a20ab8-041e-43fc-9a0e-08d661e52d9a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DB8PR08MB4010; x-ms-traffictypediagnostic: DB8PR08MB4010: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB8PR08MB4010; BCL:0; PCL:0; RULEID:; SRVR:DB8PR08MB4010; x-forefront-prvs: 08864C38AC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39850400004)(366004)(396003)(199004)(189003)(7736002)(486006)(2351001)(71190400001)(14444005)(305945005)(81166006)(5660300001)(81156014)(36756003)(217873002)(6916009)(102836004)(2501003)(105586002)(6486002)(256004)(26005)(106356001)(446003)(8936002)(6512007)(76176011)(1076002)(316002)(6506007)(14454004)(3846002)(6116002)(54906003)(186003)(99286004)(11346002)(97736004)(8676002)(25786009)(52116002)(53936002)(2906002)(68736007)(4326008)(86362001)(575784001)(476003)(2616005)(478600001)(5640700003)(71200400001)(386003)(66066001)(6436002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB8PR08MB4010; H:DB8PR08MB4092.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yOm94qfLdwuoIpO6ZYFkwsAKoje6GsLpclyHAIFS+smHgG4wvPfRN4G1Yg7bvIGGbXK6GGai2GggFteg8BpK1E0UFVV80+ScQTwNLrbrpsJeOjSLhFBj6OIJnLW3Xi7EwZ5I6gTfdrENl4aG9SR5k/zEOVGVbitV5AoMPgnt7lQfAPLiJmDddJ9Z72xeTIPoKr38EUxOpcIUVjd9iKhNqbnrPZTvXuZF9KZepLyYNddwPcvOdxZTxJWduvgSunWYAnEU7TbuAQpObVNVkatBdkkOwBZWfMPVXWDHqulVSuHkbNmIC3sMopm2yntIfVnJ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a20ab8-041e-43fc-9a0e-08d661e52d9a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 16:57:06.2515 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4010 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.8.118 Subject: [Qemu-devel] [RFC PATCH 1/5] qom: preserve get/set presence in aliased properties 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: , Cc: Fam Zheng , "Michael S. Tsirkin" , Amit Shah , Markus Armbruster , Paolo Bonzini , =?iso-8859-1?Q?Andreas_F=E4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Usually in order to tell if a property is read-only, write-only, or read-write, one has to look at whether it has .get or .set methods. However, property aliases are always defined with both, and it's not until the call to the getter or setter when the support for the corresponding operation can be found out. To make it easier to determine if an operation is supported for an alias property, only assign it getter and setter if the target property has the corresponding method. Signed-off-by: Roman Kagan --- qom/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qom/object.c b/qom/object.c index 17921c0a71..b362ebab19 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2382,8 +2382,8 @@ void object_property_add_alias(Object *obj, const cha= r *name, prop->target_name =3D g_strdup(target_name); =20 op =3D object_property_add(obj, name, prop_type, - property_get_alias, - property_set_alias, + target_prop->get ? property_get_alias : NULL, + target_prop->set ? property_set_alias : NULL, property_release_alias, prop, &local_err); if (local_err) { --=20 2.19.2 From nobody Sat Oct 11 04:29:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544806943110214.75222523524303; Fri, 14 Dec 2018 09:02:23 -0800 (PST) Received: from localhost ([::1]:34531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqqz-00020e-3t for importer@patchew.org; Fri, 14 Dec 2018 12:02:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqm5-0005fp-66 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXqm3-0002BD-52 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:17 -0500 Received: from mail-eopbgr80118.outbound.protection.outlook.com ([40.107.8.118]:22409 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXqm2-0001B5-PI for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:15 -0500 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com (20.179.10.210) by DB8PR08MB4010.eurprd08.prod.outlook.com (20.179.9.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 14 Dec 2018 16:57:07 +0000 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407]) by DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407%3]) with mapi id 15.20.1425.021; Fri, 14 Dec 2018 16:57:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qm1wS5NkUMjr1uQgClyOfHnm1K6kTUkODxoVUF+T8Ow=; b=X19xVeeY0Vl1LQNwyI4AXr09sk7lIMbEWMc0Xrs7WqdY5VFTRpri6JmWY3gsZQXhXlk7uoE1ct82XTqcSrz1DvJysVBC/qUnV731SuQTDUMPJ3FIK6VjGqpRb0Cqn4cQB7OnMOR9Ii+jOnLfTqdusCqx4vBQqMEyG5e8BysGYOY= From: Roman Kagan To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH 2/5] qmp: further consolidate listing of device and object properties Thread-Index: AQHUk84LCQlA9pH4OUiRBsr0KwD7xg== Date: Fri, 14 Dec 2018 16:57:07 +0000 Message-ID: <20181214165657.749-3-rkagan@virtuozzo.com> References: <20181214165657.749-1-rkagan@virtuozzo.com> In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR0401CA0073.eurprd04.prod.outlook.com (2603:10a6:3:19::41) To DB8PR08MB4092.eurprd08.prod.outlook.com (2603:10a6:10:ab::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB8PR08MB4010; 20:Wi/lo/Dx67536rRstAXo54gVxBFCyTtD5MtNXtPfnJxWfPJEdhRWbetNVhpn6nXOPtbv/ZOhOnoREJDtaO8NYJREeGedCezLv97hjiogS6x2cN1tVoJU2oPkLArWV46OWWNKhnYXPb5eMOBNDQH50bpeS04eKXddzrjqoqW1LLE= x-ms-office365-filtering-correlation-id: a8156d06-2ac4-4303-e3a4-08d661e52e24 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DB8PR08MB4010; x-ms-traffictypediagnostic: DB8PR08MB4010: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB8PR08MB4010; BCL:0; PCL:0; RULEID:; SRVR:DB8PR08MB4010; x-forefront-prvs: 08864C38AC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39850400004)(366004)(396003)(199004)(189003)(7736002)(486006)(2351001)(71190400001)(305945005)(81166006)(5660300001)(81156014)(36756003)(217873002)(6916009)(102836004)(2501003)(105586002)(6486002)(256004)(26005)(106356001)(446003)(8936002)(6512007)(76176011)(1076002)(316002)(6506007)(14454004)(3846002)(6116002)(54906003)(186003)(99286004)(11346002)(97736004)(8676002)(25786009)(52116002)(53936002)(2906002)(68736007)(4326008)(86362001)(575784001)(476003)(2616005)(478600001)(5640700003)(71200400001)(386003)(66066001)(6436002)(309714004); DIR:OUT; SFP:1102; SCL:1; SRVR:DB8PR08MB4010; H:DB8PR08MB4092.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Xu6hH3rhSutqpeOokjr1sNK+WgVyD2wB8IYRFZkYPpTYpquS9CnHUi4w/R4/haoJxkm5Gkcpc4PRITFnEMY+fnAG8/ibYevMSbfLVhTOh18/zpC3YIklyOh96ZUqomHYlYSzEf/pXIlANNPI38Cp5Ghj7zwLRXoJiyjan7rKawO+qwTLjI4xKevbgBGUvzo4lgPupJWgu1h1zgFQyc3xaadtPUB2IYyWy8dOa8kTV7g5QdydUjuuLHVUkWd6GxHjtp29CAzd2MlvVLSY0EtL95LUowiP0aHjhedZbz30GYT9veTdSdQ/oQv8PfOvh5hK spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8156d06-2ac4-4303-e3a4-08d661e52e24 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 16:57:07.1734 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4010 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.8.118 Subject: [Qemu-devel] [RFC PATCH 2/5] qmp: further consolidate listing of device and object properties 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: , Cc: Fam Zheng , "Michael S. Tsirkin" , Amit Shah , Markus Armbruster , Paolo Bonzini , =?iso-8859-1?Q?Andreas_F=E4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Take the approach of commit 35f63767dc77d85bebff6c6565aceaf74023776a "qmp: Merge ObjectPropertyInfo and DevicePropertyInfo" one step further: drop device property-specific code from qmp_device_list_properties and consolidate the resulting common part with qmp_qom_list_properties. Signed-off-by: Roman Kagan --- qmp.c | 92 ++++++++++++++--------------------------------------------- 1 file changed, 22 insertions(+), 70 deletions(-) diff --git a/qmp.c b/qmp.c index e7c0a2fd60..673dfa72ce 100644 --- a/qmp.c +++ b/qmp.c @@ -430,56 +430,22 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_imple= ments, return ret; } =20 -/* Return a DevicePropertyInfo for a qdev property. - * - * If a qdev property with the given name does not exist, use the given de= fault - * type. If the qdev property info should not be shown, return NULL. - * - * The caller must free the return value. - */ -static ObjectPropertyInfo *make_device_property_info(ObjectClass *klass, - const char *name, - const char *default_type, - const char *description) +static void push_property_info(ObjectPropertyInfoList **prop_list, + ObjectProperty *prop) { ObjectPropertyInfo *info; - Property *prop; - - do { - for (prop =3D DEVICE_CLASS(klass)->props; prop && prop->name; prop= ++) { - if (strcmp(name, prop->name) !=3D 0) { - continue; - } - - /* - * TODO Properties without a parser are just for dirty hacks. - * qdev_prop_ptr is the only such PropertyInfo. It's marked - * for removal. This conditional should be removed along with - * it. - */ - if (!prop->info->set && !prop->info->create) { - return NULL; /* no way to set it, don't show */ - } - - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strdup(prop->name); - info->type =3D default_type ? g_strdup(default_type) - : g_strdup(prop->info->name); - info->has_description =3D !!prop->info->description; - info->description =3D g_strdup(prop->info->description); - return info; - } - klass =3D object_class_get_parent(klass); - } while (klass !=3D object_class_by_name(TYPE_DEVICE)); - - /* Not a qdev property, use the default type */ - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strdup(name); - info->type =3D g_strdup(default_type); - info->has_description =3D !!description; - info->description =3D g_strdup(description); - - return info; + ObjectPropertyInfoList *entry; + + info =3D g_new0(ObjectPropertyInfo, 1); + info->name =3D g_strdup(prop->name); + info->type =3D g_strdup(prop->type); + info->has_description =3D !!prop->description; + info->description =3D g_strdup(prop->description); + + entry =3D g_new0(ObjectPropertyInfoList, 1); + entry->value =3D info; + entry->next =3D *prop_list; + *prop_list =3D entry; } =20 ObjectPropertyInfoList *qmp_device_list_properties(const char *typename, @@ -514,9 +480,6 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; - ObjectPropertyInfoList *entry; - /* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") =3D=3D 0 || strcmp(prop->name, "realized") =3D=3D 0 || @@ -533,16 +496,12 @@ ObjectPropertyInfoList *qmp_device_list_properties(co= nst char *typename, continue; } =20 - info =3D make_device_property_info(klass, prop->name, prop->type, - prop->description); - if (!info) { + /* Skip readonly properties. */ + if (!prop->set) { continue; } =20 - entry =3D g_malloc0(sizeof(*entry)); - entry->value =3D info; - entry->next =3D prop_list; - prop_list =3D entry; + push_property_info(&prop_list, prop); } =20 object_unref(obj); @@ -579,19 +538,12 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const= char *typename, object_property_iter_init(&iter, obj); } while ((prop =3D object_property_iter_next(&iter))) { - ObjectPropertyInfo *info; - ObjectPropertyInfoList *entry; + /* Skip readonly properties. */ + if (!prop->set) { + continue; + } =20 - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strdup(prop->name); - info->type =3D g_strdup(prop->type); - info->has_description =3D !!prop->description; - info->description =3D g_strdup(prop->description); - - entry =3D g_malloc0(sizeof(*entry)); - entry->value =3D info; - entry->next =3D prop_list; - prop_list =3D entry; + push_property_info(&prop_list, prop); } =20 object_unref(obj); --=20 2.19.2 From nobody Sat Oct 11 04:29:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544807100304791.1147776620973; Fri, 14 Dec 2018 09:05:00 -0800 (PST) Received: from localhost ([::1]:34638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqtW-0005F1-Sa for importer@patchew.org; Fri, 14 Dec 2018 12:04:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqm5-0005gC-UY for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXqm4-0002GD-2N for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:17 -0500 Received: from mail-eopbgr80118.outbound.protection.outlook.com ([40.107.8.118]:22409 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXqm3-0001B5-M1 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:15 -0500 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com (20.179.10.210) by DB8PR08MB4010.eurprd08.prod.outlook.com (20.179.9.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 14 Dec 2018 16:57:08 +0000 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407]) by DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407%3]) with mapi id 15.20.1425.021; Fri, 14 Dec 2018 16:57:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=taWRYvaXYdW81h0o5VVu4ZAFoKf1kaOEdp+/mhqMcW0=; b=BRWoZzjF+CjRsWu5lX4yrbweU5NbPzYn7WA5XcyeyHNp5hg7d706+pn5mmh2Jy1jIFjsH4TVoq7jJFWz60SxN/Dq/gVm4MZ8zk1ydrzQi/bWO9J9q9UvbWNF1H2hZwqfcS9DE60QKMC+AoHIFA1w7OJjQbfhuinj0f0aKRfztFs= From: Roman Kagan To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH 3/5] qdev-properties: add r/o 64bit bitfield property Thread-Index: AQHUk84M4eh5obVh1UKJYI2sPHnMhg== Date: Fri, 14 Dec 2018 16:57:08 +0000 Message-ID: <20181214165657.749-4-rkagan@virtuozzo.com> References: <20181214165657.749-1-rkagan@virtuozzo.com> In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR0401CA0073.eurprd04.prod.outlook.com (2603:10a6:3:19::41) To DB8PR08MB4092.eurprd08.prod.outlook.com (2603:10a6:10:ab::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB8PR08MB4010; 20:7d82uUpK0TAe6AZDRSbLi8gedunj+1QeZFHFEQp9isSAqR+whQ/1X9TmadOjdE0b8Xm77oosbDQc6k1pIr2cBIPhJH8T0I3XJAYou9izFJLl0pdWoj+GErnDfiArvJmLYa9wFB9n6YWCU3j4FBGGfkL4rgwPAlVe/ernISLOh9k= x-ms-office365-filtering-correlation-id: 8a308e03-bbbd-4460-8fa0-08d661e52eb1 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DB8PR08MB4010; x-ms-traffictypediagnostic: DB8PR08MB4010: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB8PR08MB4010; BCL:0; PCL:0; RULEID:; SRVR:DB8PR08MB4010; x-forefront-prvs: 08864C38AC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39850400004)(366004)(396003)(199004)(189003)(7736002)(486006)(2351001)(71190400001)(14444005)(305945005)(81166006)(5660300001)(81156014)(36756003)(217873002)(6916009)(102836004)(2501003)(105586002)(6486002)(256004)(26005)(106356001)(446003)(8936002)(6512007)(76176011)(1076002)(316002)(6506007)(14454004)(3846002)(6116002)(54906003)(186003)(99286004)(11346002)(97736004)(8676002)(25786009)(52116002)(53936002)(2906002)(68736007)(4326008)(86362001)(476003)(2616005)(478600001)(5640700003)(71200400001)(386003)(66066001)(6436002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB8PR08MB4010; H:DB8PR08MB4092.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: sRVl3TOHQVk6vETaa2JVPZywX0yJBJ7nrVHq5v7Wo7ZN51vtYoEV40WBvrOfKagFu9/9MX4AlO4sFJd/Qjk8msZks8zzP6IEnf2UV/gncFYWuYICw7wpJqJLzAOsiwtGaxxt+MpiuG55WGZZjmZtSnBn34QWVccQzriuBjZ37SIe17lPTyoEaqpRBhvPekh+63R70vaWGhx6GNPdqedebneFDGm1QfNCUL4kfWnpwGvK38kyGRJMYAyfjM6ALWU1zFpIP2rcLBLY4qaqcvtC5g26OYQUjPA3kdpUi5YbpfGMQBgdrl9hDaWDEgEhTdJX spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a308e03-bbbd-4460-8fa0-08d661e52eb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 16:57:08.0328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4010 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.8.118 Subject: [Qemu-devel] [RFC PATCH 3/5] qdev-properties: add r/o 64bit bitfield property 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: , Cc: Fam Zheng , "Michael S. Tsirkin" , Amit Shah , Markus Armbruster , Paolo Bonzini , =?iso-8859-1?Q?Andreas_F=E4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add a version 64bit bitfield property with no setter, useful for introspecting the device state without being able to modify it. Signed-off-by: Roman Kagan --- include/hw/qdev-properties.h | 9 +++++++++ hw/core/qdev-properties.c | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 3ab9cd2eb6..24df135ff8 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -9,6 +9,7 @@ =20 extern const PropertyInfo qdev_prop_bit; extern const PropertyInfo qdev_prop_bit64; +extern const PropertyInfo qdev_prop_bit64_ro; extern const PropertyInfo qdev_prop_bool; extern const PropertyInfo qdev_prop_uint8; extern const PropertyInfo qdev_prop_uint16; @@ -96,6 +97,14 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar; .defval.u =3D (bool)_defval, \ } =20 +#define DEFINE_PROP_BIT64_RO(_name, _state, _field, _bit) { \ + .name =3D (_name), \ + .info =3D &(qdev_prop_bit64_ro), \ + .bitnr =3D (_bit), \ + .offset =3D offsetof(_state, _field) \ + + type_check(uint64_t, typeof_field(_state, _field)), \ + } + #define DEFINE_PROP_BOOL(_name, _state, _field, _defval) { \ .name =3D (_name), \ .info =3D &(qdev_prop_bool), \ diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index bd84c4ea4c..bb9bd48e5c 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -146,7 +146,8 @@ const PropertyInfo qdev_prop_bit =3D { =20 static uint64_t qdev_get_prop_mask64(Property *prop) { - assert(prop->info =3D=3D &qdev_prop_bit64); + assert(prop->info =3D=3D &qdev_prop_bit64 || + prop->info =3D=3D &qdev_prop_bit64_ro); return 0x1ull << prop->bitnr; } =20 @@ -201,6 +202,12 @@ const PropertyInfo qdev_prop_bit64 =3D { .set_default_value =3D set_default_value_bool, }; =20 +const PropertyInfo qdev_prop_bit64_ro =3D { + .name =3D "bool", + .description =3D "on/off", + .get =3D prop_get_bit64, +}; + /* --- bool --- */ =20 static void get_bool(Object *obj, Visitor *v, const char *name, void *opaq= ue, --=20 2.19.2 From nobody Sat Oct 11 04:29:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544806761892554.3846713961145; Fri, 14 Dec 2018 08:59:21 -0800 (PST) Received: from localhost ([::1]:34500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqo3-00083l-Tt for importer@patchew.org; Fri, 14 Dec 2018 11:59:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqm7-0005hQ-OS for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXqm4-0002MS-Tw for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:19 -0500 Received: from mail-eopbgr80118.outbound.protection.outlook.com ([40.107.8.118]:22409 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXqm4-0001B5-IR for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:16 -0500 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com (20.179.10.210) by DB8PR08MB4010.eurprd08.prod.outlook.com (20.179.9.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 14 Dec 2018 16:57:09 +0000 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407]) by DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407%3]) with mapi id 15.20.1425.021; Fri, 14 Dec 2018 16:57:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p3oVtzoNhtOvesTXszUFCX9SbHzUcPc44nJPcxekv5w=; b=DcdNyu70WgqR3hxnWRfLGfxZG7nnSlJJVK5L7vvEVa18SU1fl42OpRAKiQfSTbHFiSBrOEBCHRAoLmW6PtmAv0t2ji8dI4kcXaJIAlOBQOsqQMAKzGgoHxqnvqF1D/Rxw4ezP8n7chDv9Go0ASkmDcV17CX1pqs/3R6iO7vpGoc= From: Roman Kagan To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH 4/5] virtio: drop DEFINE_VIRTIO_COMMON_FEATURES Thread-Index: AQHUk84MZwNBPHp0q0+qy1IhnsqV7w== Date: Fri, 14 Dec 2018 16:57:08 +0000 Message-ID: <20181214165657.749-5-rkagan@virtuozzo.com> References: <20181214165657.749-1-rkagan@virtuozzo.com> In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR0401CA0073.eurprd04.prod.outlook.com (2603:10a6:3:19::41) To DB8PR08MB4092.eurprd08.prod.outlook.com (2603:10a6:10:ab::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB8PR08MB4010; 20:tc0JmakU99h/UInrvlnZm3+Kpv54KL7yTx65uR8URwW/nNzWD7Jfn3tJ/wpnqG8/byElvaOFutNxcgrIw/E9Nu/KXjpNaWihSwE5GIa72iamkAw3rA8e/19CYvMZKIYqmLLJNfYu0NU4HOid/iomTqO6iEUsAKj1UUTa+LYlckc= x-ms-office365-filtering-correlation-id: 61c5a727-3275-495b-b21c-08d661e52f34 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DB8PR08MB4010; x-ms-traffictypediagnostic: DB8PR08MB4010: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB8PR08MB4010; BCL:0; PCL:0; RULEID:; SRVR:DB8PR08MB4010; x-forefront-prvs: 08864C38AC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39850400004)(366004)(396003)(199004)(189003)(7736002)(486006)(2351001)(71190400001)(305945005)(81166006)(5660300001)(81156014)(36756003)(217873002)(6916009)(102836004)(2501003)(105586002)(6486002)(256004)(26005)(106356001)(446003)(8936002)(6512007)(76176011)(1076002)(316002)(6506007)(14454004)(3846002)(6116002)(54906003)(186003)(99286004)(11346002)(97736004)(8676002)(25786009)(52116002)(53936002)(2906002)(68736007)(4326008)(86362001)(476003)(2616005)(478600001)(5640700003)(71200400001)(386003)(66066001)(6436002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB8PR08MB4010; H:DB8PR08MB4092.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: p/iqDZbYRHThg1srPHHeUPIlQs2iYBCPFo6PGALWyjJcLUfkUd1eqs3OTZ0hcsuoRPvJWwv2YzWsO4aiZPgslaMukJQuEWDdSJTVB3j7SuxhkPAKqmD/KhU8MAqQbZFT4gB1d3AX7S6jYxZELXIwf77GqAys3W6KVVz2BM+H13vb6A+LoZ11hR9Fd0Tqi6zKelj1WHl63ZGP1pXiv0XExxvbpsvB92w1Fp710/iM7Z0z+5/MCl1Osd6mdQ3aSrs4wnptWF6udWVMNhNgAmPkhllLfTf+Kz3KNGlRpV62PXsYIM9aUZ4EmEk/nRbUE3Pq spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61c5a727-3275-495b-b21c-08d661e52f34 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 16:57:08.9391 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4010 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.8.118 Subject: [Qemu-devel] [RFC PATCH 4/5] virtio: drop DEFINE_VIRTIO_COMMON_FEATURES 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: , Cc: Fam Zheng , "Michael S. Tsirkin" , Amit Shah , Markus Armbruster , Paolo Bonzini , =?iso-8859-1?Q?Andreas_F=E4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This macro is only used in one place so seems to be unnecessary. Signed-off-by: Roman Kagan --- include/hw/virtio/virtio.h | 12 ------------ hw/virtio/virtio.c | 11 ++++++++++- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9c1fa07d6d..cea356efed 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -254,18 +254,6 @@ typedef struct virtio_input_conf virtio_input_conf; typedef struct VirtIOSCSIConf VirtIOSCSIConf; typedef struct VirtIORNGConf VirtIORNGConf; =20 -#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \ - DEFINE_PROP_BIT64("indirect_desc", _state, _field, \ - VIRTIO_RING_F_INDIRECT_DESC, true), \ - DEFINE_PROP_BIT64("event_idx", _state, _field, \ - VIRTIO_RING_F_EVENT_IDX, true), \ - DEFINE_PROP_BIT64("notify_on_empty", _state, _field, \ - VIRTIO_F_NOTIFY_ON_EMPTY, true), \ - DEFINE_PROP_BIT64("any_layout", _state, _field, \ - VIRTIO_F_ANY_LAYOUT, true), \ - DEFINE_PROP_BIT64("iommu_platform", _state, _field, \ - VIRTIO_F_IOMMU_PLATFORM, false) - hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n); diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 22bd1ac34e..99d396c516 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2601,7 +2601,16 @@ static void virtio_device_instance_finalize(Object *= obj) } =20 static Property virtio_properties[] =3D { - DEFINE_VIRTIO_COMMON_FEATURES(VirtIODevice, host_features), + DEFINE_PROP_BIT64("indirect_desc", VirtIODevice, host_features, + VIRTIO_RING_F_INDIRECT_DESC, true), + DEFINE_PROP_BIT64("event_idx", VirtIODevice, host_features, + VIRTIO_RING_F_EVENT_IDX, true), + DEFINE_PROP_BIT64("notify_on_empty", VirtIODevice, host_features, + VIRTIO_F_NOTIFY_ON_EMPTY, true), + DEFINE_PROP_BIT64("any_layout", VirtIODevice, host_features, + VIRTIO_F_ANY_LAYOUT, true), + DEFINE_PROP_BIT64("iommu_platform", VirtIODevice, host_features, + VIRTIO_F_IOMMU_PLATFORM, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.19.2 From nobody Sat Oct 11 04:29:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544806769790223.35342240302737; Fri, 14 Dec 2018 08:59:29 -0800 (PST) Received: from localhost ([::1]:34501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqoB-00086H-Us for importer@patchew.org; Fri, 14 Dec 2018 11:59:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXqmB-0005lT-La for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXqm5-0002TJ-TT for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:21 -0500 Received: from mail-eopbgr80118.outbound.protection.outlook.com ([40.107.8.118]:22409 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXqm5-0001B5-EZ for qemu-devel@nongnu.org; Fri, 14 Dec 2018 11:57:17 -0500 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com (20.179.10.210) by DB8PR08MB4010.eurprd08.prod.outlook.com (20.179.9.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 14 Dec 2018 16:57:09 +0000 Received: from DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407]) by DB8PR08MB4092.eurprd08.prod.outlook.com ([fe80::d0e0:ff54:c6fe:1407%3]) with mapi id 15.20.1425.021; Fri, 14 Dec 2018 16:57:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l8PPnUIrlwxX4IvLCSYQVG8e44kP/XQ74gVJd+u7fYw=; b=irEN/n1gaTBOacPvNNQB55Vceh7hfjcFuTZFyeEWt+oDHBigL+h2Q16yqRuiDSYbX3h8W731oBmXIL+v6oJFbFEK80VRBLSVjEOoE7egcGdfkeOym9TEQstQf0z/FAOvr1aDsFr5F17ZUwreBaqpHsRvpQxuE2rarbkj2BdNPug= From: Roman Kagan To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH 5/5] virtio: expose negotiated features in r/o properties Thread-Index: AQHUk84N0sxPzHgOuEKzMlTSypVCdw== Date: Fri, 14 Dec 2018 16:57:09 +0000 Message-ID: <20181214165657.749-6-rkagan@virtuozzo.com> References: <20181214165657.749-1-rkagan@virtuozzo.com> In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [185.231.240.5] x-clientproxiedby: HE1PR0401CA0073.eurprd04.prod.outlook.com (2603:10a6:3:19::41) To DB8PR08MB4092.eurprd08.prod.outlook.com (2603:10a6:10:ab::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB8PR08MB4010; 20:Q4kdZ5fieb63ThuLV+9tqalEqCjGWqakkPrPLP5AHd0iTyr0N1/JMWcSBkIz3feQDypMdiorHGuXtc0uH7NfJrakU113T8El5MPWzIfnrMVG3Hg9mTmt9G/RSv/6WGohIJZpRKaJyz6TLZ1kxITTOR7DB7TC35pw6GsFLd3VWsU= x-ms-office365-filtering-correlation-id: dd1719df-052a-40a7-fbae-08d661e52fbe x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DB8PR08MB4010; x-ms-traffictypediagnostic: DB8PR08MB4010: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DB8PR08MB4010; BCL:0; PCL:0; RULEID:; SRVR:DB8PR08MB4010; x-forefront-prvs: 08864C38AC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39850400004)(366004)(396003)(199004)(189003)(7736002)(486006)(2351001)(71190400001)(305945005)(81166006)(5660300001)(81156014)(36756003)(217873002)(6916009)(102836004)(2501003)(105586002)(6486002)(256004)(26005)(106356001)(446003)(8936002)(6512007)(76176011)(1076002)(316002)(6506007)(14454004)(3846002)(6116002)(54906003)(186003)(99286004)(11346002)(97736004)(8676002)(4744004)(25786009)(52116002)(53936002)(2906002)(68736007)(4326008)(86362001)(575784001)(476003)(2616005)(478600001)(5640700003)(71200400001)(386003)(66066001)(6436002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB8PR08MB4010; H:DB8PR08MB4092.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 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; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: eY2iBpvZn3Ir/wSoBM6kZm22eJ96LYY2C4d3SvRM8JJusQ8xfUkxdW+OUtrxafkmSUkZvNU9LCPN4N9NC1DkCD5/DH9BqyahDVKi/A6D7nVDH4ugHf/3FTBTZIPtkmh5duv4Z45x4dDWTi++yzAwfPWM1TI74PtR3CSKiCwY7oPCSO4C7h4y68stnMYOBnZSUgbWkWFtGj4znisaoPokIGIsoDZib01NSe8XbZkRYLzP2x5ofCrUqQiQtQ39XIgjW7GgBePKYS6V1wuI8zVveD131j2KuicAtSk5N5QN7hdxOmEjYIM7aqm3HPmrmsq4 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd1719df-052a-40a7-fbae-08d661e52fbe X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2018 16:57:09.8298 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4010 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.8.118 Subject: [Qemu-devel] [RFC PATCH 5/5] virtio: expose negotiated features in r/o properties 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: , Cc: Fam Zheng , "Michael S. Tsirkin" , Amit Shah , Markus Armbruster , Paolo Bonzini , =?iso-8859-1?Q?Andreas_F=E4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Make virtio features acknowledged by the guest visible through QOM as read-only properties. One potential usecase of this is debugging; another is when the upper layer needs to do something only when/if the guest has acknowledged the support for a feature (e.g. hot-plug a VFIO device once the guest claims VIRTIO_NET_F_STANDBY support). Since most of the feature bits already have associated properties for host_features, reuse those definitions by creating a new macro that combines the original definition for the host_features bit property and a definition of a read-only guest_features bit property with the same name prefixed with "negotiated-". For the features which have no associated host_features bit property, only the latter is defined. Note #1: the macro is somewhat fragile as it produces two values separated by a comma, to be used for initializing consecutive elements in an array Note #2: due to note #1, it fails checkpatch. Note #3: it is also somewhat fragile as it assumes its first argument to be a string literal Note #4: for RFC purposes I only converted some virtio devices. Signed-off-by: Roman Kagan --- include/hw/virtio/virtio-scsi.h | 2 +- include/hw/virtio/virtio.h | 8 +++ hw/char/virtio-serial-bus.c | 6 ++- hw/net/virtio-net.c | 88 ++++++++++++++++++--------------- hw/scsi/virtio-scsi.c | 4 +- hw/virtio/virtio.c | 20 ++++---- 6 files changed, 73 insertions(+), 55 deletions(-) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 4c0bcdb788..9b412bd2c3 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -86,7 +86,7 @@ typedef struct VirtIOSCSI { bool dataplane_starting; bool dataplane_stopping; bool dataplane_fenced; - uint32_t host_features; + uint64_t host_features; } VirtIOSCSI; =20 typedef struct VirtIOSCSIReq { diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index cea356efed..a4690e6176 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -254,6 +254,14 @@ typedef struct virtio_input_conf virtio_input_conf; typedef struct VirtIOSCSIConf VirtIOSCSIConf; typedef struct VirtIORNGConf VirtIORNGConf; =20 +#define DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED(_name, _bit) \ + DEFINE_PROP_BIT64_RO("negotiated-" _name, VirtIODevice, \ + guest_features, _bit) + +#define DEFINE_VIRTIO_FEATURE_BIT(_name, _state, _field, _bit, _defval) \ + DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval), \ + DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED(_name, _bit) + hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n); diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 04e3ebe352..07bf729891 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -1154,8 +1154,10 @@ static const VMStateDescription vmstate_virtio_conso= le =3D { static Property virtio_serial_properties[] =3D { DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_po= rts, 31), - DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE, true), + DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED("multiport", + VIRTIO_CONSOLE_F_MULTIPORT), + DEFINE_VIRTIO_FEATURE_BIT("emergency-write", VirtIOSerial, host_featur= es, + VIRTIO_CONSOLE_F_EMERG_WRITE, true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 385b1a03e9..d4df3394ee 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2144,46 +2144,54 @@ static const VMStateDescription vmstate_virtio_net = =3D { }; =20 static Property virtio_net_properties[] =3D { - DEFINE_PROP_BIT64("csum", VirtIONet, host_features, - VIRTIO_NET_F_CSUM, true), - DEFINE_PROP_BIT64("guest_csum", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_CSUM, true), - DEFINE_PROP_BIT64("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, t= rue), - DEFINE_PROP_BIT64("guest_tso4", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_TSO4, true), - DEFINE_PROP_BIT64("guest_tso6", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_TSO6, true), - DEFINE_PROP_BIT64("guest_ecn", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_ECN, true), - DEFINE_PROP_BIT64("guest_ufo", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_UFO, true), - DEFINE_PROP_BIT64("guest_announce", VirtIONet, host_features, - VIRTIO_NET_F_GUEST_ANNOUNCE, true), - DEFINE_PROP_BIT64("host_tso4", VirtIONet, host_features, - VIRTIO_NET_F_HOST_TSO4, true), - DEFINE_PROP_BIT64("host_tso6", VirtIONet, host_features, - VIRTIO_NET_F_HOST_TSO6, true), - DEFINE_PROP_BIT64("host_ecn", VirtIONet, host_features, - VIRTIO_NET_F_HOST_ECN, true), - DEFINE_PROP_BIT64("host_ufo", VirtIONet, host_features, - VIRTIO_NET_F_HOST_UFO, true), - DEFINE_PROP_BIT64("mrg_rxbuf", VirtIONet, host_features, - VIRTIO_NET_F_MRG_RXBUF, true), - DEFINE_PROP_BIT64("status", VirtIONet, host_features, - VIRTIO_NET_F_STATUS, true), - DEFINE_PROP_BIT64("ctrl_vq", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_VQ, true), - DEFINE_PROP_BIT64("ctrl_rx", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_RX, true), - DEFINE_PROP_BIT64("ctrl_vlan", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_VLAN, true), - DEFINE_PROP_BIT64("ctrl_rx_extra", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_RX_EXTRA, true), - DEFINE_PROP_BIT64("ctrl_mac_addr", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_MAC_ADDR, true), - DEFINE_PROP_BIT64("ctrl_guest_offloads", VirtIONet, host_features, - VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), - DEFINE_PROP_BIT64("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, fal= se), + DEFINE_VIRTIO_FEATURE_BIT("csum", VirtIONet, host_features, + VIRTIO_NET_F_CSUM, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_csum", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_CSUM, true), + DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED("mtu", + VIRTIO_NET_F_MTU), + DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED("mac", + VIRTIO_NET_F_MAC), + DEFINE_VIRTIO_FEATURE_BIT("gso", VirtIONet, host_features, + VIRTIO_NET_F_GSO, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_tso4", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_TSO4, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_tso6", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_TSO6, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_ecn", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_ECN, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_ufo", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_UFO, true), + DEFINE_VIRTIO_FEATURE_BIT("guest_announce", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_ANNOUNCE, true), + DEFINE_VIRTIO_FEATURE_BIT("host_tso4", VirtIONet, host_features, + VIRTIO_NET_F_HOST_TSO4, true), + DEFINE_VIRTIO_FEATURE_BIT("host_tso6", VirtIONet, host_features, + VIRTIO_NET_F_HOST_TSO6, true), + DEFINE_VIRTIO_FEATURE_BIT("host_ecn", VirtIONet, host_features, + VIRTIO_NET_F_HOST_ECN, true), + DEFINE_VIRTIO_FEATURE_BIT("host_ufo", VirtIONet, host_features, + VIRTIO_NET_F_HOST_UFO, true), + DEFINE_VIRTIO_FEATURE_BIT("mrg_rxbuf", VirtIONet, host_features, + VIRTIO_NET_F_MRG_RXBUF, true), + DEFINE_VIRTIO_FEATURE_BIT("status", VirtIONet, host_features, + VIRTIO_NET_F_STATUS, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_vq", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_VQ, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_rx", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_RX, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_vlan", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_VLAN, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_rx_extra", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_RX_EXTRA, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_mac_addr", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_MAC_ADDR, true), + DEFINE_VIRTIO_FEATURE_BIT("ctrl_guest_offloads", VirtIONet, host_featu= res, + VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), + DEFINE_VIRTIO_FEATURE_BIT("mq", VirtIONet, host_features, + VIRTIO_NET_F_MQ, false), + DEFINE_VIRTIO_FEATURE_BIT_NEGOTIATED("speed_duplex", + VIRTIO_NET_F_SPEED_DUPLEX), DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf), DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, TX_TIMER_INTERVAL), diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 3aa99717e2..6272faa180 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -923,9 +923,9 @@ static Property virtio_scsi_properties[] =3D { 0xFFFF), DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSI, parent_obj.conf.cmd_per_= lun, 128), - DEFINE_PROP_BIT("hotplug", VirtIOSCSI, host_features, + DEFINE_VIRTIO_FEATURE_BIT("hotplug", VirtIOSCSI, host_features, VIRTIO_SCSI_F_HOTPLUG, true), - DEFINE_PROP_BIT("param_change", VirtIOSCSI, host_features, + DEFINE_VIRTIO_FEATURE_BIT("param_change", VirtIOSCSI, host_features, VIRTIO_SCSI_F_CHANGE, true= ), DEFINE_PROP_LINK("iothread", VirtIOSCSI, parent_obj.conf.iothread, TYPE_IOTHREAD, IOThread *), diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 99d396c516..2020327eb8 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2601,16 +2601,16 @@ static void virtio_device_instance_finalize(Object = *obj) } =20 static Property virtio_properties[] =3D { - DEFINE_PROP_BIT64("indirect_desc", VirtIODevice, host_features, - VIRTIO_RING_F_INDIRECT_DESC, true), - DEFINE_PROP_BIT64("event_idx", VirtIODevice, host_features, - VIRTIO_RING_F_EVENT_IDX, true), - DEFINE_PROP_BIT64("notify_on_empty", VirtIODevice, host_features, - VIRTIO_F_NOTIFY_ON_EMPTY, true), - DEFINE_PROP_BIT64("any_layout", VirtIODevice, host_features, - VIRTIO_F_ANY_LAYOUT, true), - DEFINE_PROP_BIT64("iommu_platform", VirtIODevice, host_features, - VIRTIO_F_IOMMU_PLATFORM, false), + DEFINE_VIRTIO_FEATURE_BIT("indirect_desc", VirtIODevice, host_features, + VIRTIO_RING_F_INDIRECT_DESC, true), + DEFINE_VIRTIO_FEATURE_BIT("event_idx", VirtIODevice, host_features, + VIRTIO_RING_F_EVENT_IDX, true), + DEFINE_VIRTIO_FEATURE_BIT("notify_on_empty", VirtIODevice, host_featur= es, + VIRTIO_F_NOTIFY_ON_EMPTY, true), + DEFINE_VIRTIO_FEATURE_BIT("any_layout", VirtIODevice, host_features, + VIRTIO_F_ANY_LAYOUT, true), + DEFINE_VIRTIO_FEATURE_BIT("iommu_platform", VirtIODevice, host_feature= s, + VIRTIO_F_IOMMU_PLATFORM, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.19.2