From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121492; cv=none; d=zohomail.com; s=zohoarc; b=dUfkv1WCtZmwx8lsHEMwAQfp9SZGix8tYJtgZ2lVW8o9Eglrd+OUbFlIqogTS17yyS2ILQb1x6tvuua79xZHkZ5qVBu6JKkzAHZbWXPO7HIPcFRFWGFdBU80blk3f+iEaZ6TW53WGqquPdjLGuHmt9UR78xSfAbk4xIQevHQmbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121492; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N6+u67uMyp/AbE5WPamSR4/ih0VagjfgbRPD2Xx9GOc=; b=gJiqTB75WwakxK+AfsosLZaFXNVIAqM6KvqXMy/MZqDyuvkDJkL1FYdKMTLIB4D09g4F4Lhg1G5QH8XpXpPYZaGUF7lX2qSgQ+z5fhoBnIagQ3odGw7Nipuu3eI9otdyiVJ7UeNhBTwl6hrXyowWD6fhpEkwQ9baIlnPyrTO+h8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121492545402.27323766293455; Thu, 3 Sep 2020 01:24:52 -0700 (PDT) Received: from localhost ([::1]:58922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkY7-0004pF-NT for importer@patchew.org; Thu, 03 Sep 2020 04:24:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXB-00036b-42 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkX8-0008RB-Oj for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-RpizbRp6NYClytkB-52oOw-1; Thu, 03 Sep 2020 04:23:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 91DA880734E; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 385E219C59; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B2A47113861E; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N6+u67uMyp/AbE5WPamSR4/ih0VagjfgbRPD2Xx9GOc=; b=KQDAZrsXdJn039tqYmeq3VfHnJ6lxv+tmGLMEBy62P1F9qaeBrLimuHFDzX9GnEdVS3yuF yzHQrHH/9oDWRUVlN0dj9R3nOKKn53ZxTp5FIa9mbdo9O3JxKrxSLPSCbyBLKPqvewiHM8 xrDEbLlpoBGlYZ30bg4UEworbRZfvc4= X-MC-Unique: RpizbRp6NYClytkB-52oOw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 1/8] qapi: enable use of g_autoptr with QAPI types Date: Thu, 3 Sep 2020 10:23:37 +0200 Message-Id: <20200903082344.1877175-2-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:47:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Daniel P. Berrang=C3=A9 Currently QAPI generates a type and function for free'ing it: typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj); This is used in the traditional manner: QCryptoBlockCreateOptions *opts =3D NULL; opts =3D g_new0(QCryptoBlockCreateOptions, 1); ....do stuff with opts... qapi_free_QCryptoBlockCreateOptions(opts); Since bumping the min glib to 2.48, QEMU has incrementally adopted the use of g_auto/g_autoptr. This allows the compiler to run a function to free a variable when it goes out of scope, the benefit being the compiler can guarantee it is freed in all possible code ptahs. This benefit is applicable to QAPI types too, and given the seriously long method names for some qapi_free_XXXX() functions, is much less typing. This change thus makes the code generator emit: G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlockCreateOptions, qapi_free_QCryptoBlockCreateOptions) The above code example now becomes g_autoptr(QCryptoBlockCreateOptions) opts =3D NULL; opts =3D g_new0(QCryptoBlockCreateOptions, 1); ....do stuff with opts... Note, if the local pointer needs to live beyond the scope holding the variable, then g_steal_pointer can be used. This is useful to return the pointer to the caller in the success codepath, while letting it be freed in all error codepaths. return g_steal_pointer(&opts); The crypto/block.h header needs updating to avoid symbol clash now that the g_autoptr support is a standard QAPI feature. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20200723153845.2934357-1-berrange@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.txt | 2 ++ include/crypto/block.h | 2 -- tests/test-qobject-input-visitor.c | 23 +++++++---------------- scripts/qapi/types.py | 1 + 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 69eede6c28..f3e7ced212 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -1321,6 +1321,7 @@ Example: }; =20 void qapi_free_UserDefOne(UserDefOne *obj); + G_DEFINE_AUTOPTR_CLEANUP_FUNC(UserDefOne, qapi_free_UserDefOne) =20 struct UserDefOneList { UserDefOneList *next; @@ -1328,6 +1329,7 @@ Example: }; =20 void qapi_free_UserDefOneList(UserDefOneList *obj); + G_DEFINE_AUTOPTR_CLEANUP_FUNC(UserDefOneList, qapi_free_UserDefOneList) =20 struct q_obj_my_command_arg { UserDefOneList *arg1; diff --git a/include/crypto/block.h b/include/crypto/block.h index d274819791..7a65e8e402 100644 --- a/include/crypto/block.h +++ b/include/crypto/block.h @@ -311,7 +311,5 @@ uint64_t qcrypto_block_get_sector_size(QCryptoBlock *bl= ock); void qcrypto_block_free(QCryptoBlock *block); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlock, qcrypto_block_free) -G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlockCreateOptions, - qapi_free_QCryptoBlockCreateOptions) =20 #endif /* QCRYPTO_BLOCK_H */ diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-= visitor.c index 6bacabf063..e41b91a2a6 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -417,7 +417,7 @@ static void test_visitor_in_struct(TestInputVisitorData= *data, static void test_visitor_in_struct_nested(TestInputVisitorData *data, const void *unused) { - UserDefTwo *udp =3D NULL; + g_autoptr(UserDefTwo) udp =3D NULL; Visitor *v; =20 v =3D visitor_input_test_init(data, "{ 'string0': 'string0', " @@ -433,8 +433,6 @@ static void test_visitor_in_struct_nested(TestInputVisi= torData *data, g_assert_cmpstr(udp->dict1->dict2->userdef->string, =3D=3D, "string"); g_assert_cmpstr(udp->dict1->dict2->string, =3D=3D, "string2"); g_assert(udp->dict1->has_dict3 =3D=3D false); - - qapi_free_UserDefTwo(udp); } =20 static void test_visitor_in_list(TestInputVisitorData *data, @@ -546,7 +544,7 @@ static void test_visitor_in_union_flat(TestInputVisitor= Data *data, const void *unused) { Visitor *v; - UserDefFlatUnion *tmp; + g_autoptr(UserDefFlatUnion) tmp =3D NULL; UserDefUnionBase *base; =20 v =3D visitor_input_test_init(data, @@ -563,8 +561,6 @@ static void test_visitor_in_union_flat(TestInputVisitor= Data *data, =20 base =3D qapi_UserDefFlatUnion_base(tmp); g_assert(&base->enum1 =3D=3D &tmp->enum1); - - qapi_free_UserDefFlatUnion(tmp); } =20 static void test_visitor_in_alternate(TestInputVisitorData *data, @@ -690,7 +686,7 @@ static void test_list_union_integer_helper(TestInputVis= itorData *data, const void *unused, UserDefListUnionKind kind) { - UserDefListUnion *cvalue =3D NULL; + g_autoptr(UserDefListUnion) cvalue =3D NULL; Visitor *v; GString *gstr_list =3D g_string_new(""); GString *gstr_union =3D g_string_new(""); @@ -782,7 +778,6 @@ static void test_list_union_integer_helper(TestInputVis= itorData *data, =20 g_string_free(gstr_union, true); g_string_free(gstr_list, true); - qapi_free_UserDefListUnion(cvalue); } =20 static void test_visitor_in_list_union_int(TestInputVisitorData *data, @@ -851,7 +846,7 @@ static void test_visitor_in_list_union_uint64(TestInput= VisitorData *data, static void test_visitor_in_list_union_bool(TestInputVisitorData *data, const void *unused) { - UserDefListUnion *cvalue =3D NULL; + g_autoptr(UserDefListUnion) cvalue =3D NULL; boolList *elem =3D NULL; Visitor *v; GString *gstr_list =3D g_string_new(""); @@ -879,13 +874,12 @@ static void test_visitor_in_list_union_bool(TestInput= VisitorData *data, =20 g_string_free(gstr_union, true); g_string_free(gstr_list, true); - qapi_free_UserDefListUnion(cvalue); } =20 static void test_visitor_in_list_union_string(TestInputVisitorData *data, const void *unused) { - UserDefListUnion *cvalue =3D NULL; + g_autoptr(UserDefListUnion) cvalue =3D NULL; strList *elem =3D NULL; Visitor *v; GString *gstr_list =3D g_string_new(""); @@ -914,7 +908,6 @@ static void test_visitor_in_list_union_string(TestInput= VisitorData *data, =20 g_string_free(gstr_union, true); g_string_free(gstr_list, true); - qapi_free_UserDefListUnion(cvalue); } =20 #define DOUBLE_STR_MAX 16 @@ -922,7 +915,7 @@ static void test_visitor_in_list_union_string(TestInput= VisitorData *data, static void test_visitor_in_list_union_number(TestInputVisitorData *data, const void *unused) { - UserDefListUnion *cvalue =3D NULL; + g_autoptr(UserDefListUnion) cvalue =3D NULL; numberList *elem =3D NULL; Visitor *v; GString *gstr_list =3D g_string_new(""); @@ -957,7 +950,6 @@ static void test_visitor_in_list_union_number(TestInput= VisitorData *data, =20 g_string_free(gstr_union, true); g_string_free(gstr_list, true); - qapi_free_UserDefListUnion(cvalue); } =20 static void input_visitor_test_add(const char *testpath, @@ -1253,7 +1245,7 @@ static void test_visitor_in_fail_alternate(TestInputV= isitorData *data, static void do_test_visitor_in_qmp_introspect(TestInputVisitorData *data, const QLitObject *qlit) { - SchemaInfoList *schema =3D NULL; + g_autoptr(SchemaInfoList) schema =3D NULL; QObject *obj =3D qobject_from_qlit(qlit); Visitor *v; =20 @@ -1262,7 +1254,6 @@ static void do_test_visitor_in_qmp_introspect(TestInp= utVisitorData *data, visit_type_SchemaInfoList(v, NULL, &schema, &error_abort); g_assert(schema); =20 - qapi_free_SchemaInfoList(schema); qobject_unref(obj); visit_free(v); } diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 3ad33af4ee..3640f17cd6 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -213,6 +213,7 @@ def gen_type_cleanup_decl(name): ret =3D mcgen(''' =20 void qapi_free_%(c_name)s(%(c_name)s *obj); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(%(c_name)s, qapi_free_%(c_name)s) ''', c_name=3Dc_name(name)) return ret --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121596; cv=none; d=zohomail.com; s=zohoarc; b=cjGEJReX7EfdMtpdWocr1Jv2I+meHGuqpNbijq3ow1o53P2yP/6tsXu+KkyvCQM3vCs4EdW0xxol89di0qLveC8JphmRhGJNaTnfOQsBgAdqW3nn/G5+3SJbEUjoXNQ0vajJZlZDaOfjysfbjiHFZrz7a1Wud9QrzXE8ohVVO/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121596; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N0JziJwIPg15gd9mgKvmfLdw/a954O02VSniHury53g=; b=VsPLxuIXuOuqqi+tfy4F8dfuXEX1GPKuI9EQ9VRgc+96XXshIXDR3wZ8kgxLg3qT/t0bwxida4Ft/XR7Kmjik+S+GLeXdVvNnt9Y6+Q5Htv0yEFb3TI8arhnZSDd1rlb+WUVzoZug6PWRyNQpRHWdE+vHWaga/Se736FOyT7RNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121596560104.13847743348458; Thu, 3 Sep 2020 01:26:36 -0700 (PDT) Received: from localhost ([::1]:39386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkZn-0000CU-Iw for importer@patchew.org; Thu, 03 Sep 2020 04:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXE-0003Az-0U for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:43394 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXC-0008Sz-6M for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-9JYimAZwM02iDNXKwXzsUQ-1; Thu, 03 Sep 2020 04:23:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0E8F427C4; Thu, 3 Sep 2020 08:23:47 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B7265D9DC; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B7D9E113846B; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N0JziJwIPg15gd9mgKvmfLdw/a954O02VSniHury53g=; b=H1k9jDWQk51ipTH5m9R6TDpQ5cu+TH/eXu3xkn/FdLvKw8KlRxb9TWiU2s/QadIO8y5Q61 YMuKDy7qN4YZ8+f3l2a7RoegbgjL76X7Hq830cqra/X9D2eYQ3aCSF+T0n0cND2CZoDSDc +KVC5OE/S/6ACZMdFAGespOLqTMCANQ= X-MC-Unique: 9JYimAZwM02iDNXKwXzsUQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 2/8] qapi/block-core.json: Remove stale description of 'blockdev-add' Date: Thu, 3 Sep 2020 10:23:38 +0200 Message-Id: <20200903082344.1877175-3-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, Kashyap Chamarthy 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" From: Kashyap Chamarthy On a 'qemu-discuss' thread[1], Kevin identifies that the current doc blurb for @blockdev-add is stale: This is actually a documentation bug. @id doesn't exist, blockdev-add never creates a BlockBackend. This was different in the very first versions of the patches to add blockdev-add and we probably just forgot to update the documentation after removing it. So remove the stale bits. And the requirement for 'node-name' is already mentioned in the documentation of @BlockdevOptions: [...] # @node-name: the node name of the new node (Since 2.0). # This option is required on the top level of blockdev-add. # Valid node names start with an alphabetic character and m= ay # contain only alphanumeric characters, '-', '.' and '_'. T= heir # maximum length is 31 characters. [...] [1] https://lists.nongnu.org/archive/html/qemu-discuss/2020-07/msg00071.html -- equivalent to "-drive if=3Dide,id=3Ddisk0....." Fixes: be4b67bc7d ("blockdev: Allow creation of BDS trees without BB") Signed-off-by: Kashyap Chamarthy Suggested-by: Kevin Wolf Message-Id: <20200805100158.1239390-1-kchamart@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Markus Armbruster --- qapi/block-core.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index db08c58d78..55b58ba892 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4036,9 +4036,7 @@ ## # @blockdev-add: # -# Creates a new block device. If the @id option is given at the top level,= a -# BlockBackend will be created; otherwise, @node-name is mandatory at the = top -# level and no BlockBackend will be created. +# Creates a new block device. # # Since: 2.9 # --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121677; cv=none; d=zohomail.com; s=zohoarc; b=TIVLSl6o6elJPgDEdbfsKHEph4wJIYwOnlgudvBL6V0ClF5P2kMKXVkiJKl9OOaDXb4gY3pCriR0TqdM2kH0kxS6PoVYgpBbaDts8MItOS7ZXKbABHSkxot/UhAobCIGA0q3AzI+ZT0ndSSKLF7l7rwLg9lAZQUQxPv1SseV99E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121677; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z8ubN+tdCrhRxUlksdxzuiplGfIIQAvNh+Rl+aXl8u4=; b=nYaA44//AiNlFpfatEgQuFHGzTScQDp5J8bnXnyEEPn3D+V0gflWCRYC6T0Oc47S68qPWKvQ/OOaQnJZZPkUkORPhGH7AiMqc2ucGip2u3ZieAm+UCtqNsBKANAH7oeEbj8p9xJQy9/zwXR2SfpnIyZpd3Gc6+4dzfwF32NndHw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121677320828.5142683618399; Thu, 3 Sep 2020 01:27:57 -0700 (PDT) Received: from localhost ([::1]:46366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkb6-00035d-IK for importer@patchew.org; Thu, 03 Sep 2020 04:27:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXK-0003SF-2x for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:24:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:28790 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXI-0008VM-Cu for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:24:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-iHzBjFC9OlSlD6ZkWhbMbg-1; Thu, 03 Sep 2020 04:23:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73EDB1091064; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42D3C60250; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BB3D01144226; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z8ubN+tdCrhRxUlksdxzuiplGfIIQAvNh+Rl+aXl8u4=; b=E9q1QnIUzjPZEqR0CvlZ0AFy0nlwfRgEoDh701kcFuOUTLvokzfJRDqm1DJiC38UEHCLnY TYgEBf+ZiRfpmaBHu4SNEHWpVqOQVpgqa4UchNi+EJyEyg6J6gYds2Q0aqhU0z9CSUyAsM 3E/bd2EQLNqoROUUHPO8OHBt2NLnCy4= X-MC-Unique: iHzBjFC9OlSlD6ZkWhbMbg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 3/8] scripts/qmp/qom-fuse: Unbreak import of QEMUMonitorProtocol Date: Thu, 3 Sep 2020 10:23:39 +0200 Message-Id: <20200903082344.1877175-4-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Commit c7b942d7f8 "scripts/qmp: Fix shebang and imports" messed with it for reasons I don't quite understand. I do understand how it fails now: it neglects to import sys. Fix that. It now fails because it expects an old version of module fuse. That's next. Fixes: c7b942d7f84ef54f266921bf7668d43f1f2c7c79 Signed-off-by: Markus Armbruster Message-Id: <20200723142738.1868568-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: John Snow --- scripts/qmp/qom-fuse | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qmp/qom-fuse b/scripts/qmp/qom-fuse index 5fa6b3bf64..b7dabe8d65 100755 --- a/scripts/qmp/qom-fuse +++ b/scripts/qmp/qom-fuse @@ -13,7 +13,7 @@ =20 import fuse, stat from fuse import Fuse -import os, posix +import os, posix, sys from errno import * =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) @@ -134,7 +134,7 @@ class QOMFS(Fuse): yield fuse.Direntry(str(item['name'])) =20 if __name__ =3D=3D '__main__': - import sys, os + import os =20 fs =3D QOMFS(QEMUMonitorProtocol(os.environ['QMP_SOCKET'])) fs.main(sys.argv) --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121494; cv=none; d=zohomail.com; s=zohoarc; b=So43J+tNgEC9W7cD9ktxqCnSNrliCtw8Cs/6O4mRaXxGB8uNoknY1VhmM9YvgiEax4VR6z9UitaThQyeYTrjsV4+VlMMQKhqcSBPB6Vq1DFt0tnWKvjh0celfn0H6BPAPbVjHUuZ70HXg30SojKzT5lm0FRKPNVKDcbKV1sCr34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121494; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y++QSgRJlH/gQE4gNXs2Alm/h9hnEyIdu1Oav+EA6RI=; b=XrulhgY9rXlznh3fRBSHj9guI5vZDWg/uJPi0nVqYnG3UQuusiaGgM+xgMl5yfLypPzebM0QeLThmbBCNyJwpw9pt5wtMFKPCIJHfdrAZBsQJgjFw75j9KDFvEgaX9RpIT9ANceV4fGcKWO/IzUPQOSE0F8jtZ/CmWMKzCl5HVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121494907161.45838266870464; Thu, 3 Sep 2020 01:24:54 -0700 (PDT) Received: from localhost ([::1]:59134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkYA-0004vO-5Z for importer@patchew.org; Thu, 03 Sep 2020 04:24:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXC-00037O-Dt for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42605 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXA-0008Sh-IK for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:54 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-_SdWwz8pPxqVapeyUOC78Q-1; Thu, 03 Sep 2020 04:23:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC86080B702; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 564DA78B40; Thu, 3 Sep 2020 08:23:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BEAC4111CA2A; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y++QSgRJlH/gQE4gNXs2Alm/h9hnEyIdu1Oav+EA6RI=; b=C5pAmVo5D7FQUh1mfhwXzJUukxr1DiDrY+nnEc2VlrjqB+8siSbCu0HYEXtnX3Us+DQTOq 1Hhx5Fpf0UoDNFDIoO+keM5tFWfuecA6YzgP3zYlGGtj+un7tn0XgsonMBTpbZoiKCZMw+ P2y18M8lyxa3khXVRp1HX5g8V4PvzFw= X-MC-Unique: _SdWwz8pPxqVapeyUOC78Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 4/8] scripts/qmp/qom-fuse: Port to current Python module fuse Date: Thu, 3 Sep 2020 10:23:40 +0200 Message-Id: <20200903082344.1877175-5-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 00:24:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Message-Id: <20200723142738.1868568-3-armbru@redhat.com> Reviewed-by: John Snow --- scripts/qmp/qom-fuse | 93 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/scripts/qmp/qom-fuse b/scripts/qmp/qom-fuse index b7dabe8d65..405e6ebd67 100755 --- a/scripts/qmp/qom-fuse +++ b/scripts/qmp/qom-fuse @@ -3,16 +3,18 @@ # QEMU Object Model test tools # # Copyright IBM, Corp. 2012 +# Copyright (C) 2020 Red Hat, Inc. # # Authors: # Anthony Liguori +# Markus Armbruster # # This work is licensed under the terms of the GNU GPL, version 2 or later= . See # the COPYING file in the top-level directory. ## =20 import fuse, stat -from fuse import Fuse +from fuse import FUSE, FuseOSError, Operations import os, posix, sys from errno import * =20 @@ -21,9 +23,8 @@ from qemu.qmp import QEMUMonitorProtocol =20 fuse.fuse_python_api =3D (0, 2) =20 -class QOMFS(Fuse): - def __init__(self, qmp, *args, **kwds): - Fuse.__init__(self, *args, **kwds) +class QOMFS(Operations): + def __init__(self, qmp): self.qmp =3D qmp self.qmp.connect() self.ino_map =3D {} @@ -65,21 +66,21 @@ class QOMFS(Fuse): except: return False =20 - def read(self, path, length, offset): + def read(self, path, length, offset, fh): if not self.is_property(path): return -ENOENT =20 path, prop =3D path.rsplit('/', 1) try: - data =3D str(self.qmp.command('qom-get', path=3Dpath, property= =3Dprop)) + data =3D self.qmp.command('qom-get', path=3Dpath, property=3Dp= rop) data +=3D '\n' # make values shell friendly except: - return -EPERM + raise FuseOSError(EPERM) =20 if offset > len(data): return '' =20 - return str(data[offset:][:length]) + return bytes(data[offset:][:length], encoding=3D'utf-8') =20 def readlink(self, path): if not self.is_link(path): @@ -89,52 +90,52 @@ class QOMFS(Fuse): return prefix + str(self.qmp.command('qom-get', path=3Dpath, property=3Dprop)) =20 - def getattr(self, path): + def getattr(self, path, fh=3DNone): if self.is_link(path): - value =3D posix.stat_result((0o755 | stat.S_IFLNK, - self.get_ino(path), - 0, - 2, - 1000, - 1000, - 4096, - 0, - 0, - 0)) + value =3D { 'st_mode': 0o755 | stat.S_IFLNK, + 'st_ino': self.get_ino(path), + 'st_dev': 0, + 'st_nlink': 2, + 'st_uid': 1000, + 'st_gid': 1000, + 'st_size': 4096, + 'st_atime': 0, + 'st_mtime': 0, + 'st_ctime': 0 } elif self.is_object(path): - value =3D posix.stat_result((0o755 | stat.S_IFDIR, - self.get_ino(path), - 0, - 2, - 1000, - 1000, - 4096, - 0, - 0, - 0)) + value =3D { 'st_mode': 0o755 | stat.S_IFDIR, + 'st_ino': self.get_ino(path), + 'st_dev': 0, + 'st_nlink': 2, + 'st_uid': 1000, + 'st_gid': 1000, + 'st_size': 4096, + 'st_atime': 0, + 'st_mtime': 0, + 'st_ctime': 0 } elif self.is_property(path): - value =3D posix.stat_result((0o644 | stat.S_IFREG, - self.get_ino(path), - 0, - 1, - 1000, - 1000, - 4096, - 0, - 0, - 0)) + value =3D { 'st_mode': 0o644 | stat.S_IFREG, + 'st_ino': self.get_ino(path), + 'st_dev': 0, + 'st_nlink': 1, + 'st_uid': 1000, + 'st_gid': 1000, + 'st_size': 4096, + 'st_atime': 0, + 'st_mtime': 0, + 'st_ctime': 0 } else: - value =3D -ENOENT + raise FuseOSError(ENOENT) return value =20 - def readdir(self, path, offset): - yield fuse.Direntry('.') - yield fuse.Direntry('..') + def readdir(self, path, fh): + yield '.' + yield '..' for item in self.qmp.command('qom-list', path=3Dpath): - yield fuse.Direntry(str(item['name'])) + yield str(item['name']) =20 if __name__ =3D=3D '__main__': import os =20 - fs =3D QOMFS(QEMUMonitorProtocol(os.environ['QMP_SOCKET'])) - fs.main(sys.argv) + fuse =3D FUSE(QOMFS(QEMUMonitorProtocol(os.environ['QMP_SOCKET'])), + sys.argv[1], foreground=3DTrue) --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121592; cv=none; d=zohomail.com; s=zohoarc; b=hmFvPEGcEgrbGPpmSSncUTZfmrreAJ6dqHugI0sv6mPrNXzFXat+p/y7sdrHIdD8qQl1ETJ6MCnXJHR9OeQ1JWDumbcOUgVyylUjRTiQVx89ZXGtw0FBD6RuAeEPFu3+4ZYLLsjRqJ9ZDJdoN/7mCQDrk+rtLlmMuWnWHSIEXhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121592; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RQH1cJbYM7RTOn2N/nvb7r0JrpvVSjb4iYelSRnoVzQ=; b=CAROcuh9nv+C3iYBq0uhv1iQ4LQad/STPbJyvaMXYXwi6nv/ruc3Kg+2syGJzOyEMzg4/F2ypblyAX3vPeFSIskQYLLr4lnb6cmXKkt+JGEC7DSHcn40lxjUp2vnlUHjJgYKr3CVrR9AVRG11ICt1cxNXaF9bnjDXUAdKEdnSVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121592876155.47317655622373; Thu, 3 Sep 2020 01:26:32 -0700 (PDT) Received: from localhost ([::1]:39014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkZk-0008Uu-27 for importer@patchew.org; Thu, 03 Sep 2020 04:26:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXD-00039V-8G for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:55 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:35453 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXB-0008Sq-L8 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:54 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-kUx-KGHzPiGQjISWzpIapg-1; Thu, 03 Sep 2020 04:23:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0525D107B2AD; Thu, 3 Sep 2020 08:23:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8F7A672CF; Thu, 3 Sep 2020 08:23:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C2EF31189F45; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RQH1cJbYM7RTOn2N/nvb7r0JrpvVSjb4iYelSRnoVzQ=; b=GHIGOcIoiUA69/W9A8dLjHyhUWKUMDT1g++zmzZBUSzra3i4QssHEwctii+ZR2jym4vSKf VyRX/jCcLqFMNUCR61lqZi3zzwu+AqgLdht+VkKwFu7vLUYAfRLDO+8YT1UZEa8YZa04Lz fgvvDKdzI86c7KNFqzohN50IfLvgia0= X-MC-Unique: kUx-KGHzPiGQjISWzpIapg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 5/8] scripts/qmp/qom-fuse: Fix getattr(), read() for files in / Date: Thu, 3 Sep 2020 10:23:41 +0200 Message-Id: <20200903082344.1877175-6-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) path, prop =3D "type".rsplit('/', 1) sets path to "", which doesn't work. Correct to "/". Signed-off-by: Markus Armbruster Message-Id: <20200723142738.1868568-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: John Snow --- scripts/qmp/qom-fuse | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/qmp/qom-fuse b/scripts/qmp/qom-fuse index 405e6ebd67..7c7cff8edf 100755 --- a/scripts/qmp/qom-fuse +++ b/scripts/qmp/qom-fuse @@ -45,8 +45,10 @@ class QOMFS(Operations): return False =20 def is_property(self, path): + path, prop =3D path.rsplit('/', 1) + if path =3D=3D '': + path =3D '/' try: - path, prop =3D path.rsplit('/', 1) for item in self.qmp.command('qom-list', path=3Dpath): if item['name'] =3D=3D prop: return True @@ -55,8 +57,10 @@ class QOMFS(Operations): return False =20 def is_link(self, path): + path, prop =3D path.rsplit('/', 1) + if path =3D=3D '': + path =3D '/' try: - path, prop =3D path.rsplit('/', 1) for item in self.qmp.command('qom-list', path=3Dpath): if item['name'] =3D=3D prop: if item['type'].startswith('link<'): @@ -71,6 +75,8 @@ class QOMFS(Operations): return -ENOENT =20 path, prop =3D path.rsplit('/', 1) + if path =3D=3D '': + path =3D '/' try: data =3D self.qmp.command('qom-get', path=3Dpath, property=3Dp= rop) data +=3D '\n' # make values shell friendly --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121676; cv=none; d=zohomail.com; s=zohoarc; b=GIRewKHui0MV+y2GDuiNozGeFOJ4tpD6LbKf2C35aUhvWt9qddmg8Y3kDbB4L8C2Qt8Cr3HseV8y36jOPfuBmnjv/crUzXY5ilqLJFW07e4Za5laUooDErxgzbvm5+T5K7yTGtG3ngphMJ0ZBQnrYaPLGfnqSF2S1mSn+rcl6Dg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121676; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YHjhf6PzUIaoSP4VLLRG7BIp8RgevkaPLq7xAy1AuSc=; b=JDvzWBqN496W8mA2hFgWKbxmxoTpq6zc/biMOqu7byBtcekFmvk+xjdDgDcMAnHAn0DXL1KR7jr+VMGlRhz4YehbOUVf9xZNsjmNnb2NoZCvQ8YgtZel1R80b/lK4s2A1QLFz0/6UazH94m8e3vxNtR3Bb9sVxygZ3LEFZbmC94= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121676781614.742726903442; Thu, 3 Sep 2020 01:27:56 -0700 (PDT) Received: from localhost ([::1]:46312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkb5-00034B-VE for importer@patchew.org; Thu, 03 Sep 2020 04:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXG-0003FU-0v for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXE-0008TO-5i for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-iYBANOkTPXiqd1N4jTqiVw-1; Thu, 03 Sep 2020 04:23:51 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2FDD8030DD; Thu, 3 Sep 2020 08:23:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3F8E87B2D; Thu, 3 Sep 2020 08:23:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C692710C83DE; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YHjhf6PzUIaoSP4VLLRG7BIp8RgevkaPLq7xAy1AuSc=; b=IS0r2bhElZ5csOg1uNuALT2+yKuLxgBRX6gJiLvrLJUsTCPcZPQJTDA2v35gqLHbSwDr0O udBCrNOHqDJnSgUUhayh1tk3CO3xrLZPprUCoapaLHqTnJ1E4l1FPLd0Urt8A39F1ra9Vi KepIifWj1LMIRKATcP5/W9PFkBXA6YI= X-MC-Unique: iYBANOkTPXiqd1N4jTqiVw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 6/8] docs/interop/qmp-spec: Point to the QEMU QMP reference manual Date: Thu, 3 Sep 2020 10:23:42 +0200 Message-Id: <20200903082344.1877175-7-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Commit 4d8bb958fa0..231aaf3a821 integrated the contents of docs/qmp-events.txt into QAPI schema doc comments. It left dangling references to qmp-events.txt behind. Fix to point to the QEMU QMP reference manual generated from the QAPI schema. Add a similar reference for commands. Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Markus Armbruster Message-Id: <20200806081147.3123652-2-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- docs/interop/qmp-spec.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/interop/qmp-spec.txt b/docs/interop/qmp-spec.txt index adcf86754d..cdf5842555 100644 --- a/docs/interop/qmp-spec.txt +++ b/docs/interop/qmp-spec.txt @@ -110,6 +110,9 @@ or if provided. The "id" member can be any json-value. A json-number incremented for each successive command works fine. =20 +The actual commands are documented in the QEMU QMP reference manual +docs/interop/qemu-qmp-ref.{7,html,info,pdf,txt}. + 2.3.1 Out-of-band execution --------------------------- =20 @@ -207,13 +210,13 @@ The format of asynchronous events is: there is a failure to retrieve host time, both members of the timestamp will be set to -1. =20 -For a listing of supported asynchronous events, please, refer to the -qmp-events.txt file. +The actual asynchronous events are documented in the QEMU QMP +reference manual docs/interop/qemu-qmp-ref.{7,html,info,pdf,txt}. =20 Some events are rate-limited to at most one per second. If additional "similar" events arrive within one second, all but the last one are dropped, and the last one is delayed. "Similar" normally means same -event type. See qmp-events.txt for details. +event type. =20 2.6 Forcing the JSON parser into known-good state ------------------------------------------------- --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121500; cv=none; d=zohomail.com; s=zohoarc; b=NpIh6Bp6qX2hRnqMRGfxBon7VNZuDX/SBMtfknF1g89cJ790MsOpU1x2ogONccoEjrizR6WfzbSa7ty2Rr6VwRJ0+Vnr3iavWat5wnMl4dv4hXSEa2yMd75X5NY+W/gIVE0ET3LObEyhK4kNUDko2XT2S5PbBajZdc/2YGoiNPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121500; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UjDCYTpK1JOw4ypOGJNlm7ftRL0hXOjYJHqEdU5A9Uc=; b=Dr+MpABwqHrwziQ5qSeodIW1PUWLMi/ZVUPUj2Te2TfJXNFj3u2CLpbWxDY/RBPafYBuluMcJKhIYLjjq9KPN/h3KF141GQcrKsDuEsFhPRNep3U0Sdioz2rw5qcoZFYM6WELWql3lffq/+HLnmNj+9/+TVh3HjjTsTUx7A/0Js= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121500164785.7562923602986; Thu, 3 Sep 2020 01:25:00 -0700 (PDT) Received: from localhost ([::1]:59312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkYF-0004zk-4i for importer@patchew.org; Thu, 03 Sep 2020 04:24:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXE-0003CL-Q1 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34574 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXD-0008TQ-7S for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-nMtJYnZsMxewRb_jXmLDUA-1; Thu, 03 Sep 2020 04:23:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 921A985C731; Thu, 3 Sep 2020 08:23:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9ACC5C1C2; Thu, 3 Sep 2020 08:23:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C9EEE10C7784; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UjDCYTpK1JOw4ypOGJNlm7ftRL0hXOjYJHqEdU5A9Uc=; b=RmtF8LiaeCWStvZEBu8o/23Wrnk5Tz9H8F9wfvAeLDsVoOi14USjG4/R7wA3dtUSj4T9NF JJoXeGWwb3BpkLXJH56RQxqcfKqsHPAeed+3xQiIZjepW6A+akVMUcKWOZI66iKpzpdbKW 9lUN3IxnxreHO0H2guIqg50Wor8fZ4g= X-MC-Unique: nMtJYnZsMxewRb_jXmLDUA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 7/8] qapi: Document event VSERPORT_CHANGE is rate-limited Date: Thu, 3 Sep 2020 10:23:43 +0200 Message-Id: <20200903082344.1877175-8-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:58:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Commit e2ae6159de "virtio-serial: report frontend connection state via monitor" neglected to document the new event is rate-limited. Fix that. Cc: Marc-Andr=C3=A9 Lureau Cc: Eric Blake Signed-off-by: Markus Armbruster Message-Id: <20200806081147.3123652-3-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- qapi/char.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qapi/char.json b/qapi/char.json index 8aeedf96b2..b4d66ec90b 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -562,6 +562,8 @@ # # @open: true if the guest has opened the virtio-serial port # +# Note: This event is rate-limited. +# # Since: 2.1 # # Example: --=20 2.26.2 From nobody Sun Nov 16 05:42:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599121594; cv=none; d=zohomail.com; s=zohoarc; b=FO2qxFftxMiOc/i/Ez9b+bHAWm3BmPs2HhWHM/5DAJ5pgVI5OxxFCAdFjJmFHnz8Lmug8M3guOcnMG1X8u07nImmI7ajEIEh6MyaMFdqlPwyuABZ+KzGUdXGF2HljfGzfLlOJlFAGULckzKovtpzVMtgVScIh+S980ok7wkG5sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599121594; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6R9Jg7opXvR8jDkvvA6MGBCHBDiXgUX75X5k3fE0S+k=; b=IlkFC9WlLB8RWz9l43l9bkbrO7dK7EHejF/aPAKWL3XNBvBt7PvOKpn1cO7HzNP7sGoLoxEo85RCQx0dFTxzHqmp5iK4T7/g8czEIaJewlEj+JP+SINtsT6E3KvOIB3eqWLXG4FJz0eYlzwIc09m23e6gVwau5eQ562wMbBeLow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599121594115392.3708234578928; Thu, 3 Sep 2020 01:26:34 -0700 (PDT) Received: from localhost ([::1]:39128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkZl-000061-7H for importer@patchew.org; Thu, 03 Sep 2020 04:26:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkXE-0003Bh-Cf for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:56 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31010 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDkXC-0008T8-H1 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:23:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-ARE-wZPsN12U4Io6YID6kg-1; Thu, 03 Sep 2020 04:23:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03A2C107B768; Thu, 3 Sep 2020 08:23:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-68.ams2.redhat.com [10.36.113.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCB5419C59; Thu, 3 Sep 2020 08:23:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CD67910C778B; Thu, 3 Sep 2020 10:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599121433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6R9Jg7opXvR8jDkvvA6MGBCHBDiXgUX75X5k3fE0S+k=; b=gogk0mfB9sqpcWw1ik1Ixr1VrOYf2mUjXHoqSh6rUDfpsjErT2k21V621kJIv5TpEjN3Ti llABqvxHCzBUVSLVEjngo2wDMasvKid+FcBrBj4hlJ4K1HNausrJx15K2RB1ooowLVKs/6 TKZQ1MezTed/TwPd7TYY91fkSzHQrMM= X-MC-Unique: ARE-wZPsN12U4Io6YID6kg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 8/8] docs/qdev-device-use: Don't suggest -drive and -net can do USB Date: Thu, 3 Sep 2020 10:23:44 +0200 Message-Id: <20200903082344.1877175-9-armbru@redhat.com> In-Reply-To: <20200903082344.1877175-1-armbru@redhat.com> References: <20200903082344.1877175-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 01:28:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Thomas Huth , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit 480324ec8d "docs/qdev-device-use: Clean up the sentences related to -usbdevice" deleted the information on syntax that no longer works. Unfortunately, the resulting text suggests you can configure USB block devices with -drive, and USB network devices with -net, which is misleading. Instead of rephrasing the now misleading text, I'm putting the information back, and just make clear it's about old versions of QEMU. Cc: Thomas Huth Cc: Gerd Hoffmann Signed-off-by: Markus Armbruster Message-Id: <20200806081147.3123652-4-armbru@redhat.com> --- docs/qdev-device-use.txt | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt index 9889521e3c..245cdf29c7 100644 --- a/docs/qdev-device-use.txt +++ b/docs/qdev-device-use.txt @@ -125,7 +125,14 @@ The -device argument differs in detail for each type o= f drive: =20 * if=3Dpflash, if=3Dmtd, if=3Dsd, if=3Dxen are not yet available with -dev= ice =20 -For USB storage devices, you can use something like: +For USB devices, the old way was actually different: + + -usbdevice disk:format=3DFMT:FILENAME + +"Was" because "disk:" is gone since v2.12.0. + +The old way provided much less control than -drive's OPTS... The new +way fixes that: =20 -device usb-storage,drive=3DDRIVE-ID,removable=3DRMB =20 @@ -178,6 +185,9 @@ The appropriate DEVNAME depends on the machine type. F= or type "pc": =20 -device usb-braille,chardev=3Dbraille -chardev braille,id=3Dbraille =20 +* -usbdevice serial::chardev is gone since v2.12.0. It became + -device usb-serial,chardev=3Ddev. + LEGACY-CHARDEV translates to -chardev HOST-OPTS... as follows: =20 * null becomes -chardev null @@ -231,6 +241,12 @@ The old way to define the guest part looks like this: =20 -net nic,netdev=3DNET-ID,macaddr=3DMACADDR,model=3DMODEL,name=3DID,add= r=3DSTR,vectors=3DV =20 +Except for USB it looked like this: + + -usbdevice net:netdev=3DNET-ID,macaddr=3DMACADDR,name=3DID + +"Looked" because "net:" is gone since v2.12.0. + The new way is -device: =20 -device DEVNAME,netdev=3DNET-ID,mac=3DMACADDR,DEV-OPTS... @@ -328,6 +344,13 @@ The new way is -device DEVNAME,DEV-OPTS... Details de= pend on DRIVER: * u2f -device u2f-{emulated,passthru} * braille See "Character Devices" =20 +Until v2.12.0, we additionally had + +* host:... See "Host Device Assignment" +* disk:... See "Block Devices" +* serial:... See "Character Devices" +* net:... See "Network Devices" + =3D=3D=3D Watchdog Devices =3D=3D=3D =20 Host and guest part of watchdog devices have always been separate. @@ -343,7 +366,14 @@ and host USB devices. PCI devices can only be assigne= d with -device: =20 -device vfio-pci,host=3DADDR,id=3DID =20 -To assign a host USB device use: +The old way to assign a USB host device + + -usbdevice host:auto:BUS.ADDR:VID:PRID + +was removed in v2.12.0. Any of BUS, ADDR, VID, PRID could be the +wildcard *. + +The new way is =20 -device usb-host,hostbus=3DBUS,hostaddr=3DADDR,vendorid=3DVID,producti= d=3DPRID =20 --=20 2.26.2