From nobody Sun Nov 16 20:48:24 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=1601932314; cv=none; d=zohomail.com; s=zohoarc; b=fTvmYXA4Lr3N9yK5H3UCcYougTWAZ7buMrCNU43sQCnwI7qk7nM1MmsulP4dPP5sMEZbinE5ciZdAHGikN2SCueWJL+/p70Q32wvwRm/AFFUY3mkb6M9LYaBbf74hQlXOqnIDF6YTpFZuTS3sMDrLhGjwsvMpT4Ebz/QCnS5q9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932314; 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=GfFoCaY7u2a8bedI085FZLdj/V/rVAXLYLm4VQS+GFk=; b=NoNXreDbbScS4gZjy0wROYkIoIZ6PDrqPrfaX0gf9HzENJqRExZ7CYS0bzgdMUVOKvZojqmDpYVELxCHpzr5JQx59DqMgSH1E55jt34Arp9uzNWVajCoQKu2vWqzuC/XnXYIDXz9XpfO9J1x9YHzdVB4K4F2+l2JTu/Jx0/QkQU= 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 1601932314621865.5856539455409; Mon, 5 Oct 2020 14:11:54 -0700 (PDT) Received: from localhost ([::1]:46614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXlw-0001UL-GU for importer@patchew.org; Mon, 05 Oct 2020 17:11:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkJ-00088W-I4 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkH-0007Ku-AR for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:11 -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-15-MeIn9L3bOCKyYWW2ljK5qg-1; Mon, 05 Oct 2020 17:10:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E892104D3E6; Mon, 5 Oct 2020 21:10:04 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51BF07368A; Mon, 5 Oct 2020 21:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932207; 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=GfFoCaY7u2a8bedI085FZLdj/V/rVAXLYLm4VQS+GFk=; b=YCApkoGECmUl9eIFBqB3Uldoro40zCKHDKaAqp1F2MDudWfT5otvUssYonScq7g+qJTiCd VMdpVpkarAgiUIk66Rt+KM22HOF6LsDTmEl79kc3vkMpxG1kYGDzeqoziOxEj77bRYJflh DIRBr9Y4vBG9r7nZx0DAFZhZUKlDAUk= X-MC-Unique: MeIn9L3bOCKyYWW2ljK5qg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 01/21] numa: hmat: require parent cache description before the next level one Date: Mon, 5 Oct 2020 17:09:40 -0400 Message-Id: <20201005211000.710404-2-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Igor Mammedov 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: Igor Mammedov Spec[1] defines 0 - 3 level memory side cache, however QEMU CLI allows to specify an intermediate cache level without specifying previous level. Such option(s) silently ignored when building HMAT table, which leads to incomplete cache information. Make sure that previous level exists and error out if it hasn't been provided. 1) ACPI 6.2A 5.2.27.5 Memory Side Cache Information Structure Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1842877 Signed-off-by: Igor Mammedov Message-Id: <20200924091406.1321012-1-imammedo@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- hw/core/numa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index 7d5d4130016..6dc3d19d282 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -424,7 +424,13 @@ void parse_numa_hmat_cache(MachineState *ms, NumaHmatC= acheOptions *node, } =20 if ((node->level > 1) && - ms->numa_state->hmat_cache[node->node_id][node->level - 1] && + ms->numa_state->hmat_cache[node->node_id][node->level - 1] =3D=3D = NULL) { + error_setg(errp, "Cache level=3D%" PRIu8 " shall be defined first", + node->level - 1); + return; + } + + if ((node->level > 1) && (node->size <=3D ms->numa_state->hmat_cache[node->node_id][node->level - 1]->si= ze)) { error_setg(errp, "Invalid size=3D%" PRIu64 ", the size of level=3D= %" PRIu8 --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932315; cv=none; d=zohomail.com; s=zohoarc; b=k6cfjd0W5goh1dO71M49i8JWGhyagQoLspZKLjpaJ9haIBRYHEQ/Xq+tAsPjNK9j2KvuFTUPu76s/KSgSCcztyLSbhSZ8IEVx8nJRtyceJnQuZS0fWpxsPibjpyFwBDJ7aj4FxR0vzZ6FvAnxX/WGygGLqNpSGo8UiWFekttIg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932315; 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=E6S0MWYuU82hEOhb8xdp9gpDqCKdgJ7Ff29hgqzdvNI=; b=I30fWBT1XCADhIeBcl9eacR3KDv0DTqNaAlAicayUYMHrtuiUKaFBKD/0AXXPCV9fIt8glEGso16dbhpyJvpQcCuJWkiJbyvbxmktdMc5YuUFXsXaWrS2BLOF0lNYnI3tphO0JrsxrEwOhaqc2cEro15miYKncqZwBfedp1i7SU= 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 1601932315452545.8055103917106; Mon, 5 Oct 2020 14:11:55 -0700 (PDT) Received: from localhost ([::1]:46744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXly-0001Yp-6k for importer@patchew.org; Mon, 05 Oct 2020 17:11:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkN-00089A-E2 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkJ-0007L6-H2 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:15 -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-403-Pf8jDKjINPKX6jxG-4emzw-1; Mon, 05 Oct 2020 17:10:07 -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 A7ACD18A8220; Mon, 5 Oct 2020 21:10:06 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E4EF55770; Mon, 5 Oct 2020 21:10:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932210; 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=E6S0MWYuU82hEOhb8xdp9gpDqCKdgJ7Ff29hgqzdvNI=; b=QRqJGotehhIT97XI6RLZb9kTLb34yuPjofNcxWUv3Vi4bPtFmW4JrnLhwyQjIdkxZrPx5U eTqNmByn1jb2AcxTGMyW+6E3cFXW0+Hcl/29Zy5d/aIbY43MSqXw+V2sEXrvcYZaTMObDC Z3YnHJUay2p5xWpxDFugQ5lNsKSBGSU= X-MC-Unique: Pf8jDKjINPKX6jxG-4emzw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 02/21] hw/core/qdev-properties: Use qemu_strtol() in set_mac() handler Date: Mon, 5 Oct 2020 17:09:41 -0400 Message-Id: <20201005211000.710404-3-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 The MACAddr structure contains an array of uint8_t. Previously if a value was out of the [0..255] range, it was silently casted and no input validation was done. Replace strtol() by qemu_strtol() -- so checkpatch.pl won't complain if we move this code later -- and return EINVAL if the input is invalid. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-3-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 343c824da04..080ba319a1f 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "net/net.h" #include "hw/qdev-properties.h" #include "qapi/error.h" @@ -524,7 +525,8 @@ static void set_mac(Object *obj, Visitor *v, const char= *name, void *opaque, Property *prop =3D opaque; MACAddr *mac =3D qdev_get_prop_ptr(dev, prop); int i, pos; - char *str, *p; + char *str; + const char *p; =20 if (dev->realized) { qdev_prop_set_after_realize(dev, name, errp); @@ -536,6 +538,8 @@ static void set_mac(Object *obj, Visitor *v, const char= *name, void *opaque, } =20 for (i =3D 0, pos =3D 0; i < 6; i++, pos +=3D 3) { + long val; + if (!qemu_isxdigit(str[pos])) { goto inval; } @@ -551,7 +555,10 @@ static void set_mac(Object *obj, Visitor *v, const cha= r *name, void *opaque, goto inval; } } - mac->a[i] =3D strtol(str+pos, &p, 16); + if (qemu_strtol(str + pos, &p, 16, &val) < 0 || val > 0xff) { + goto inval; + } + mac->a[i] =3D val; } g_free(str); return; --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932443; cv=none; d=zohomail.com; s=zohoarc; b=Lb1i+NQNZ9LxrGKtWR2JEpBSl/bBbefSnMq9ifnyl/6aQ8qChYFt6d75AZSWpVqpFjX9WxWiyN64LJgNFzJYEvokIWjzCtbQZp1b+gnWWgF1EfHWXWZrZlVsgraLBX8oW3Pv1ZisF8adLmyNiVmZRimq403lpg3KK/xCZwS3RIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932443; 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=VKVHOfnczXhyBWhAP6cPmuP/ZmSpUD+aWjzBUKL3yS8=; b=gW4GE4SePl6ru41m6TIswIHEM/K0uYs7IWG/REHku7Fkh8SIOy4RJakLiVAaeRsGZMgeSe8+JottA4rcy7r+Yibg5AKg1IHcTRMossex/PNJzUbSWq2EKrSkCW6iX2Ubqkw7BlFcIxaip8p1dnGbqvbmrVjWfpUyf5gP6/nS0i8= 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 1601932443142471.95693240561525; Mon, 5 Oct 2020 14:14:03 -0700 (PDT) Received: from localhost ([::1]:54978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXo1-0004sD-Ro for importer@patchew.org; Mon, 05 Oct 2020 17:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkO-00089X-Ul for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkL-0007LM-AK for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:16 -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-402-NL9VSY6vN5uKq8jytm-I5A-1; Mon, 05 Oct 2020 17:10:10 -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 44D3E107ACF9; Mon, 5 Oct 2020 21:10:08 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D06E5D9CD; Mon, 5 Oct 2020 21:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932212; 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=VKVHOfnczXhyBWhAP6cPmuP/ZmSpUD+aWjzBUKL3yS8=; b=Ul2XZwSlt7jRXLaLkcmmpdklUrtoFSx7y+jqzB0XkQoPtD1Xt1zKNfo52Rb7SKgmQdO05X g0RRjhTKDX33binorFAhslaE0tpZW2wOtPcMvfQzgyegUIehQeynMoDvTPNqtKm6UqMoUl b2q8nSBEh57a+u6PE3QWVG0B5tcRNFI= X-MC-Unique: NL9VSY6vN5uKq8jytm-I5A-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 03/21] hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr() Date: Mon, 5 Oct 2020 17:09:42 -0400 Message-Id: <20201005211000.710404-4-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 Replace strtoul() by qemu_strtoul() so checkpatch.pl won't complain if we move this code later. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-4-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 080ba319a1f..a1190a5db9e 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -951,7 +951,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *= v, const char *name, Property *prop =3D opaque; PCIHostDeviceAddress *addr =3D qdev_get_prop_ptr(dev, prop); char *str, *p; - char *e; + const char *e; unsigned long val; unsigned long dom =3D 0, bus =3D 0; unsigned int slot =3D 0, func =3D 0; @@ -966,23 +966,23 @@ static void set_pci_host_devaddr(Object *obj, Visitor= *v, const char *name, } =20 p =3D str; - val =3D strtoul(p, &e, 16); - if (e =3D=3D p || *e !=3D ':') { + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0xffff || e =3D=3D p) { + goto inval; + } + if (*e !=3D ':') { goto inval; } bus =3D val; =20 - p =3D e + 1; - val =3D strtoul(p, &e, 16); - if (e =3D=3D p) { + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p) { goto inval; } if (*e =3D=3D ':') { dom =3D bus; bus =3D val; - p =3D e + 1; - val =3D strtoul(p, &e, 16); - if (e =3D=3D p) { + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p)= { goto inval; } } @@ -991,14 +991,13 @@ static void set_pci_host_devaddr(Object *obj, Visitor= *v, const char *name, if (*e !=3D '.') { goto inval; } - p =3D e + 1; - val =3D strtoul(p, &e, 10); - if (e =3D=3D p) { + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 10, &val) < 0 || val > 7 || e =3D=3D p) { goto inval; } func =3D val; =20 - if (dom > 0xffff || bus > 0xff || slot > 0x1f || func > 7) { + if (bus > 0xff) { goto inval; } =20 --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932442; cv=none; d=zohomail.com; s=zohoarc; b=nE05/hs6Yxsee0zlCqRqU6Vfmrsb2BOgBH6QNH+qr/lXpXVeE3hlAfPidNpQHxa/zDt4BrakWBe0BD4Jh8WA0Aau4gojFKEK9LRYXFWrl/nXF0AM1KBau0DIRr/UrsbcyAntuc/WbNY9PUxMmjHuXGbTrsi4gAhqfhVIPHbsx58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932442; 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=387ny3+sRKBHYTy13TXt40bJDATXI6sqbRKvGbTh/FE=; b=OuRqAQJY70B6WA0oYF7OJHepdPLotboLFNe+DMO3JjQkVQuweEELIEtX/K74m+F6bVVc80wDC6CzeFrmavgRRXQ18araZztVTMDAv4Arp6AOGOOvLe5LX5NGL8lLiCI9KHaeGZluIWs5myOv3UPyqYLiqj20loSAfMvq8bV9ohs= 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 1601932442970857.304277251642; Mon, 5 Oct 2020 14:14:02 -0700 (PDT) Received: from localhost ([::1]:54930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXo1-0004r8-NX for importer@patchew.org; Mon, 05 Oct 2020 17:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkQ-0008A5-A8 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkO-0007NS-I2 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:18 -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-246-ddJml-cNMFW0wQ_puOAW3w-1; Mon, 05 Oct 2020 17:10:11 -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 88C051015C9D; Mon, 5 Oct 2020 21:10:10 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1788F61177; Mon, 5 Oct 2020 21:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932215; 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=387ny3+sRKBHYTy13TXt40bJDATXI6sqbRKvGbTh/FE=; b=Ys7qpfnBlfXR5AZlNtgPBek8jFdSTD4vNnw7zw5eSwUWoqxsokjbnpe2lurNifQPU/2jzX xKeRgvT0uW+anh1VR31P2HGdztOF/7XbxisTagFYzU0ALplN+MkdBDf9xWwN9yeeXopmad gDdatW4tYr+yBbAxHlXxgq/nzuMs6H4= X-MC-Unique: ddJml-cNMFW0wQ_puOAW3w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 04/21] hw/core/qdev-properties: Fix code style Date: Mon, 5 Oct 2020 17:09:43 -0400 Message-Id: <20201005211000.710404-5-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 We will soon move this code, fix its style to avoid checkpatch.pl to complain. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-5-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index a1190a5db9e..071fd5864ae 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -543,15 +543,15 @@ static void set_mac(Object *obj, Visitor *v, const ch= ar *name, void *opaque, if (!qemu_isxdigit(str[pos])) { goto inval; } - if (!qemu_isxdigit(str[pos+1])) { + if (!qemu_isxdigit(str[pos + 1])) { goto inval; } if (i =3D=3D 5) { - if (str[pos+2] !=3D '\0') { + if (str[pos + 2] !=3D '\0') { goto inval; } } else { - if (str[pos+2] !=3D ':' && str[pos+2] !=3D '-') { + if (str[pos + 2] !=3D ':' && str[pos + 2] !=3D '-') { goto inval; } } @@ -898,8 +898,8 @@ static void set_blocksize(Object *obj, Visitor *v, cons= t char *name, /* We rely on power-of-2 blocksizes for bitmasks */ if ((value & (value - 1)) !=3D 0) { error_setg(errp, - "Property %s.%s doesn't take value '%" PRId64 "', it's n= ot a power of 2", - dev->id ?: "", name, (int64_t)value); + "Property %s.%s doesn't take value '%" PRId64 "', " + "it's not a power of 2", dev->id ?: "", name, (int64_t)v= alue); return; } =20 --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932445; cv=none; d=zohomail.com; s=zohoarc; b=nEe+UCB2V11u/J5SnywMMNeKAd/plAvEGE/k16Vxi6PsS8tIYRSKSkNGSm880Htk9n9jUG6Yp7aWDkelkgmiRpQmkm6f9FX+3fIfp52b4eTbz1lpg0hITpZo5mUFPiD4FsheY/MNIwG2TlYwGnAu9w+9zugWlVwnHxbFNzDpJiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932445; 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=XEoq9EbX6/fzzvW2lNcxW2NPkT5KG2SSUNmANtD/K24=; b=kLObsCIPU6AuUYwElOmLKbaKyPUgaHf/AIv8QGFR7LCNm7oMUL4azKke4AEDvhDOX+rjWlum5Hn8cPGV/0udlAmqw103wHiiGGG/yl6bcgJk1jC8d06sjfJIvnCUWwS78nOybgACRG+Myzto+H/Waab243VkYyjQUyGhqxjhbyQ= 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 1601932445052800.3843326684416; Mon, 5 Oct 2020 14:14:05 -0700 (PDT) Received: from localhost ([::1]:55098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXo3-0004v4-OD for importer@patchew.org; Mon, 05 Oct 2020 17:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkQ-0008AC-Lt for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkO-0007N9-Hb for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:18 -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-409-lszAYZKkM9SAbNvZZ7bJVQ-1; Mon, 05 Oct 2020 17:10:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9227E1DDED; Mon, 5 Oct 2020 21:10:11 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56C8173674; Mon, 5 Oct 2020 21:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932215; 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=XEoq9EbX6/fzzvW2lNcxW2NPkT5KG2SSUNmANtD/K24=; b=T3UufQF5eVZCyoNW8fg37cYF2dQEx3WoNmqDvYget0j/Gg9HAT6++xttw/sf2/lv1mfXro fhRxlmxt9PERaUghPDA8n5DmVv55G1M3K6hU21nOHrzxbLOjnOeQV/LUumkBtFvCrMJKtk 37RIdf6sArfN8mF5t7Gg6CRuvGYIX3M= X-MC-Unique: lszAYZKkM9SAbNvZZ7bJVQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 05/21] hw/core/qdev-properties: Export enum-related functions Date: Mon, 5 Oct 2020 17:09:44 -0400 Message-Id: <20201005211000.710404-6-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 We are going to split this file and reuse these static functions. Add the local "qdev-prop-internal.h" header declaring them. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-6-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-prop-internal.h | 19 ++++++++++++ hw/core/qdev-properties.c | 58 +++++++++++++++++++----------------- 2 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 hw/core/qdev-prop-internal.h diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h new file mode 100644 index 00000000000..2a8c9a306a5 --- /dev/null +++ b/hw/core/qdev-prop-internal.h @@ -0,0 +1,19 @@ +/* + * qdev property parsing + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef HW_CORE_QDEV_PROP_INTERNAL_H +#define HW_CORE_QDEV_PROP_INTERNAL_H + +void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); + +void qdev_propinfo_set_default_value_enum(ObjectProperty *op, + const Property *prop); + +#endif diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 071fd5864ae..76417d09365 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -18,6 +18,7 @@ #include "qemu/uuid.h" #include "qemu/units.h" #include "qemu/cutils.h" +#include "qdev-prop-internal.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -53,8 +54,8 @@ void *qdev_get_prop_ptr(DeviceState *dev, Property *prop) return ptr; } =20 -static void get_enum(Object *obj, Visitor *v, const char *name, void *opaq= ue, - Error **errp) +void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; @@ -63,8 +64,8 @@ static void get_enum(Object *obj, Visitor *v, const char = *name, void *opaque, visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); } =20 -static void set_enum(Object *obj, Visitor *v, const char *name, void *opaq= ue, - Error **errp) +void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; @@ -78,7 +79,8 @@ static void set_enum(Object *obj, Visitor *v, const char = *name, void *opaque, visit_type_enum(v, prop->name, ptr, prop->info->enum_table, errp); } =20 -static void set_default_value_enum(ObjectProperty *op, const Property *pro= p) +void qdev_propinfo_set_default_value_enum(ObjectProperty *op, + const Property *prop) { object_property_set_default_str(op, qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); @@ -669,9 +671,9 @@ const PropertyInfo qdev_prop_on_off_auto =3D { .name =3D "OnOffAuto", .description =3D "on/off/auto", .enum_table =3D &OnOffAuto_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- lost tick policy --- */ @@ -681,9 +683,9 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(in= t)); const PropertyInfo qdev_prop_losttickpolicy =3D { .name =3D "LostTickPolicy", .enum_table =3D &LostTickPolicy_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- Block device error handling policy --- */ @@ -695,9 +697,9 @@ const PropertyInfo qdev_prop_blockdev_on_error =3D { .description =3D "Error handling policy, " "report/ignore/enospc/stop/auto", .enum_table =3D &BlockdevOnError_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- BIOS CHS translation */ @@ -709,9 +711,9 @@ const PropertyInfo qdev_prop_bios_chs_trans =3D { .description =3D "Logical CHS translation algorithm, " "auto/none/lba/large/rechs", .enum_table =3D &BiosAtaTranslation_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- FDC default drive types */ @@ -721,9 +723,9 @@ const PropertyInfo qdev_prop_fdc_drive_type =3D { .description =3D "FDC drive type, " "144/288/120/none/auto", .enum_table =3D &FloppyDriveType_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- MultiFDCompression --- */ @@ -733,9 +735,9 @@ const PropertyInfo qdev_prop_multifd_compression =3D { .description =3D "multifd_compression values, " "none/zlib/zstd", .enum_table =3D &MultiFDCompression_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- pci address --- */ @@ -1416,9 +1418,9 @@ const PropertyInfo qdev_prop_off_auto_pcibar =3D { .name =3D "OffAutoPCIBAR", .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", .enum_table =3D &OffAutoPCIBAR_lookup, - .get =3D get_enum, - .set =3D set_enum, - .set_default_value =3D set_default_value_enum, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- PCIELinkSpeed 2_5/5/8/16 -- */ @@ -1495,7 +1497,7 @@ const PropertyInfo qdev_prop_pcie_link_speed =3D { .enum_table =3D &PCIELinkSpeed_lookup, .get =3D get_prop_pcielinkspeed, .set =3D set_prop_pcielinkspeed, - .set_default_value =3D set_default_value_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 /* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */ @@ -1590,5 +1592,5 @@ const PropertyInfo qdev_prop_pcie_link_width =3D { .enum_table =3D &PCIELinkWidth_lookup, .get =3D get_prop_pcielinkwidth, .set =3D set_prop_pcielinkwidth, - .set_default_value =3D set_default_value_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, }; --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932619; cv=none; d=zohomail.com; s=zohoarc; b=DWZMJswlBUOZDQiEdnjVMjrX+Pve7PbXrtVJtLoyXkwYz7ps/TwL3yrM5LVC9uHub0Ut7qzGAkAkW42b38SBOxU4rkaa3SFuKn4DdXQvzS4m5pN39CfxxD2Otf+LOzLGZNsyxxG+7guWKmKQ6KqqRN4L/mqy/kZTKFBIYAWf7uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932619; 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=/pSRTyw/I2c45NOIrr18mZNAWjiTUlL2Mrsv2hSjPbw=; b=IMdlrwqfup85diwm3AHJ3CNOGvpG1uJPPs7HWJFqkmlgBfLH1bxzBvbrOXCplRUlGjZAhm6UscIOuTWJYsfg5AceHoZ8suyBqFhdp7kLGpDXQsE64Up0PxYOSxENIfAODQ6d9G0lLS3D8gKM44U60DxgmylRGBE0Y0puVplFa2I= 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 1601932619714817.5811003057773; Mon, 5 Oct 2020 14:16:59 -0700 (PDT) Received: from localhost ([::1]:35180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXqs-0008RZ-Bu for importer@patchew.org; Mon, 05 Oct 2020 17:16:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkS-0008Al-55 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkQ-0007O6-2B for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:19 -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-82-sUNiBgfVMTCJef8HuQ_xyg-1; Mon, 05 Oct 2020 17:10:15 -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 23AB787308D; Mon, 5 Oct 2020 21:10:13 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABC6655770; Mon, 5 Oct 2020 21:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932217; 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=/pSRTyw/I2c45NOIrr18mZNAWjiTUlL2Mrsv2hSjPbw=; b=Y4JmzGGDf1PBGlzI9oIs5klS9lCq92c7Svr6RGgLBJ/LlKgldC7Aj6qFXHEm5HRFrnWh7l bbNSTq1uWm+ROOZsrx+dp+m/jqR83p7GG3O/VpW9udAh/ztZwDF/pDm89h3krkOKIyOkY6 2b1mGrcNfdJ46fX5cnFkbNSWp90tAVc= X-MC-Unique: sUNiBgfVMTCJef8HuQ_xyg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 06/21] hw/core/qdev-properties: Export qdev_prop_enum Date: Mon, 5 Oct 2020 17:09:45 -0400 Message-Id: <20201005211000.710404-7-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-7-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 528310bb22f..44374500659 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -8,6 +8,7 @@ extern const PropertyInfo qdev_prop_bit; extern const PropertyInfo qdev_prop_bit64; extern const PropertyInfo qdev_prop_bool; +extern const PropertyInfo qdev_prop_enum; extern const PropertyInfo qdev_prop_uint8; extern const PropertyInfo qdev_prop_uint16; extern const PropertyInfo qdev_prop_uint32; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 76417d09365..31dfe441e2e 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -86,6 +86,13 @@ void qdev_propinfo_set_default_value_enum(ObjectProperty= *op, qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); } =20 +const PropertyInfo qdev_prop_enum =3D { + .name =3D "enum", + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + /* Bit */ =20 static uint32_t qdev_get_prop_mask(Property *prop) --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932825; cv=none; d=zohomail.com; s=zohoarc; b=K9/kuzEZrG6FiFo8Guhwp3eys+d572lj9pVn50k/jdaW7Ftm46FpDZFQcriM4olIuocreGzgzFjVXoNduYnyzge60xcDpRQ65rpaR06tjpg3rz4qtw1hdDsMRmcMhnIokHC2D9wkB5qlQ3flTa3oQ2/KeByIXWM9MCX0GWr5exc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932825; 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=vSZU8LutC2AZ+Vt0lQlqAk6xxkGLLoRLLfQshp5cRs4=; b=FMVqFbM8zhoy+Ta5KjBO0KKxPUBMs1KMRlOXT/U3z02V7kHEMvL52eTxpjvNAE3ugvm3alcrrtHwDn/DlrgSBKnRNZKKDEVo5/kjwPMwT7Dq0X/cpgm81iYDY0byNYJCzGC3YprvxqEJt5f+2QnXc0Y/pUC2pKM32QXo3yS4MDg= 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 1601932825474127.1060584476295; Mon, 5 Oct 2020 14:20:25 -0700 (PDT) Received: from localhost ([::1]:43644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXuC-0003bP-56 for importer@patchew.org; Mon, 05 Oct 2020 17:20:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkW-0008Dp-FA for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkS-0007PJ-Gr for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:24 -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-245-0YRpkEqHN2mRYMPZBP57fg-1; Mon, 05 Oct 2020 17:10:15 -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 64DA918A8222; Mon, 5 Oct 2020 21:10:14 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DB445C1BD; Mon, 5 Oct 2020 21:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932219; 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=vSZU8LutC2AZ+Vt0lQlqAk6xxkGLLoRLLfQshp5cRs4=; b=LZuF9NhCrwXBJqztUZdcafTLZ5Uo/sumhbomEp8LRmPLv1cUq5e/IevHOvrm/mRzds+gx5 KSWzJRheJJ0q51kEL8vTrY2VZcfuvHhldTl0T13YHqotTCSAL1+yshKtdhYIk3mIk+2rVM lREOJrjKUXvO0FoMWA6a9FkBQgj+fJI= X-MC-Unique: 0YRpkEqHN2mRYMPZBP57fg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 07/21] hw/core/qdev-properties: Export some integer-related functions Date: Mon, 5 Oct 2020 17:09:46 -0400 Message-Id: <20201005211000.710404-8-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 We are going to split this file and reuse these static functions. Declare them in the local "qdev-prop-internal.h" header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-8-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-prop-internal.h | 11 +++++++++ hw/core/qdev-properties.c | 46 +++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h index 2a8c9a306a5..9cf5cc1d519 100644 --- a/hw/core/qdev-prop-internal.h +++ b/hw/core/qdev-prop-internal.h @@ -15,5 +15,16 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, con= st char *name, =20 void qdev_propinfo_set_default_value_enum(ObjectProperty *op, const Property *prop); +void qdev_propinfo_set_default_value_int(ObjectProperty *op, + const Property *prop); +void qdev_propinfo_set_default_value_uint(ObjectProperty *op, + const Property *prop); + +void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); +void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp); =20 #endif diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 31dfe441e2e..37e309077a1 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -271,12 +271,14 @@ static void set_uint8(Object *obj, Visitor *v, const = char *name, void *opaque, visit_type_uint8(v, name, ptr, errp); } =20 -static void set_default_value_int(ObjectProperty *op, const Property *prop) +void qdev_propinfo_set_default_value_int(ObjectProperty *op, + const Property *prop) { object_property_set_default_int(op, prop->defval.i); } =20 -static void set_default_value_uint(ObjectProperty *op, const Property *pro= p) +void qdev_propinfo_set_default_value_uint(ObjectProperty *op, + const Property *prop) { object_property_set_default_uint(op, prop->defval.u); } @@ -285,13 +287,13 @@ const PropertyInfo qdev_prop_uint8 =3D { .name =3D "uint8", .get =3D get_uint8, .set =3D set_uint8, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- 16bit integer --- */ =20 -static void get_uint16(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; @@ -317,9 +319,9 @@ static void set_uint16(Object *obj, Visitor *v, const c= har *name, =20 const PropertyInfo qdev_prop_uint16 =3D { .name =3D "uint16", - .get =3D get_uint16, + .get =3D qdev_propinfo_get_uint16, .set =3D set_uint16, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- 32bit integer --- */ @@ -349,8 +351,8 @@ static void set_uint32(Object *obj, Visitor *v, const c= har *name, visit_type_uint32(v, name, ptr, errp); } =20 -static void get_int32(Object *obj, Visitor *v, const char *name, void *opa= que, - Error **errp) +void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; @@ -378,14 +380,14 @@ const PropertyInfo qdev_prop_uint32 =3D { .name =3D "uint32", .get =3D get_uint32, .set =3D set_uint32, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int32 =3D { .name =3D "int32", - .get =3D get_int32, + .get =3D qdev_propinfo_get_int32, .set =3D set_int32, - .set_default_value =3D set_default_value_int, + .set_default_value =3D qdev_propinfo_set_default_value_int, }; =20 /* --- 64bit integer --- */ @@ -444,14 +446,14 @@ const PropertyInfo qdev_prop_uint64 =3D { .name =3D "uint64", .get =3D get_uint64, .set =3D set_uint64, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 const PropertyInfo qdev_prop_int64 =3D { .name =3D "int64", .get =3D get_int64, .set =3D set_int64, - .set_default_value =3D set_default_value_int, + .set_default_value =3D qdev_propinfo_set_default_value_int, }; =20 /* --- string --- */ @@ -820,8 +822,8 @@ const PropertyInfo qdev_prop_pci_devfn =3D { =20 /* --- 32bit unsigned int 'size' type --- */ =20 -static void get_size32(Object *obj, Visitor *v, const char *name, void *op= aque, - Error **errp) +void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; @@ -861,9 +863,9 @@ static void set_size32(Object *obj, Visitor *v, const c= har *name, void *opaque, =20 const PropertyInfo qdev_prop_size32 =3D { .name =3D "size", - .get =3D get_size32, + .get =3D qdev_propinfo_get_size32, .set =3D set_size32, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- blocksize --- */ @@ -919,9 +921,9 @@ const PropertyInfo qdev_prop_blocksize =3D { .name =3D "size", .description =3D "A power of two between " MIN_BLOCK_SIZE_STR " and " MAX_BLOCK_SIZE_STR, - .get =3D get_size32, + .get =3D qdev_propinfo_get_size32, .set =3D set_blocksize, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- pci host address --- */ @@ -1190,7 +1192,7 @@ const PropertyInfo qdev_prop_arraylen =3D { .name =3D "uint32", .get =3D get_uint32, .set =3D set_prop_arraylen, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- public helpers --- */ @@ -1401,7 +1403,7 @@ const PropertyInfo qdev_prop_size =3D { .name =3D "size", .get =3D get_size, .set =3D set_size, - .set_default_value =3D set_default_value_uint, + .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 /* --- object link property --- */ --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932463; cv=none; d=zohomail.com; s=zohoarc; b=lLWDrh5Jcv71xlnxCWWQffdTkbVYySgJkmpSjp5gznMvnYkN4ubukzt1iRLgGj+dLTAB7ePiGA6ADwcbpH9fXcKKQ+peNPTKBuDXjd4QTypDAjtPoggDQBVosDglcLvU8HdePojezmTQ48gZ4biGtu89t5WqNumhPKIMcTKy3FA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932463; 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=F+oqK1yVa0ZrmLtXyvUuiDLdrW9fJlqMB9LZdI4KCeI=; b=aStq/xVaOxGKUrnmdEfKYUU04RHeI8UMiQBEmuFgGDA/ANJPEBe+HFpXq/J7HJxHBRUaeAPP1CLH4Yef7j+tliaXQyQUNenSX202MIvDHBnBO9E9ZXRcKQDoyHEGUFL9hh/BSA4V9leRNrJOAq/ThE1Yrle0MoTAwPJWpDmjYec= 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 1601932463672139.90988504750874; Mon, 5 Oct 2020 14:14:23 -0700 (PDT) Received: from localhost ([::1]:55712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXoM-0005Cs-6O for importer@patchew.org; Mon, 05 Oct 2020 17:14:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXka-0008MC-Ed for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkU-0007Rz-Ex for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:28 -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-444-FgLnmn8RNi6Nw4psMu9SFw-1; Mon, 05 Oct 2020 17:10:17 -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 094D518A8220; Mon, 5 Oct 2020 21:10:16 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DDA75C1BD; Mon, 5 Oct 2020 21:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932221; 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=F+oqK1yVa0ZrmLtXyvUuiDLdrW9fJlqMB9LZdI4KCeI=; b=cfrXVQsw1AfUfAn6m+/fzbaluZZtbU/+YKeku4Ig9H9Lpscnlw5jaqDrMylOCEK+FGWESB dGTcy7fVihUtwa6xv4WVDgIf2zhDkQSADDqmJgmqEkKtwR7Tm6qDyupNpoGGExbl2AT4q7 p16DQF/ReqE+EhhnLfSqoDiMH0nzfuk= X-MC-Unique: FgLnmn8RNi6Nw4psMu9SFw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 08/21] hw/core/qdev-properties: Extract system-mode specific properties Date: Mon, 5 Oct 2020 17:09:47 -0400 Message-Id: <20201005211000.710404-9-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?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) From: Philippe Mathieu-Daud=C3=A9 Move properties specific to machines into a separate file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20200930164949.1425294-9-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties-system.c | 687 ++++++++++++++++++++++++++++++- hw/core/qdev-properties.c | 674 ------------------------------ 2 files changed, 679 insertions(+), 682 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index b29daf4fb51..49bdd125814 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -11,19 +11,25 @@ */ =20 #include "qemu/osdep.h" -#include "audio/audio.h" -#include "net/net.h" #include "hw/qdev-properties.h" #include "qapi/error.h" +#include "qapi/visitor.h" +#include "qapi/qapi-types-block.h" +#include "qapi/qapi-types-machine.h" +#include "qapi/qapi-types-migration.h" #include "qapi/qmp/qerror.h" +#include "qemu/ctype.h" +#include "qemu/cutils.h" +#include "qemu/units.h" +#include "qemu/error-report.h" +#include "qdev-prop-internal.h" + +#include "audio/audio.h" +#include "chardev/char-fe.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" -#include "hw/block/block.h" -#include "net/hub.h" -#include "qapi/visitor.h" -#include "chardev/char-fe.h" -#include "sysemu/iothread.h" -#include "sysemu/tpm_backend.h" +#include "net/net.h" +#include "hw/pci/pci.h" =20 static bool check_prop_still_unset(DeviceState *dev, const char *name, const void *old_val, const char *new_va= l, @@ -280,6 +286,96 @@ const PropertyInfo qdev_prop_chr =3D { .release =3D release_chr, }; =20 +/* --- mac address --- */ + +/* + * accepted syntax versions: + * 01:02:03:04:05:06 + * 01-02-03-04-05-06 + */ +static void get_mac(Object *obj, Visitor *v, const char *name, void *opaqu= e, + Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + MACAddr *mac =3D qdev_get_prop_ptr(dev, prop); + char buffer[2 * 6 + 5 + 1]; + char *p =3D buffer; + + snprintf(buffer, sizeof(buffer), "%02x:%02x:%02x:%02x:%02x:%02x", + mac->a[0], mac->a[1], mac->a[2], + mac->a[3], mac->a[4], mac->a[5]); + + visit_type_str(v, name, &p, errp); +} + +static void set_mac(Object *obj, Visitor *v, const char *name, void *opaqu= e, + Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + MACAddr *mac =3D qdev_get_prop_ptr(dev, prop); + int i, pos; + char *str; + const char *p; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_str(v, name, &str, errp)) { + return; + } + + for (i =3D 0, pos =3D 0; i < 6; i++, pos +=3D 3) { + long val; + + if (!qemu_isxdigit(str[pos])) { + goto inval; + } + if (!qemu_isxdigit(str[pos + 1])) { + goto inval; + } + if (i =3D=3D 5) { + if (str[pos + 2] !=3D '\0') { + goto inval; + } + } else { + if (str[pos + 2] !=3D ':' && str[pos + 2] !=3D '-') { + goto inval; + } + } + if (qemu_strtol(str + pos, &p, 16, &val) < 0 || val > 0xff) { + goto inval; + } + mac->a[i] =3D val; + } + g_free(str); + return; + +inval: + error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); + g_free(str); +} + +const PropertyInfo qdev_prop_macaddr =3D { + .name =3D "str", + .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", + .get =3D get_mac, + .set =3D set_mac, +}; + +void qdev_prop_set_macaddr(DeviceState *dev, const char *name, + const uint8_t *value) +{ + char str[2 * 6 + 5 + 1]; + snprintf(str, sizeof(str), "%02x:%02x:%02x:%02x:%02x:%02x", + value[0], value[1], value[2], value[3], value[4], value[5]); + + object_property_set_str(OBJECT(dev), name, str, &error_abort); +} + /* --- netdev device --- */ static void get_netdev(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -465,3 +561,578 @@ void qdev_set_nic_properties(DeviceState *dev, NICInf= o *nd) } nd->instantiated =3D 1; } + +/* --- lost tick policy --- */ + +QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(int)); + +const PropertyInfo qdev_prop_losttickpolicy =3D { + .name =3D "LostTickPolicy", + .enum_table =3D &LostTickPolicy_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- blocksize --- */ + +/* lower limit is sector size */ +#define MIN_BLOCK_SIZE 512 +#define MIN_BLOCK_SIZE_STR "512 B" +/* + * upper limit is arbitrary, 2 MiB looks sufficient for all sensible uses,= and + * matches qcow2 cluster size limit + */ +#define MAX_BLOCK_SIZE (2 * MiB) +#define MAX_BLOCK_SIZE_STR "2 MiB" + +static void set_blocksize(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + uint32_t *ptr =3D qdev_get_prop_ptr(dev, prop); + uint64_t value; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_size(v, name, &value, errp)) { + return; + } + /* value of 0 means "unset" */ + if (value && (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE)) { + error_setg(errp, + "Property %s.%s doesn't take value %" PRIu64 + " (minimum: " MIN_BLOCK_SIZE_STR + ", maximum: " MAX_BLOCK_SIZE_STR ")", + dev->id ? : "", name, value); + return; + } + + /* We rely on power-of-2 blocksizes for bitmasks */ + if ((value & (value - 1)) !=3D 0) { + error_setg(errp, + "Property %s.%s doesn't take value '%" PRId64 "', " + "it's not a power of 2", dev->id ?: "", name, (int64_t)v= alue); + return; + } + + *ptr =3D value; +} + +const PropertyInfo qdev_prop_blocksize =3D { + .name =3D "size", + .description =3D "A power of two between " MIN_BLOCK_SIZE_STR + " and " MAX_BLOCK_SIZE_STR, + .get =3D qdev_propinfo_get_size32, + .set =3D set_blocksize, + .set_default_value =3D qdev_propinfo_set_default_value_uint, +}; + +/* --- Block device error handling policy --- */ + +QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(int)); + +const PropertyInfo qdev_prop_blockdev_on_error =3D { + .name =3D "BlockdevOnError", + .description =3D "Error handling policy, " + "report/ignore/enospc/stop/auto", + .enum_table =3D &BlockdevOnError_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- BIOS CHS translation */ + +QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeof(int)); + +const PropertyInfo qdev_prop_bios_chs_trans =3D { + .name =3D "BiosAtaTranslation", + .description =3D "Logical CHS translation algorithm, " + "auto/none/lba/large/rechs", + .enum_table =3D &BiosAtaTranslation_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- FDC default drive types */ + +const PropertyInfo qdev_prop_fdc_drive_type =3D { + .name =3D "FdcDriveType", + .description =3D "FDC drive type, " + "144/288/120/none/auto", + .enum_table =3D &FloppyDriveType_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- MultiFDCompression --- */ + +const PropertyInfo qdev_prop_multifd_compression =3D { + .name =3D "MultiFDCompression", + .description =3D "multifd_compression values, " + "none/zlib/zstd", + .enum_table =3D &MultiFDCompression_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- Reserved Region --- */ + +/* + * Accepted syntax: + * :: + * where low/high addresses are uint64_t in hexadecimal + * and type is a non-negative decimal integer + */ +static void get_reserved_region(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + ReservedRegion *rr =3D qdev_get_prop_ptr(dev, prop); + char buffer[64]; + char *p =3D buffer; + int rc; + + rc =3D snprintf(buffer, sizeof(buffer), "0x%"PRIx64":0x%"PRIx64":%u", + rr->low, rr->high, rr->type); + assert(rc < sizeof(buffer)); + + visit_type_str(v, name, &p, errp); +} + +static void set_reserved_region(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + ReservedRegion *rr =3D qdev_get_prop_ptr(dev, prop); + Error *local_err =3D NULL; + const char *endptr; + char *str; + int ret; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + visit_type_str(v, name, &str, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + + ret =3D qemu_strtou64(str, &endptr, 16, &rr->low); + if (ret) { + error_setg(errp, "start address of '%s'" + " must be a hexadecimal integer", name); + goto out; + } + if (*endptr !=3D ':') { + goto separator_error; + } + + ret =3D qemu_strtou64(endptr + 1, &endptr, 16, &rr->high); + if (ret) { + error_setg(errp, "end address of '%s'" + " must be a hexadecimal integer", name); + goto out; + } + if (*endptr !=3D ':') { + goto separator_error; + } + + ret =3D qemu_strtoui(endptr + 1, &endptr, 10, &rr->type); + if (ret) { + error_setg(errp, "type of '%s'" + " must be a non-negative decimal integer", name); + } + goto out; + +separator_error: + error_setg(errp, "reserved region fields must be separated with ':'"); +out: + g_free(str); + return; +} + +const PropertyInfo qdev_prop_reserved_region =3D { + .name =3D "reserved_region", + .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", + .get =3D get_reserved_region, + .set =3D set_reserved_region, +}; + +/* --- pci address --- */ + +/* + * bus-local address, i.e. "$slot" or "$slot.$fn" + */ +static void set_pci_devfn(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + int32_t value, *ptr =3D qdev_get_prop_ptr(dev, prop); + unsigned int slot, fn, n; + char *str; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_str(v, name, &str, NULL)) { + if (!visit_type_int32(v, name, &value, errp)) { + return; + } + if (value < -1 || value > 255) { + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + name ? name : "null", "pci_devfn"); + return; + } + *ptr =3D value; + return; + } + + if (sscanf(str, "%x.%x%n", &slot, &fn, &n) !=3D 2) { + fn =3D 0; + if (sscanf(str, "%x%n", &slot, &n) !=3D 1) { + goto invalid; + } + } + if (str[n] !=3D '\0' || fn > 7 || slot > 31) { + goto invalid; + } + *ptr =3D slot << 3 | fn; + g_free(str); + return; + +invalid: + error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); + g_free(str); +} + +static int print_pci_devfn(DeviceState *dev, Property *prop, char *dest, + size_t len) +{ + int32_t *ptr =3D qdev_get_prop_ptr(dev, prop); + + if (*ptr =3D=3D -1) { + return snprintf(dest, len, ""); + } else { + return snprintf(dest, len, "%02x.%x", *ptr >> 3, *ptr & 7); + } +} + +const PropertyInfo qdev_prop_pci_devfn =3D { + .name =3D "int32", + .description =3D "Slot and optional function number, example: 06.0 or = 06", + .print =3D print_pci_devfn, + .get =3D qdev_propinfo_get_int32, + .set =3D set_pci_devfn, + .set_default_value =3D qdev_propinfo_set_default_value_int, +}; + +/* --- pci host address --- */ + +static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIHostDeviceAddress *addr =3D qdev_get_prop_ptr(dev, prop); + char buffer[] =3D "ffff:ff:ff.f"; + char *p =3D buffer; + int rc =3D 0; + + /* + * Catch "invalid" device reference from vfio-pci and allow the + * default buffer representing the non-existent device to be used. + */ + if (~addr->domain || ~addr->bus || ~addr->slot || ~addr->function) { + rc =3D snprintf(buffer, sizeof(buffer), "%04x:%02x:%02x.%0d", + addr->domain, addr->bus, addr->slot, addr->function); + assert(rc =3D=3D sizeof(buffer) - 1); + } + + visit_type_str(v, name, &p, errp); +} + +/* + * Parse [:]:. + * if is not supplied, it's assumed to be 0. + */ +static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIHostDeviceAddress *addr =3D qdev_get_prop_ptr(dev, prop); + char *str, *p; + const char *e; + unsigned long val; + unsigned long dom =3D 0, bus =3D 0; + unsigned int slot =3D 0, func =3D 0; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_str(v, name, &str, errp)) { + return; + } + + p =3D str; + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0xffff || e =3D=3D p) { + goto inval; + } + if (*e !=3D ':') { + goto inval; + } + bus =3D val; + + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p) { + goto inval; + } + if (*e =3D=3D ':') { + dom =3D bus; + bus =3D val; + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p)= { + goto inval; + } + } + slot =3D val; + + if (*e !=3D '.') { + goto inval; + } + p =3D (char *)e + 1; + if (qemu_strtoul(p, &e, 10, &val) < 0 || val > 7 || e =3D=3D p) { + goto inval; + } + func =3D val; + + if (bus > 0xff) { + goto inval; + } + + if (*e) { + goto inval; + } + + addr->domain =3D dom; + addr->bus =3D bus; + addr->slot =3D slot; + addr->function =3D func; + + g_free(str); + return; + +inval: + error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); + g_free(str); +} + +const PropertyInfo qdev_prop_pci_host_devaddr =3D { + .name =3D "str", + .description =3D "Address (bus/device/function) of " + "the host device, example: 04:10.0", + .get =3D get_pci_host_devaddr, + .set =3D set_pci_host_devaddr, +}; + +/* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */ + +const PropertyInfo qdev_prop_off_auto_pcibar =3D { + .name =3D "OffAutoPCIBAR", + .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", + .enum_table =3D &OffAutoPCIBAR_lookup, + .get =3D qdev_propinfo_get_enum, + .set =3D qdev_propinfo_set_enum, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- PCIELinkSpeed 2_5/5/8/16 -- */ + +static void get_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIExpLinkSpeed *p =3D qdev_get_prop_ptr(dev, prop); + int speed; + + switch (*p) { + case QEMU_PCI_EXP_LNK_2_5GT: + speed =3D PCIE_LINK_SPEED_2_5; + break; + case QEMU_PCI_EXP_LNK_5GT: + speed =3D PCIE_LINK_SPEED_5; + break; + case QEMU_PCI_EXP_LNK_8GT: + speed =3D PCIE_LINK_SPEED_8; + break; + case QEMU_PCI_EXP_LNK_16GT: + speed =3D PCIE_LINK_SPEED_16; + break; + default: + /* Unreachable */ + abort(); + } + + visit_type_enum(v, prop->name, &speed, prop->info->enum_table, errp); +} + +static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIExpLinkSpeed *p =3D qdev_get_prop_ptr(dev, prop); + int speed; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_enum(v, prop->name, &speed, prop->info->enum_table, + errp)) { + return; + } + + switch (speed) { + case PCIE_LINK_SPEED_2_5: + *p =3D QEMU_PCI_EXP_LNK_2_5GT; + break; + case PCIE_LINK_SPEED_5: + *p =3D QEMU_PCI_EXP_LNK_5GT; + break; + case PCIE_LINK_SPEED_8: + *p =3D QEMU_PCI_EXP_LNK_8GT; + break; + case PCIE_LINK_SPEED_16: + *p =3D QEMU_PCI_EXP_LNK_16GT; + break; + default: + /* Unreachable */ + abort(); + } +} + +const PropertyInfo qdev_prop_pcie_link_speed =3D { + .name =3D "PCIELinkSpeed", + .description =3D "2_5/5/8/16", + .enum_table =3D &PCIELinkSpeed_lookup, + .get =3D get_prop_pcielinkspeed, + .set =3D set_prop_pcielinkspeed, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; + +/* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */ + +static void get_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIExpLinkWidth *p =3D qdev_get_prop_ptr(dev, prop); + int width; + + switch (*p) { + case QEMU_PCI_EXP_LNK_X1: + width =3D PCIE_LINK_WIDTH_1; + break; + case QEMU_PCI_EXP_LNK_X2: + width =3D PCIE_LINK_WIDTH_2; + break; + case QEMU_PCI_EXP_LNK_X4: + width =3D PCIE_LINK_WIDTH_4; + break; + case QEMU_PCI_EXP_LNK_X8: + width =3D PCIE_LINK_WIDTH_8; + break; + case QEMU_PCI_EXP_LNK_X12: + width =3D PCIE_LINK_WIDTH_12; + break; + case QEMU_PCI_EXP_LNK_X16: + width =3D PCIE_LINK_WIDTH_16; + break; + case QEMU_PCI_EXP_LNK_X32: + width =3D PCIE_LINK_WIDTH_32; + break; + default: + /* Unreachable */ + abort(); + } + + visit_type_enum(v, prop->name, &width, prop->info->enum_table, errp); +} + +static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + DeviceState *dev =3D DEVICE(obj); + Property *prop =3D opaque; + PCIExpLinkWidth *p =3D qdev_get_prop_ptr(dev, prop); + int width; + + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + + if (!visit_type_enum(v, prop->name, &width, prop->info->enum_table, + errp)) { + return; + } + + switch (width) { + case PCIE_LINK_WIDTH_1: + *p =3D QEMU_PCI_EXP_LNK_X1; + break; + case PCIE_LINK_WIDTH_2: + *p =3D QEMU_PCI_EXP_LNK_X2; + break; + case PCIE_LINK_WIDTH_4: + *p =3D QEMU_PCI_EXP_LNK_X4; + break; + case PCIE_LINK_WIDTH_8: + *p =3D QEMU_PCI_EXP_LNK_X8; + break; + case PCIE_LINK_WIDTH_12: + *p =3D QEMU_PCI_EXP_LNK_X12; + break; + case PCIE_LINK_WIDTH_16: + *p =3D QEMU_PCI_EXP_LNK_X16; + break; + case PCIE_LINK_WIDTH_32: + *p =3D QEMU_PCI_EXP_LNK_X32; + break; + default: + /* Unreachable */ + abort(); + } +} + +const PropertyInfo qdev_prop_pcie_link_width =3D { + .name =3D "PCIELinkWidth", + .description =3D "1/2/4/8/12/16/32", + .enum_table =3D &PCIELinkWidth_lookup, + .get =3D get_prop_pcielinkwidth, + .set =3D set_prop_pcielinkwidth, + .set_default_value =3D qdev_propinfo_set_default_value_enum, +}; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 37e309077a1..509cbf155d2 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1,20 +1,11 @@ #include "qemu/osdep.h" -#include "qemu/cutils.h" -#include "net/net.h" #include "hw/qdev-properties.h" #include "qapi/error.h" -#include "hw/pci/pci.h" -#include "qapi/qapi-types-block.h" -#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qapi/qmp/qerror.h" #include "qemu/ctype.h" #include "qemu/error-report.h" -#include "qapi/qapi-types-migration.h" -#include "hw/block/block.h" -#include "net/hub.h" #include "qapi/visitor.h" -#include "chardev/char.h" #include "qemu/uuid.h" #include "qemu/units.h" #include "qemu/cutils.h" @@ -506,174 +497,6 @@ const PropertyInfo qdev_prop_string =3D { .set =3D set_string, }; =20 -/* --- mac address --- */ - -/* - * accepted syntax versions: - * 01:02:03:04:05:06 - * 01-02-03-04-05-06 - */ -static void get_mac(Object *obj, Visitor *v, const char *name, void *opaqu= e, - Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - MACAddr *mac =3D qdev_get_prop_ptr(dev, prop); - char buffer[2 * 6 + 5 + 1]; - char *p =3D buffer; - - snprintf(buffer, sizeof(buffer), "%02x:%02x:%02x:%02x:%02x:%02x", - mac->a[0], mac->a[1], mac->a[2], - mac->a[3], mac->a[4], mac->a[5]); - - visit_type_str(v, name, &p, errp); -} - -static void set_mac(Object *obj, Visitor *v, const char *name, void *opaqu= e, - Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - MACAddr *mac =3D qdev_get_prop_ptr(dev, prop); - int i, pos; - char *str; - const char *p; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_str(v, name, &str, errp)) { - return; - } - - for (i =3D 0, pos =3D 0; i < 6; i++, pos +=3D 3) { - long val; - - if (!qemu_isxdigit(str[pos])) { - goto inval; - } - if (!qemu_isxdigit(str[pos + 1])) { - goto inval; - } - if (i =3D=3D 5) { - if (str[pos + 2] !=3D '\0') { - goto inval; - } - } else { - if (str[pos + 2] !=3D ':' && str[pos + 2] !=3D '-') { - goto inval; - } - } - if (qemu_strtol(str + pos, &p, 16, &val) < 0 || val > 0xff) { - goto inval; - } - mac->a[i] =3D val; - } - g_free(str); - return; - -inval: - error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); - g_free(str); -} - -const PropertyInfo qdev_prop_macaddr =3D { - .name =3D "str", - .description =3D "Ethernet 6-byte MAC Address, example: 52:54:00:12:34= :56", - .get =3D get_mac, - .set =3D set_mac, -}; - -/* --- Reserved Region --- */ - -/* - * Accepted syntax: - * :: - * where low/high addresses are uint64_t in hexadecimal - * and type is a non-negative decimal integer - */ -static void get_reserved_region(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - ReservedRegion *rr =3D qdev_get_prop_ptr(dev, prop); - char buffer[64]; - char *p =3D buffer; - int rc; - - rc =3D snprintf(buffer, sizeof(buffer), "0x%"PRIx64":0x%"PRIx64":%u", - rr->low, rr->high, rr->type); - assert(rc < sizeof(buffer)); - - visit_type_str(v, name, &p, errp); -} - -static void set_reserved_region(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - ReservedRegion *rr =3D qdev_get_prop_ptr(dev, prop); - Error *local_err =3D NULL; - const char *endptr; - char *str; - int ret; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - visit_type_str(v, name, &str, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } - - ret =3D qemu_strtou64(str, &endptr, 16, &rr->low); - if (ret) { - error_setg(errp, "start address of '%s'" - " must be a hexadecimal integer", name); - goto out; - } - if (*endptr !=3D ':') { - goto separator_error; - } - - ret =3D qemu_strtou64(endptr + 1, &endptr, 16, &rr->high); - if (ret) { - error_setg(errp, "end address of '%s'" - " must be a hexadecimal integer", name); - goto out; - } - if (*endptr !=3D ':') { - goto separator_error; - } - - ret =3D qemu_strtoui(endptr + 1, &endptr, 10, &rr->type); - if (ret) { - error_setg(errp, "type of '%s'" - " must be a non-negative decimal integer", name); - } - goto out; - -separator_error: - error_setg(errp, "reserved region fields must be separated with ':'"); -out: - g_free(str); - return; -} - -const PropertyInfo qdev_prop_reserved_region =3D { - .name =3D "reserved_region", - .description =3D "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0", - .get =3D get_reserved_region, - .set =3D set_reserved_region, -}; - /* --- on/off/auto --- */ =20 const PropertyInfo qdev_prop_on_off_auto =3D { @@ -685,141 +508,6 @@ const PropertyInfo qdev_prop_on_off_auto =3D { .set_default_value =3D qdev_propinfo_set_default_value_enum, }; =20 -/* --- lost tick policy --- */ - -QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) !=3D sizeof(int)); - -const PropertyInfo qdev_prop_losttickpolicy =3D { - .name =3D "LostTickPolicy", - .enum_table =3D &LostTickPolicy_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- Block device error handling policy --- */ - -QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) !=3D sizeof(int)); - -const PropertyInfo qdev_prop_blockdev_on_error =3D { - .name =3D "BlockdevOnError", - .description =3D "Error handling policy, " - "report/ignore/enospc/stop/auto", - .enum_table =3D &BlockdevOnError_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- BIOS CHS translation */ - -QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=3D sizeof(int)); - -const PropertyInfo qdev_prop_bios_chs_trans =3D { - .name =3D "BiosAtaTranslation", - .description =3D "Logical CHS translation algorithm, " - "auto/none/lba/large/rechs", - .enum_table =3D &BiosAtaTranslation_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- FDC default drive types */ - -const PropertyInfo qdev_prop_fdc_drive_type =3D { - .name =3D "FdcDriveType", - .description =3D "FDC drive type, " - "144/288/120/none/auto", - .enum_table =3D &FloppyDriveType_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- MultiFDCompression --- */ - -const PropertyInfo qdev_prop_multifd_compression =3D { - .name =3D "MultiFDCompression", - .description =3D "multifd_compression values, " - "none/zlib/zstd", - .enum_table =3D &MultiFDCompression_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- pci address --- */ - -/* - * bus-local address, i.e. "$slot" or "$slot.$fn" - */ -static void set_pci_devfn(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - int32_t value, *ptr =3D qdev_get_prop_ptr(dev, prop); - unsigned int slot, fn, n; - char *str; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_str(v, name, &str, NULL)) { - if (!visit_type_int32(v, name, &value, errp)) { - return; - } - if (value < -1 || value > 255) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - name ? name : "null", "pci_devfn"); - return; - } - *ptr =3D value; - return; - } - - if (sscanf(str, "%x.%x%n", &slot, &fn, &n) !=3D 2) { - fn =3D 0; - if (sscanf(str, "%x%n", &slot, &n) !=3D 1) { - goto invalid; - } - } - if (str[n] !=3D '\0' || fn > 7 || slot > 31) { - goto invalid; - } - *ptr =3D slot << 3 | fn; - g_free(str); - return; - -invalid: - error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); - g_free(str); -} - -static int print_pci_devfn(DeviceState *dev, Property *prop, char *dest, - size_t len) -{ - int32_t *ptr =3D qdev_get_prop_ptr(dev, prop); - - if (*ptr =3D=3D -1) { - return snprintf(dest, len, ""); - } else { - return snprintf(dest, len, "%02x.%x", *ptr >> 3, *ptr & 7); - } -} - -const PropertyInfo qdev_prop_pci_devfn =3D { - .name =3D "int32", - .description =3D "Slot and optional function number, example: 06.0 or = 06", - .print =3D print_pci_devfn, - .get =3D get_int32, - .set =3D set_pci_devfn, - .set_default_value =3D set_default_value_int, -}; - /* --- 32bit unsigned int 'size' type --- */ =20 void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name, @@ -868,175 +556,6 @@ const PropertyInfo qdev_prop_size32 =3D { .set_default_value =3D qdev_propinfo_set_default_value_uint, }; =20 -/* --- blocksize --- */ - -/* lower limit is sector size */ -#define MIN_BLOCK_SIZE 512 -#define MIN_BLOCK_SIZE_STR "512 B" -/* - * upper limit is arbitrary, 2 MiB looks sufficient for all sensible uses,= and - * matches qcow2 cluster size limit - */ -#define MAX_BLOCK_SIZE (2 * MiB) -#define MAX_BLOCK_SIZE_STR "2 MiB" - -static void set_blocksize(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - uint32_t *ptr =3D qdev_get_prop_ptr(dev, prop); - uint64_t value; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_size(v, name, &value, errp)) { - return; - } - /* value of 0 means "unset" */ - if (value && (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE)) { - error_setg(errp, - "Property %s.%s doesn't take value %" PRIu64 - " (minimum: " MIN_BLOCK_SIZE_STR - ", maximum: " MAX_BLOCK_SIZE_STR ")", - dev->id ? : "", name, value); - return; - } - - /* We rely on power-of-2 blocksizes for bitmasks */ - if ((value & (value - 1)) !=3D 0) { - error_setg(errp, - "Property %s.%s doesn't take value '%" PRId64 "', " - "it's not a power of 2", dev->id ?: "", name, (int64_t)v= alue); - return; - } - - *ptr =3D value; -} - -const PropertyInfo qdev_prop_blocksize =3D { - .name =3D "size", - .description =3D "A power of two between " MIN_BLOCK_SIZE_STR - " and " MAX_BLOCK_SIZE_STR, - .get =3D qdev_propinfo_get_size32, - .set =3D set_blocksize, - .set_default_value =3D qdev_propinfo_set_default_value_uint, -}; - -/* --- pci host address --- */ - -static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIHostDeviceAddress *addr =3D qdev_get_prop_ptr(dev, prop); - char buffer[] =3D "ffff:ff:ff.f"; - char *p =3D buffer; - int rc =3D 0; - - /* - * Catch "invalid" device reference from vfio-pci and allow the - * default buffer representing the non-existent device to be used. - */ - if (~addr->domain || ~addr->bus || ~addr->slot || ~addr->function) { - rc =3D snprintf(buffer, sizeof(buffer), "%04x:%02x:%02x.%0d", - addr->domain, addr->bus, addr->slot, addr->function); - assert(rc =3D=3D sizeof(buffer) - 1); - } - - visit_type_str(v, name, &p, errp); -} - -/* - * Parse [:]:. - * if is not supplied, it's assumed to be 0. - */ -static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIHostDeviceAddress *addr =3D qdev_get_prop_ptr(dev, prop); - char *str, *p; - const char *e; - unsigned long val; - unsigned long dom =3D 0, bus =3D 0; - unsigned int slot =3D 0, func =3D 0; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_str(v, name, &str, errp)) { - return; - } - - p =3D str; - if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0xffff || e =3D=3D p) { - goto inval; - } - if (*e !=3D ':') { - goto inval; - } - bus =3D val; - - p =3D (char *)e + 1; - if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p) { - goto inval; - } - if (*e =3D=3D ':') { - dom =3D bus; - bus =3D val; - p =3D (char *)e + 1; - if (qemu_strtoul(p, &e, 16, &val) < 0 || val > 0x1f || e =3D=3D p)= { - goto inval; - } - } - slot =3D val; - - if (*e !=3D '.') { - goto inval; - } - p =3D (char *)e + 1; - if (qemu_strtoul(p, &e, 10, &val) < 0 || val > 7 || e =3D=3D p) { - goto inval; - } - func =3D val; - - if (bus > 0xff) { - goto inval; - } - - if (*e) { - goto inval; - } - - addr->domain =3D dom; - addr->bus =3D bus; - addr->slot =3D slot; - addr->function =3D func; - - g_free(str); - return; - -inval: - error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str); - g_free(str); -} - -const PropertyInfo qdev_prop_pci_host_devaddr =3D { - .name =3D "str", - .description =3D "Address (bus/device/function) of " - "the host device, example: 04:10.0", - .get =3D get_pci_host_devaddr, - .set =3D set_pci_host_devaddr, -}; - /* --- UUID --- */ =20 static void get_uuid(Object *obj, Visitor *v, const char *name, void *opaq= ue, @@ -1286,16 +805,6 @@ void qdev_prop_set_string(DeviceState *dev, const cha= r *name, const char *value) object_property_set_str(OBJECT(dev), name, value, &error_abort); } =20 -void qdev_prop_set_macaddr(DeviceState *dev, const char *name, - const uint8_t *value) -{ - char str[2 * 6 + 5 + 1]; - snprintf(str, sizeof(str), "%02x:%02x:%02x:%02x:%02x:%02x", - value[0], value[1], value[2], value[3], value[4], value[5]); - - object_property_set_str(OBJECT(dev), name, str, &error_abort); -} - void qdev_prop_set_enum(DeviceState *dev, const char *name, int value) { Property *prop; @@ -1420,186 +929,3 @@ const PropertyInfo qdev_prop_link =3D { .name =3D "link", .create =3D create_link_property, }; - -/* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */ - -const PropertyInfo qdev_prop_off_auto_pcibar =3D { - .name =3D "OffAutoPCIBAR", - .description =3D "off/auto/bar0/bar1/bar2/bar3/bar4/bar5", - .enum_table =3D &OffAutoPCIBAR_lookup, - .get =3D qdev_propinfo_get_enum, - .set =3D qdev_propinfo_set_enum, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- PCIELinkSpeed 2_5/5/8/16 -- */ - -static void get_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIExpLinkSpeed *p =3D qdev_get_prop_ptr(dev, prop); - int speed; - - switch (*p) { - case QEMU_PCI_EXP_LNK_2_5GT: - speed =3D PCIE_LINK_SPEED_2_5; - break; - case QEMU_PCI_EXP_LNK_5GT: - speed =3D PCIE_LINK_SPEED_5; - break; - case QEMU_PCI_EXP_LNK_8GT: - speed =3D PCIE_LINK_SPEED_8; - break; - case QEMU_PCI_EXP_LNK_16GT: - speed =3D PCIE_LINK_SPEED_16; - break; - default: - /* Unreachable */ - abort(); - } - - visit_type_enum(v, prop->name, &speed, prop->info->enum_table, errp); -} - -static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *na= me, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIExpLinkSpeed *p =3D qdev_get_prop_ptr(dev, prop); - int speed; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_enum(v, prop->name, &speed, prop->info->enum_table, - errp)) { - return; - } - - switch (speed) { - case PCIE_LINK_SPEED_2_5: - *p =3D QEMU_PCI_EXP_LNK_2_5GT; - break; - case PCIE_LINK_SPEED_5: - *p =3D QEMU_PCI_EXP_LNK_5GT; - break; - case PCIE_LINK_SPEED_8: - *p =3D QEMU_PCI_EXP_LNK_8GT; - break; - case PCIE_LINK_SPEED_16: - *p =3D QEMU_PCI_EXP_LNK_16GT; - break; - default: - /* Unreachable */ - abort(); - } -} - -const PropertyInfo qdev_prop_pcie_link_speed =3D { - .name =3D "PCIELinkSpeed", - .description =3D "2_5/5/8/16", - .enum_table =3D &PCIELinkSpeed_lookup, - .get =3D get_prop_pcielinkspeed, - .set =3D set_prop_pcielinkspeed, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; - -/* --- PCIELinkWidth 1/2/4/8/12/16/32 -- */ - -static void get_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIExpLinkWidth *p =3D qdev_get_prop_ptr(dev, prop); - int width; - - switch (*p) { - case QEMU_PCI_EXP_LNK_X1: - width =3D PCIE_LINK_WIDTH_1; - break; - case QEMU_PCI_EXP_LNK_X2: - width =3D PCIE_LINK_WIDTH_2; - break; - case QEMU_PCI_EXP_LNK_X4: - width =3D PCIE_LINK_WIDTH_4; - break; - case QEMU_PCI_EXP_LNK_X8: - width =3D PCIE_LINK_WIDTH_8; - break; - case QEMU_PCI_EXP_LNK_X12: - width =3D PCIE_LINK_WIDTH_12; - break; - case QEMU_PCI_EXP_LNK_X16: - width =3D PCIE_LINK_WIDTH_16; - break; - case QEMU_PCI_EXP_LNK_X32: - width =3D PCIE_LINK_WIDTH_32; - break; - default: - /* Unreachable */ - abort(); - } - - visit_type_enum(v, prop->name, &width, prop->info->enum_table, errp); -} - -static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *na= me, - void *opaque, Error **errp) -{ - DeviceState *dev =3D DEVICE(obj); - Property *prop =3D opaque; - PCIExpLinkWidth *p =3D qdev_get_prop_ptr(dev, prop); - int width; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - if (!visit_type_enum(v, prop->name, &width, prop->info->enum_table, - errp)) { - return; - } - - switch (width) { - case PCIE_LINK_WIDTH_1: - *p =3D QEMU_PCI_EXP_LNK_X1; - break; - case PCIE_LINK_WIDTH_2: - *p =3D QEMU_PCI_EXP_LNK_X2; - break; - case PCIE_LINK_WIDTH_4: - *p =3D QEMU_PCI_EXP_LNK_X4; - break; - case PCIE_LINK_WIDTH_8: - *p =3D QEMU_PCI_EXP_LNK_X8; - break; - case PCIE_LINK_WIDTH_12: - *p =3D QEMU_PCI_EXP_LNK_X12; - break; - case PCIE_LINK_WIDTH_16: - *p =3D QEMU_PCI_EXP_LNK_X16; - break; - case PCIE_LINK_WIDTH_32: - *p =3D QEMU_PCI_EXP_LNK_X32; - break; - default: - /* Unreachable */ - abort(); - } -} - -const PropertyInfo qdev_prop_pcie_link_width =3D { - .name =3D "PCIELinkWidth", - .description =3D "1/2/4/8/12/16/32", - .enum_table =3D &PCIELinkWidth_lookup, - .get =3D get_prop_pcielinkwidth, - .set =3D set_prop_pcielinkwidth, - .set_default_value =3D qdev_propinfo_set_default_value_enum, -}; --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932318; cv=none; d=zohomail.com; s=zohoarc; b=i9FYC/3jMRDa70TB9iGbSVxN0RZQd2GSX0ymHWHye76f4KWEDm7HylZ5XmFIGlDJZ/EajxiBh+X6Iq0t9wSK2TorAFejp19aPI4GuxCUlZcGeqBGyIm8V1d2HqD1+ytsRs40Lo+JQ5CS7eLsquKMnE4iQfncXIziFTKMQUoSRtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932318; 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=GTor5GPI9oq27QRafwNM8TB2ZTmF47ZN+uwA9IOBGMg=; b=gg+6921Tmn7SHCosxKcdgeAJXFkM90scqV1roenS7jFvodeF24itw/46OZ3k4UkXYn/2rXsltOA6m0Hm6s+9IiMq1oqUClP1buLG/LmiGBz6GS6K1CEXlGWqVSFbpOwRcB/LydjCFzfd6agml5pbXzA6hN3+/jt5TDfTnNK/15M= 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 1601932318423760.79611411501; Mon, 5 Oct 2020 14:11:58 -0700 (PDT) Received: from localhost ([::1]:47048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXm1-0001ge-5x for importer@patchew.org; Mon, 05 Oct 2020 17:11:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkX-0008Fn-Bu for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkU-0007Ru-9V for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:24 -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-253-aoN-qZgfNdS6YBgBnGRNsA-1; Mon, 05 Oct 2020 17:10:18 -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 7551B925C27; Mon, 5 Oct 2020 21:10:17 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E5635C1BD; Mon, 5 Oct 2020 21:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932221; 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=GTor5GPI9oq27QRafwNM8TB2ZTmF47ZN+uwA9IOBGMg=; b=IRtVC8o0HqbbxvsuXKbqMDwKA37/qVnVEKXbbvYOs4lO3fiHbptjD5ZTKcSNNJr2bVtMy2 tHYcQmNv6JYLpaWYA6qsLazBY4kfkv1mbKCCaytuFFdsTYuPRtjkzDA0+igwQTSEi9HINj jJisyMOuG8kNgl6Vx9SRSHZNYi3cdqc= X-MC-Unique: aoN-qZgfNdS6YBgBnGRNsA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 09/21] hw/core/cpu: Add missing 'exec/cpu-common.h' include Date: Mon, 5 Oct 2020 17:09:48 -0400 Message-Id: <20201005211000.710404-10-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , =?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) From: Philippe Mathieu-Daud=C3=A9 cpu_common_reset() uses tcg_flush_softmmu_tlb() which is declared in "exec/cpu-common.h". Add the missing header to avoid when refactoring other headers: hw/core/cpu.c: In function =E2=80=98cpu_common_reset=E2=80=99: hw/core/cpu.c:273:9: error: implicit declaration of function =E2=80=98tcg= _flush_softmmu_tlb=E2=80=99 [-Werror=3Dimplicit-function-declaration] 273 | tcg_flush_softmmu_tlb(cpu); | ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200908123433.105706-1-philmd@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index c55c09f734c..b06eb38ecca 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -26,6 +26,7 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "exec/log.h" +#include "exec/cpu-common.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932610; cv=none; d=zohomail.com; s=zohoarc; b=Tdn0C79VxkyhS6Zznb1peRozuG7uMq4xEEwbtFeZ+svLrBvh7EDJg2P5WdD0jN9h/Y8KNiBMgCIhp033SFSrlShCICaHLm0tF5NT5SMG6JJBA/atA52EdYHsBQOK5TAi3lfg3DYZN4bqLvaOXmkNyX700VIbb9g4BPPGkPRA1KI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932610; 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=7iQEv3zt3p82NBPGH5arb7e91tJI4oUtytLb1EkHJy4=; b=QfES5SizH1oRYc7Zu8qi4kC2UH8EzfZqvBOUBPnJqPMCZvnx+ZMbtY3TU4515WCBEGuHHzrVabD2fsCjmQ+TXxKO+sJtsakmGkHIdSimxIS0fmjdZapRyQCDLlwv4bEcZDNFnAMeHlLxhMk8ffzZTHoKRuH6yyEu9ZIeMHtB+ts= 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 160193261023421.150881206776944; Mon, 5 Oct 2020 14:16:50 -0700 (PDT) Received: from localhost ([::1]:34998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXqj-0008N1-18 for importer@patchew.org; Mon, 05 Oct 2020 17:16:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkX-0008HG-Uq for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkW-0007S4-3P for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:25 -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-519-HHsBiQw6M_qaHk8d8fq6gA-1; Mon, 05 Oct 2020 17:10:20 -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 C0CFB1015C9D; Mon, 5 Oct 2020 21:10:18 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C8305C1BD; Mon, 5 Oct 2020 21:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932222; 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=7iQEv3zt3p82NBPGH5arb7e91tJI4oUtytLb1EkHJy4=; b=OOI0Cp4VFL/kRAYH3U+whtser6XXfufkIXvyZxj5SycY14AOmn+DaxJci1HpRlVKEdeCB1 7E4T8ECBYnDIA3wboHGTbdD2ShMru2EBodSFfX/L3cSKqF5ewSSxtyxfHoVrT1WIpAKtwY 4owowVXyhiEbofo07n226S09Xcs1elI= X-MC-Unique: HHsBiQw6M_qaHk8d8fq6gA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 10/21] qom: Improve error message displayed with missing object properties Date: Mon, 5 Oct 2020 17:09:49 -0400 Message-Id: <20201005211000.710404-11-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Li Qiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Instead of only displaying the property missing, also display the object name. This help developer to quickly figure out the mistake without opening a debugger. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eduardo Habkost Reviewed-by: Li Qiang Acked-by: Paolo Bonzini Message-Id: <20200920155340.401482-1-f4bug@amsat.org> Signed-off-by: Eduardo Habkost --- qom/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index c335dce7e4a..10653552334 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1291,7 +1291,8 @@ ObjectProperty *object_property_find_err(Object *obj,= const char *name, { ObjectProperty *prop =3D object_property_find(obj, name); if (!prop) { - error_setg(errp, "Property '.%s' not found", name); + error_setg(errp, "Property '%s.%s' not found", + object_get_typename(obj), name); } return prop; } --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932969; cv=none; d=zohomail.com; s=zohoarc; b=DUeR3RjX5vpM66M6/K/28pJO+eidAMM8aE0OB+8qX1wGqUu8p800kAITSLYLXG3vAOc3+S9H0S71fFmA4xxZwhBc+iVNfQx5iaQFNilU44/ste9GwcBmvbQdXYp2hkjHX9GzXo6DVsI7H5gGWwqapPYNY3pP2L5RTHtYe3/Ylrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932969; 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=CFkRUXqjKf/4IKRjJGRwHfEVy0pxseiDrE05rRerkyI=; b=CfMzM1j6X6GzF9+4dzRavfiEfVd9k71MCNUjjtskLvCnt3yuB+cnib31k7/UgvjKDf4MXdS4fErQ4HR9A1Bp7Hx3ZlRf30ug6zvgf/p3HdwGEE9+ZEUhNt6NQR7sghC0hDmz860SETgWAR8ryRTdG09uEcafSn2FWAbO6PIt+7Q= 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 1601932969092741.6627534360521; Mon, 5 Oct 2020 14:22:49 -0700 (PDT) Received: from localhost ([::1]:53370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXwV-0007fV-QG for importer@patchew.org; Mon, 05 Oct 2020 17:22:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkZ-0008JB-31 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkW-0007SB-3F for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:26 -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-468-zlX4B4HENLe869JEvgd6JQ-1; Mon, 05 Oct 2020 17:10:21 -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 42CA41015C9E; Mon, 5 Oct 2020 21:10:20 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 022695C1BD; Mon, 5 Oct 2020 21:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932223; 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=CFkRUXqjKf/4IKRjJGRwHfEVy0pxseiDrE05rRerkyI=; b=BE7Zb2JGRECBEtpCrmQv3+useOCUetgL80GOgciLDpbSuvHyx927xs18MyS2l8g5FzXzP2 NJHiNJN8GBZaIDC8PQGHzsET/eP7jHMeLv5rwIEd+wcYcNLmXWR3V2sYi4rh9gHgIXI/dW v3HHe42NkSnDa0IkeFSQRTEnBoyWzOk= X-MC-Unique: zlX4B4HENLe869JEvgd6JQ-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 11/21] qom: Fix DECLARE_*CHECKER documentation Date: Mon, 5 Oct 2020 17:09:50 -0400 Message-Id: <20201005211000.710404-12-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , =?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) Correct copy/paste mistake in the DECLARE_INSTANCE_CHECKER and DECLARE_CLASS_CHECKERS documentation. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 27aaa67e63f..de121d8d8e8 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -170,7 +170,7 @@ struct Object * Direct usage of this macro should be avoided, and the complete * OBJECT_DECLARE_TYPE macro is recommended instead. * - * This macro will provide the three standard type cast functions for a + * This macro will provide the instance type cast functions for a * QOM type. */ #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \ @@ -187,7 +187,7 @@ struct Object * Direct usage of this macro should be avoided, and the complete * OBJECT_DECLARE_TYPE macro is recommended instead. * - * This macro will provide the three standard type cast functions for a + * This macro will provide the class type cast functions for a * QOM type. */ #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \ --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932676; cv=none; d=zohomail.com; s=zohoarc; b=lFGyAC/JpKijoJTttrL4v5eqJMU7dpOuHkuy+nxJm8kY7YcGY8DgmLehA3Z4payIqKI3EIVy668e6kUVvqEWoU60VoP/kDJxBHRa1zp0sDQI7RidsoAiiI37B22sv//I5N6JSj1CSrHq9+ZwUCt5zo8BFsxkIY0tbRDmJp2AhLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932676; 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=yIOlXrv/RBvf5BoM2U2VFlFly8atKbalLltlNkph3bc=; b=G4WLIcwlk44Fqdik+oKXyqs7+yzKUTFKj/DcuKHc7KuwOeUGzNwH2UIW3SS5ECCBj9zWeYOVtGZt38jKyWvk+uTA+aDS4sD/8TfUNlyBQC2DMfL5BGhN9R7Oah0hnSM4huIhO0w2SVDU6f4QBbHPVjE0YEyfjh+9jVHpbwhhhvo= 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 1601932676196399.8580971017178; Mon, 5 Oct 2020 14:17:56 -0700 (PDT) Received: from localhost ([::1]:36118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXrm-0000Q6-TJ for importer@patchew.org; Mon, 05 Oct 2020 17:17:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkb-0008PN-MQ for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkX-0007SM-BX for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:29 -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-591-I25DKRAaM-uxi_FD4S6lIg-1; Mon, 05 Oct 2020 17:10:22 -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 85D98873084; Mon, 5 Oct 2020 21:10:21 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 438DC5D9CD; Mon, 5 Oct 2020 21:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932224; 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=yIOlXrv/RBvf5BoM2U2VFlFly8atKbalLltlNkph3bc=; b=U6YsqPWS1ilxcborrfDUsubvigl9UZVDwirC2imv3yLMBgQAEDPcq6KI3snETh8ToofrNy n12iVtvxvQgS+z7q2/FuT7T4OZTnhiltRGm6MBhDaUNbGk0lkrU6vHTqclQ1b2GFLFw7Iw 2ST4rdq8Qeyaup5ATmO7sZNFYhtL2u0= X-MC-Unique: I25DKRAaM-uxi_FD4S6lIg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 12/21] docs/devel/qom: Fix indentation of bulleted list Date: Mon, 5 Oct 2020 17:09:51 -0400 Message-Id: <20201005211000.710404-13-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" The list was incorrectly parsed as a literal block due to indentation. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 0b943b2a1a8..c4857d95c8e 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -8,9 +8,9 @@ The QEMU Object Model provides a framework for registering = user creatable types and instantiating objects from those types. QOM provides the follow= ing features: =20 - - System for dynamically registering types - - Support for single-inheritance of types - - Multiple inheritance of stateless interfaces +- System for dynamically registering types +- Support for single-inheritance of types +- Multiple inheritance of stateless interfaces =20 .. code-block:: c :caption: Creating a minimal type --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932823; cv=none; d=zohomail.com; s=zohoarc; b=OBSci4YgMFtjsM1p6GG06+FwYrvIldehXAZ+168tHbhJiQ4VrcFbhcTuUr5KD8RqUpIzOGEExkUhN3a2+w2reWZVfBRAWvV1pXRMStqcT/jl5fjbWeQ87uogCiJVqPjROGdYH/IxC9SfeD3aODZtzeNFf2yILLIHNhHn11wLojM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932823; 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=W+yWMzr7we7iUkfgz+kLkjKlVO4iF5CR5vCYlbGAjXM=; b=ca4DVQxQEh/PBcgKJlwUg7KctDzgU8MQu3rxBnzUHeDMlj39eFWU+Jvm8cSxZQIfz8+scvnQgT2UNI0OobOGVWjT4TgNjuFpaBqgTBwdT4QEpKfW0yxSxj20wPjH6nqHqaPT6CNmnL9XIBiucR4AziNCB13dHvGFJ2H93qcEe4w= 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 1601932822999908.7919548092025; Mon, 5 Oct 2020 14:20:22 -0700 (PDT) Received: from localhost ([::1]:43460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXu9-0003VP-Nz for importer@patchew.org; Mon, 05 Oct 2020 17:20:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkb-0008OJ-E5 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkZ-0007Sa-5S for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:28 -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-60-6n565AwYO3mNHhBpxhkKoA-1; Mon, 05 Oct 2020 17:10:24 -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 625071DDED; Mon, 5 Oct 2020 21:10:23 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECE3160BFA; Mon, 5 Oct 2020 21:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932226; 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=W+yWMzr7we7iUkfgz+kLkjKlVO4iF5CR5vCYlbGAjXM=; b=W4f7YBfOAkZL1pwBGmjK7kbbGB3e2q7oK5KA6Ye7TGMMbgSDn6P/Mx+JxstlS26FfBAh2S y2cwdcSR0jE5phLfw8Zlc1wUbgLqyyK9ECrGkLcXspZpviN5jfRmWYVf599o9rMRPs2VBy H7yccILMO6thfrxkJNl8WAaYG561Ick= X-MC-Unique: 6n565AwYO3mNHhBpxhkKoA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 13/21] docs/devel/qom: Fix indentation of code blocks Date: Mon, 5 Oct 2020 17:09:52 -0400 Message-Id: <20201005211000.710404-14-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" Some code blocks had one extra space, fix that. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 76 +++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index c4857d95c8e..a47e1b9a239 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -284,28 +284,28 @@ in the header file: .. code-block:: c :caption: Declaring a simple type =20 - OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) =20 This is equivalent to the following: =20 .. code-block:: c :caption: Expansion from declaring a simple type =20 - typedef struct MyDevice MyDevice; - typedef struct MyDeviceClass MyDeviceClass; + typedef struct MyDevice MyDevice; + typedef struct MyDeviceClass MyDeviceClass; =20 - G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref) =20 - #define MY_DEVICE_GET_CLASS(void *obj) \ - OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE) - #define MY_DEVICE_CLASS(void *klass) \ - OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE) - #define MY_DEVICE(void *obj) - OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) + #define MY_DEVICE_GET_CLASS(void *obj) \ + OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE) + #define MY_DEVICE_CLASS(void *klass) \ + OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE) + #define MY_DEVICE(void *obj) + OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) =20 - struct MyDeviceClass { - DeviceClass parent_class; - }; + struct MyDeviceClass { + DeviceClass parent_class; + }; =20 The 'struct MyDevice' needs to be declared separately. If the type requires virtual functions to be declared in the class @@ -319,33 +319,33 @@ In the simple case the OBJECT_DEFINE_TYPE macro is su= itable: .. code-block:: c :caption: Defining a simple type =20 - OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) =20 This is equivalent to the following: =20 .. code-block:: c :caption: Expansion from defining a simple type =20 - static void my_device_finalize(Object *obj); - static void my_device_class_init(ObjectClass *oc, void *data); - static void my_device_init(Object *obj); - - static const TypeInfo my_device_info =3D { - .parent =3D TYPE_DEVICE, - .name =3D TYPE_MY_DEVICE, - .instance_size =3D sizeof(MyDevice), - .instance_init =3D my_device_init, - .instance_finalize =3D my_device_finalize, - .class_size =3D sizeof(MyDeviceClass), - .class_init =3D my_device_class_init, - }; - - static void - my_device_register_types(void) - { - type_register_static(&my_device_info); - } - type_init(my_device_register_types); + static void my_device_finalize(Object *obj); + static void my_device_class_init(ObjectClass *oc, void *data); + static void my_device_init(Object *obj); + + static const TypeInfo my_device_info =3D { + .parent =3D TYPE_DEVICE, + .name =3D TYPE_MY_DEVICE, + .instance_size =3D sizeof(MyDevice), + .instance_init =3D my_device_init, + .instance_finalize =3D my_device_finalize, + .class_size =3D sizeof(MyDeviceClass), + .class_init =3D my_device_class_init, + }; + + static void + my_device_register_types(void) + { + type_register_static(&my_device_info); + } + type_init(my_device_register_types); =20 This is sufficient to get the type registered with the type system, and the three standard methods now need to be implemented @@ -358,9 +358,9 @@ This accepts an array of interface type names. .. code-block:: c :caption: Defining a simple type implementing interfaces =20 - OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, - MY_DEVICE, DEVICE, - { TYPE_USER_CREATABLE }, { NULL }) + OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, + MY_DEVICE, DEVICE, + { TYPE_USER_CREATABLE }, { NULL }) =20 If the type is not intended to be instantiated, then then the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: @@ -368,7 +368,7 @@ the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used ins= tead: .. code-block:: c :caption: Defining a simple abstract type =20 - OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) =20 =20 =20 --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932938; cv=none; d=zohomail.com; s=zohoarc; b=j3nXKtCoP1zmyrgbhvfMX/VWG7s0ihOeSnfHVqzO0Lx/s2soqSQQQ0LvEIbAoAH5XHoZoNiplXFLp5MtGXsPx7YtcBN09+fC34Ki+l9f0DKYFpGp/ICG8bCJyCJKAFHylgEMwXIgRYDQWukrdNC6TVkp/0ndWP+ucWwe6BAwScY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932938; 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=uEyhLN+7XslyBoI0Db6s1CZEYZyW8MgA6FMtj5f7PIE=; b=lW/IRoyqOrTn4KRI4wzzUuYDLUI5qUiUxba0MqOLj0MUKqMAkmAAaJh5zEjolsxlgd55smGGV0eyR3sFbkU9qoFastbdhkXpa7heMNZwe9xkzISguiMPYhrrGyBs9xfn9e/nqayO2YQOsPPCrLc82XtgLnrCEvxYTlR3uU8x4QQ= 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 1601932938607379.50639982076405; Mon, 5 Oct 2020 14:22:18 -0700 (PDT) Received: from localhost ([::1]:50910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXw0-0006fs-Sv for importer@patchew.org; Mon, 05 Oct 2020 17:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkn-0000Bz-G2 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkj-0007US-8V for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:40 -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-65-ON17W0wNOPO7TeyY14uwJg-1; Mon, 05 Oct 2020 17:10:31 -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 0E7EF18A8220; Mon, 5 Oct 2020 21:10:30 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id C123660BFA; Mon, 5 Oct 2020 21:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932235; 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=uEyhLN+7XslyBoI0Db6s1CZEYZyW8MgA6FMtj5f7PIE=; b=FIYEtLdpcJtrL/Yv8z3FgTGfDXmStCogiF6p/LIpCLGwG6dlsVCZ78RZtsh8OW72O5sAQA /Tn2IJ9PVSZT/hIdoA2L1YfL50EMAZ6qUR2NJI98u70Nogn53vpvKi+oBmhDJA5rUXiPuZ 84ozNjRphD2r8eQujpTseAZ/aNM+qoc= X-MC-Unique: ON17W0wNOPO7TeyY14uwJg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 14/21] docs/devel/qom: Use *emphasis* for emphasis Date: Mon, 5 Oct 2020 17:09:53 -0400 Message-Id: <20201005211000.710404-15-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , =?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) is not valid reST syntax. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index a47e1b9a239..0c610e20d62 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -174,17 +174,17 @@ dynamically cast it to an object that implements the = interface. Methods =3D=3D=3D=3D=3D=3D=3D =20 -A method is a function within the namespace scope of +A *method* is a function within the namespace scope of a class. It usually operates on the object instance by passing it as a strongly-typed first argument. If it does not operate on an object instance, it is dubbed -class method. +*class method*. =20 Methods cannot be overloaded. That is, the #ObjectClass and method name uniquely identity the function to be called; the signature does not vary except for trailing varargs. =20 -Methods are always virtual. Overriding a method in +Methods are always *virtual*. Overriding a method in #TypeInfo.class_init of a subclass leads to any user of the class obtained via OBJECT_GET_CLASS() accessing the overridden function. The original function is not automatically invoked. It is the responsibili= ty --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601933132; cv=none; d=zohomail.com; s=zohoarc; b=m5tOPbaU07OzBxXPammWEWUS73c1dXOdsaTib8xRH822O6F1gJ2qTFeO2DL7PwnzN1KYekfbASVsK6rad4Z188Wck2QtEqPCGK2o8S1tDEX5gkld5toAyR5PJ/dL8NgXJRfOej1xE/ogI4IRL3e4PUexJH7by7sHNAgJ8yq2+Ww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601933132; 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=oOBeLpeIEpL/TxoU2ObY2AqnifWcBURZsaekTSVcawE=; b=QzWWfquT7sOK6S2Aro5gOSbIQsHLWopprzWyqUA9jRAHByfI05iTNhidl1mttlFda1c8pheksskJqkvqDnVvrqVY+DpIERn5UWMTP5M6jeMfsTR1gfcVi5k3gMO8NZxP8vp7MZJOy3k7UD5HCjv+JtK/oxoO7eOE/QEPcCO6hwo= 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 1601933132810733.4834264590951; Mon, 5 Oct 2020 14:25:32 -0700 (PDT) Received: from localhost ([::1]:58928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXz9-0001bq-LU for importer@patchew.org; Mon, 05 Oct 2020 17:25:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkm-0000Ae-BV for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXki-0007UP-UR for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:39 -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-61-SKSFeW3kPC2_uK7b5ns2RA-1; Mon, 05 Oct 2020 17:10:33 -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 34CBC873114; Mon, 5 Oct 2020 21:10:32 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9F0378807; Mon, 5 Oct 2020 21:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932235; 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=oOBeLpeIEpL/TxoU2ObY2AqnifWcBURZsaekTSVcawE=; b=JIafn13eB8SW3hYeUlsTCN1OleHiIpTT41hOupGkALUjfNCjIe63wz7xsDUtBzQ79C1SIa I/64XuiTOZ8duqCMDLcq7enhZHrU2klG//xbPoKRIzQok+Lp5E1ACFnIZ5fxTylys4Bnup Tmne1Cr6BAsTXHwQr5udeih9dSAsIpI= X-MC-Unique: SKSFeW3kPC2_uK7b5ns2RA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 15/21] docs/devel/qom: Remove usage of Date: Mon, 5 Oct 2020 17:09:54 -0400 Message-Id: <20201005211000.710404-16-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" is not valid reST syntax. Function @argument references don't need additional markup, so just remove . Constants were changed to use reST ``code`` syntax Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index de121d8d8e8..e80092f349a 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1256,7 +1256,7 @@ char *object_property_get_str(Object *obj, const char= *name, * Writes an object's canonical path to a property. * * If the link property was created with - * OBJ_PROP_LINK_STRONG bit, the old target object is + * %OBJ_PROP_LINK_STRONG bit, the old target object is * unreferenced, and a reference is added to the new target object. * * Returns: %true on success, %false on failure. @@ -1603,16 +1603,16 @@ void object_property_allow_set_link(const Object *o= bj, const char *name, * * Links form the graph in the object model. * - * The @check() callback is invoked when + * The @check() callback is invoked when * object_property_set_link() is called and can raise an error to prevent = the - * link being set. If @check is NULL, the property is read-o= nly + * link being set. If @check is NULL, the property is read-only * and cannot be set. * * Ownership of the pointer that @child points to is transferred to the - * link property. The reference count for *@child is + * link property. The reference count for *@child is * managed by the property from after the function returns till the * property is deleted with object_property_del(). If the - * @flags OBJ_PROP_LINK_STRONG bit is set, + * @flags %OBJ_PROP_LINK_STRONG bit is set, * the reference count is decremented when the property is deleted or * modified. * @@ -1823,7 +1823,7 @@ ObjectProperty *object_class_property_add_uint64_ptr(= ObjectClass *klass, * Add an alias for a property on an object. This function will add a pro= perty * of the same type as the forwarded property. * - * The caller must ensure that @target_obj stays alive as lon= g as + * The caller must ensure that @target_obj stays alive as long as * this property exists. In the case of a child object or an alias on the= same * object this will be the case. For aliases to other objects the caller = is * responsible for taking a reference. --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601933093; cv=none; d=zohomail.com; s=zohoarc; b=g3I8UFOCChZVDI1fvfGTj/R7AIkBCAdcVsA8zk/dTmI93Dg6Q99CKu5Ew5bFdbp+aFNcWTY1kc7JLym3PuH7GMuF6uhEpafyB0g/VrNS8RTw+ngXQ8IPU1tP57UvSjvei/uhxNsvxZfZc4VKcV2g47iiOYtbNP3W44NeNtooFSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601933093; 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=qrGBXwYPvVUK3Z/wlHGaca4o9hAswgl9cl/WwDh4d1E=; b=ijinNlKiN+L+CDdZxqg64gDb4HOo5gkk2VUdDoKXg9/mzcDZeLWlvAtBI0wqo9uaURohlr0V9Bhmia7rOB9CT3Z8Gz2tTOarw6UFTsRto+H20+qsZZ6jRLv81eOiveKptdPdum3M1xzsGeFCP0aqfmVK8x6Zs9FlEL/+I8w/yeE= 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 1601933093628549.2280808377668; Mon, 5 Oct 2020 14:24:53 -0700 (PDT) Received: from localhost ([::1]:57182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXyW-0000py-EC for importer@patchew.org; Mon, 05 Oct 2020 17:24:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkp-0000EP-5a for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkj-0007UY-92 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:42 -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-594-JDsxe8qwMRKxmgx5NgpD0w-1; Mon, 05 Oct 2020 17:10:34 -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 42F7D18A8223; Mon, 5 Oct 2020 21:10:33 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0936B78807; Mon, 5 Oct 2020 21:10:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932236; 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=qrGBXwYPvVUK3Z/wlHGaca4o9hAswgl9cl/WwDh4d1E=; b=HKbPINPDOLrhwS0CY83kPFbvSOi6NG0lB728rJz3YKo9tX1MadKDxO42f5rAmrwKtoNRqO WGxmrT3ptgPqJm5YQJTMGRDhOX+3Ug3vmmzMT4UT9odFG2q7fegKtCRj2k3tUnTP7Sv9JO FLgOsaQK41lrVmci9T78R9tosWvbsdE= X-MC-Unique: JDsxe8qwMRKxmgx5NgpD0w-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 16/21] docs/devel/qom: Avoid long lines Date: Mon, 5 Oct 2020 17:09:55 -0400 Message-Id: <20201005211000.710404-17-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 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=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , =?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) Long code lines don't look good in the rendered documents, make them shorter. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini Message-Id: <20201003025424.199291-7-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/qom.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 0c610e20d62..42d0dc4f4da 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -284,7 +284,8 @@ in the header file: .. code-block:: c :caption: Declaring a simple type =20 - OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, + MY_DEVICE, DEVICE) =20 This is equivalent to the following: =20 @@ -360,7 +361,8 @@ This accepts an array of interface type names. =20 OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, MY_DEVICE, DEVICE, - { TYPE_USER_CREATABLE }, { NULL }) + { TYPE_USER_CREATABLE }, + { NULL }) =20 If the type is not intended to be instantiated, then then the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: @@ -368,7 +370,8 @@ the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used ins= tead: .. code-block:: c :caption: Defining a simple abstract type =20 - OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) + OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, + MY_DEVICE, DEVICE) =20 =20 =20 --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932833; cv=none; d=zohomail.com; s=zohoarc; b=QLYUD59MHm0SMYEn0+5jADq49kJg0zkwhzssmJgYy5By0t//8JEgGT1/FlrtzYhFhLH/y0W1hZd4Aq3T57azwlpDa0YTagnH6nEzbvcV+p50umFa5O8yVSnZ80kYRjP1Rz+qKu6n5s+MkZRYuQRQidsyX4PSQJrb1FGLI6jEb1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932833; 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=367k11b3zf85sB9S3cGnMHOkTfp1Umm4WdkTED0mfWc=; b=Hu2CxaXYp1QswO0i/WtpjR8YhtS5eja9M2rsAERq2zrzjB50s0JcIoGLlNd+oU9hSOivPOvtkIZxda9ClvVdNo/V/TRVT+/02efyNlZ31r5gKZf1+Y3Wu6nd9193fMCULmBry2kyg9P5pXDm7iCRoBRV3NBhdk1mpoh6RF5VVO4= 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 1601932833913739.2617189954302; Mon, 5 Oct 2020 14:20:33 -0700 (PDT) Received: from localhost ([::1]:44420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXuK-0003vH-Lq for importer@patchew.org; Mon, 05 Oct 2020 17:20:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXko-0000CC-11 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkl-0007Ue-0N for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:41 -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-221-ZYv6mUTpNmGawxD6y1PG-g-1; Mon, 05 Oct 2020 17:10:35 -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 554701015C9D; Mon, 5 Oct 2020 21:10:34 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE40F55764; Mon, 5 Oct 2020 21:10:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932237; 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=367k11b3zf85sB9S3cGnMHOkTfp1Umm4WdkTED0mfWc=; b=ZPFUtSoHVbTrvSNDHJ04cqzYFZAigxzntZhox74R1RZboqoyJoWUZdKGo+lf1bcVtkx/Yz 5y+JNO43sknl2hwivzICdkEYvbeMoKQ/9SHXyWAtH64BMkBsbSpDFufUHQf0ExBmztSjhm ki495v39GY6oKDF3jeNCZn+QC1p2rlk= X-MC-Unique: ZYv6mUTpNmGawxD6y1PG-g-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 17/21] kernel-doc: Handle function typedefs that return pointers Date: Mon, 5 Oct 2020 17:09:56 -0400 Message-Id: <20201005211000.710404-18-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" One example that was not being parsed correctly by kernel-doc is: typedef Object *(ObjectPropertyResolve)(Object *obj, void *opaque, const char *part); Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/kernel-doc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 40ad782e342..57a4a72970f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1318,8 +1318,8 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || - $x =3D~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { + if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || + $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs $return_type =3D $1; --=20 2.26.2 From nobody Sun Nov 16 20:48:24 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=1601932616; cv=none; d=zohomail.com; s=zohoarc; b=HbKJCXYN+wPAYtRdpHfn+9UEi3i0roRVXqareE6cIPLk2L0qjsDeP5rKaIiYL4IFWEZ5OXIP/kt8fUXAVIOBu6SMZY9xrq47HO52+TAememGA5SNl4e00iHhjP+Y3UR8bKn7ZHzbjc4byZW6jUeKwVojbe7cfMfSwK4JZ8/nRP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932616; 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=V/DIhyhvEtrkwNuf6rQ6jEyrj/vxKuw1OcuQxCV9B4o=; b=bya4vXjJFphZJJSiqu9lD9qdfZq7Q8y5sksiZqbl50n4BPwJC3R/8+MvG+6Ccsf7smSshiSN/G2LJqGxl1jFH8h8+Nvb+M/estldrbHj4ivYivQwZGDd+CZMtN1/F+oUf2kg0APP84jRyUf8nE8DtiIlVYjVqrxiO+CxVzXHWUg= 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 1601932616755566.7914253798699; Mon, 5 Oct 2020 14:16:56 -0700 (PDT) Received: from localhost ([::1]:35150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXqp-0008Qs-5n for importer@patchew.org; Mon, 05 Oct 2020 17:16:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXko-0000CE-5c for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkm-0007Ul-2M for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:41 -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-423-K4gQbGmtPwa98O2of_imcA-1; Mon, 05 Oct 2020 17:10:37 -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 42270925C27; Mon, 5 Oct 2020 21:10:36 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6D0578800; Mon, 5 Oct 2020 21:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932239; 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=V/DIhyhvEtrkwNuf6rQ6jEyrj/vxKuw1OcuQxCV9B4o=; b=DbWYt1TS4BYyXQHu5tFoZT6a7fYGJCysdj0rwhd/da/owFOuImpaFhGsMm7hK6ci2gAd4t 0cBS1vvqIJJIaQ708HjSz2Ej7BALe2fquMV+Vj6YJCfOihxm5eyKTmflyKG+csLa1dPnte rbqoccffoMLskSUOu4XHKTeToAkqUAI= X-MC-Unique: K4gQbGmtPwa98O2of_imcA-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 18/21] kernel-doc: Handle function typedefs without asterisks Date: Mon, 5 Oct 2020 17:09:57 -0400 Message-Id: <20201005211000.710404-19-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" Example of typedef that was not parsed by kernel-doc: typedef void (ObjectUnparent)(Object *obj); Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 57a4a72970f..57b911ff174 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1318,7 +1318,7 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || + if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*?\s*(\w\S+)\s*\)\s*\((.*)\);/= || $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs --=20 2.26.2 From nobody Sun Nov 16 20:48:25 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=1601932953; cv=none; d=zohomail.com; s=zohoarc; b=jpi1rNvf2vna0FJ9DNvZUkSo5jrLpNkyMfEMC1sxQ0KBiXuejdh/1Z8RjtfQgpG+yseFcBeylacVcbaAp2bXSQbdoFm8bQbcETcN0xAs7pGrl6KNn+TJaLSfxwB3t5PTT7+z9fAKY3syksVxxfi2QU/ofbGNDdJ5SgbbxqkrFCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932953; 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=td30pR2ic3PP+wNUfwn0QC1kXRtCDJrHhwN3ScMRbng=; b=XLrtikOeqxy1SVxH0O4ykKEfewFA2PIme6YfMvVGdLaHiULRBoxrVc1VcYf0LDoIORRU+KJr3agBwaOUQ1S9D1fFWflcoR2RJcG5G3mdYZu69noL+33VdrgGD34sCCPoQWdTVljsHeL5evM9VHsE9goMnviNVMJMcw3i3PpmwF4= 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 1601932953993253.70034329734347; Mon, 5 Oct 2020 14:22:33 -0700 (PDT) Received: from localhost ([::1]:52156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXwG-0007A9-G6 for importer@patchew.org; Mon, 05 Oct 2020 17:22:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXks-0000Io-40 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkn-0007Uv-N4 for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:45 -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-321-flPsGMcPOk20uqX502UJQw-1; Mon, 05 Oct 2020 17:10:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CA0D1DDF6; Mon, 5 Oct 2020 21:10:37 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D901310013C0; Mon, 5 Oct 2020 21:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932240; 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=td30pR2ic3PP+wNUfwn0QC1kXRtCDJrHhwN3ScMRbng=; b=bMpY+jVuyxtxAdugC6nOf+ruBMBUfJ8ZQxiQcXrNHwtpxPTntjB/ZZq3aoWzbE3SBXqPBk zpUumdLmZf+XXtDE9y+KgBWMTdk9C2tr2c3zFcd7vRLHZssxcmWJP7FAJoUvspdv3P418x RH+vrRD2yBAqevmLj7jOAYz5nLMXRi0= X-MC-Unique: flPsGMcPOk20uqX502UJQw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 19/21] qom: Explicitly tag doc comments for typedefs and structs Date: Mon, 5 Oct 2020 17:09:58 -0400 Message-Id: <20201005211000.710404-20-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" If we explicitly indicate we are documenting a typedef or a struct, we'll be able to remove the $decl_type=3D'type name' hack from kernel-doc. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/qom/object.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index e80092f349a..d378f13a116 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -31,7 +31,7 @@ typedef struct InterfaceInfo InterfaceInfo; typedef struct ObjectProperty ObjectProperty; =20 /** - * ObjectPropertyAccessor: + * typedef ObjectPropertyAccessor: * @obj: the object that owns the property * @v: the visitor that contains the property data * @name: the name of the property @@ -47,7 +47,7 @@ typedef void (ObjectPropertyAccessor)(Object *obj, Error **errp); =20 /** - * ObjectPropertyResolve: + * typedef ObjectPropertyResolve: * @obj: the object that owns the property * @opaque: the opaque registered with the property * @part: the name of the property @@ -66,7 +66,7 @@ typedef Object *(ObjectPropertyResolve)(Object *obj, const char *part); =20 /** - * ObjectPropertyRelease: + * typedef ObjectPropertyRelease: * @obj: the object that owns the property * @name: the name of the property * @opaque: the opaque registered with the property @@ -78,7 +78,7 @@ typedef void (ObjectPropertyRelease)(Object *obj, void *opaque); =20 /** - * ObjectPropertyInit: + * typedef ObjectPropertyInit: * @obj: the object that owns the property * @prop: the property to set * @@ -101,7 +101,7 @@ struct ObjectProperty }; =20 /** - * ObjectUnparent: + * typedef ObjectUnparent: * @obj: the object that is being removed from the composition tree * * Called when an object is being removed from the QOM composition tree. @@ -110,7 +110,7 @@ struct ObjectProperty typedef void (ObjectUnparent)(Object *obj); =20 /** - * ObjectFree: + * typedef ObjectFree: * @obj: the object being freed * * Called when an object's last reference is removed. @@ -120,7 +120,7 @@ typedef void (ObjectFree)(void *obj); #define OBJECT_CLASS_CAST_CACHE 4 =20 /** - * ObjectClass: + * struct ObjectClass: * * The base for all classes. The only thing that #ObjectClass contains is= an * integer type handle. @@ -140,7 +140,7 @@ struct ObjectClass }; =20 /** - * Object: + * struct Object: * * The base for all objects. The first member of this object is a pointer= to * a #ObjectClass. Since C guarantees that the first member of a structure @@ -370,7 +370,7 @@ struct Object true, { NULL }) =20 /** - * TypeInfo: + * struct TypeInfo: * @name: The name of the type. * @parent: The name of the parent type. * @instance_size: The size of the object (derivative of #Object). If @@ -496,7 +496,7 @@ struct TypeInfo OBJECT_CLASS_CHECK(class, object_get_class(OBJECT(obj)), name) =20 /** - * InterfaceInfo: + * struct InterfaceInfo: * @type: The name of the interface. * * The information associated with an interface. @@ -506,7 +506,7 @@ struct InterfaceInfo { }; =20 /** - * InterfaceClass: + * struct InterfaceClass: * @parent_class: the base class * * The class for all interfaces. Subclasses of this class should only add --=20 2.26.2 From nobody Sun Nov 16 20:48:25 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=1601932823; cv=none; d=zohomail.com; s=zohoarc; b=I8vcNGF38j9k6sAwEvrnElLtXLRLS8NkuJfJicasjH29dK7doSxx7EFT/f7k0T2TP4K35GIGKdx3+6BbwgGaMh/nik6rpulOeL2Q+OHi37BIGluUXLJOZwGoBWP30+Iu4i0jGX9HG6brV5ngiwT6o0weFQjv0CxqiHP2wPBid/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601932823; 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=g6mjwRssty9u8VVE9TYy5V6D+c+F3D0e09kwIT5voW4=; b=JT3GqAM1MH70+c/oncUueV7kuFgWesaduqQAFRbYVQSihyDD+qsVy2lJSc+biY3AP6eFU7eO0hXsRZIf6mXvyu4c5epXQn8gQ++xGNaUBrdBMDEm0kEIOr95jGa+dronq7PD4TWlg9XHLv0CwQmHF/2DP+a6T9AgL/MdtkRP8kY= 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 1601932823332611.3343685243142; Mon, 5 Oct 2020 14:20:23 -0700 (PDT) Received: from localhost ([::1]:43510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPXuA-0003X6-0W for importer@patchew.org; Mon, 05 Oct 2020 17:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXkr-0000G9-7C for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkn-0007VB-Nx for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:44 -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-498-rhZiGEXEPIKZWgkOsOKOWw-1; Mon, 05 Oct 2020 17:10:39 -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 2B244925C47; Mon, 5 Oct 2020 21:10:38 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD77160C84; Mon, 5 Oct 2020 21:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932241; 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=g6mjwRssty9u8VVE9TYy5V6D+c+F3D0e09kwIT5voW4=; b=C7IQ4N43+mmmEsZaRKPuXgH2DsrQkOlBNF5AjocGAWaN61k8No4SJFUWOE3WRZD7tmUfKO 30y1q3F5i5k6Xm7CezzBZNouU3Xg1d8khaKGSPGDVg5xNwPH1zzbFw7OGdIys9KDkKY3aQ x719QrSiENrcN4QcZad1tgPlTyajlDg= X-MC-Unique: rhZiGEXEPIKZWgkOsOKOWw-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 20/21] memory: Explicitly tag doc comments for structs Date: Mon, 5 Oct 2020 17:09:59 -0400 Message-Id: <20201005211000.710404-21-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 01:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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 will allow us to remove the QEMU-specific $decl_type=3D'type name' hack from the kernel-doc script. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/exec/memory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index dee09851622..622207bde12 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -443,7 +443,7 @@ struct IOMMUMemoryRegion { QLIST_FOREACH((n), &(mr)->iommu_notify, node) =20 /** - * MemoryListener: callbacks structure for updates to the physical memory = map + * struct MemoryListener: callbacks structure for updates to the physical = memory map * * Allows a component to adjust to changes in the guest-visible memory map. * Use with memory_listener_register() and memory_listener_unregister(). @@ -681,7 +681,7 @@ struct MemoryListener { }; =20 /** - * AddressSpace: describes a mapping of addresses to #MemoryRegion objects + * struct AddressSpace: describes a mapping of addresses to #MemoryRegion = objects */ struct AddressSpace { /* private: */ @@ -721,7 +721,7 @@ static inline FlatView *address_space_to_flatview(Addre= ssSpace *as) =20 =20 /** - * MemoryRegionSection: describes a fragment of a #MemoryRegion + * struct MemoryRegionSection: describes a fragment of a #MemoryRegion * * @mr: the region, or %NULL if empty * @fv: the flat view of the address space the region is mapped in --=20 2.26.2 From nobody Sun Nov 16 20:48:25 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=1601933209; cv=none; d=zohomail.com; s=zohoarc; b=M/JRoXGko9OvHGltxUmE+KOb1hzAh14h33r1yE4N912RbbbnnAKK9z/FHAZGWD6cxwoad5P3rUOleWu4cv5l4Nnmz3kXP0QFICufYC4yTx19y/3I8e3YpJwy8zpaSExcd7jjcdwNExKqnY77mJGB0B5U4w5L+BojhRYLSD3JWp8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601933209; 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=RwYCiXdAmTXHfZXidBeGhTZZfr5GhsciCqhJzbwtFTQ=; b=inJLpMoFhPdF/uvWw8jwPfvi0LCs3/sHRwNaLGltxspY8Ufg923PJmTVCAjHn9IGbZT5CdK/YCRQv3LUVh9RFfbkZIehM+Dg6SMmlKzVEsuzxIMmVfzIaBjlkzKDR+qIfEk0zyFAgli/V1y8I36NpwxcSFy2hSJJNivezUaTUnI= 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 1601933209964393.5604059656928; Mon, 5 Oct 2020 14:26:49 -0700 (PDT) Received: from localhost ([::1]:33424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPY0O-0002t5-Q7 for importer@patchew.org; Mon, 05 Oct 2020 17:26:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPXks-0000Ky-HW for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPXkq-0007Vm-RS for qemu-devel@nongnu.org; Mon, 05 Oct 2020 17:10:46 -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-347-EeCNH76cMZWk_qRxYZYTlg-1; Mon, 05 Oct 2020 17:10:41 -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 7E4D6107ACF5; Mon, 5 Oct 2020 21:10:39 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D46755770; Mon, 5 Oct 2020 21:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601932243; 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=RwYCiXdAmTXHfZXidBeGhTZZfr5GhsciCqhJzbwtFTQ=; b=VUwR3JLR0l0D+t4yQj3C4psI9OmH43CaLZQdBZcXTncnW0eJnN54MHPDZZKvfdluYqpBc0 4Ko/fi3txhYrzjxZsf5qnjN1XuIKKEbWT+CxJy8YUcyGTO+iUAE4W6fspfTYdqtmTWRg3q bSAcvfFBV7UVMjNBS7yAIDWZLQ6Du1M= X-MC-Unique: EeCNH76cMZWk_qRxYZYTlg-1 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 21/21] kernel-doc: Remove $decl_type='type name' hack Date: Mon, 5 Oct 2020 17:10:00 -0400 Message-Id: <20201005211000.710404-22-ehabkost@redhat.com> In-Reply-To: <20201005211000.710404-1-ehabkost@redhat.com> References: <20201005211000.710404-1-ehabkost@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=ehabkost@redhat.com X-Mimecast-Spam-Score: 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=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 02:11:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.733, 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_H4=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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost 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" The $decl_type=3D'type name' hack makes it impossible to document macros with uppercase names (e.g. most of the macros in object.h). Now that we have explicitly tagged the struct and typedef doc comments in memory.h and object.h, we don't need that hack anymore. This will make the documentation for the macros in object.h finally be rendered as expected. Signed-off-by: Eduardo Habkost Reviewed-by: Paolo Bonzini Message-Id: <20201003024123.193840-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/kernel-doc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 57b911ff174..0ff62bb6a2d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1064,14 +1064,6 @@ sub output_blockhead { sub dump_declaration($$) { no strict 'refs'; my ($prototype, $file) =3D @_; - if ($decl_type eq 'type name') { - if ($prototype =3D~ /^(enum|struct|union)\s+/) { - $decl_type =3D $1; - } else { - return; - } - } - my $func =3D "dump_" . $decl_type; &$func(@_); } @@ -1928,9 +1920,7 @@ sub process_name($$) { ++$warnings; } =20 - if ($identifier =3D~ m/^[A-Z]/) { - $decl_type =3D 'type name'; - } elsif ($identifier =3D~ m/^struct\b/) { + if ($identifier =3D~ m/^struct\b/) { $decl_type =3D 'struct'; } elsif ($identifier =3D~ m/^union\b/) { $decl_type =3D 'union'; --=20 2.26.2