From nobody Sun May 19 01:26:52 2024 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=1602022311; cv=none; d=zohomail.com; s=zohoarc; b=mC9B8QzNsAh7q7N+4jGfPWgkgByxZ+Cb7hcCyZsMVpaB6sL00WYyxa/110AIwwwaS07eeDCqew81GKBoTqp/hNlDD1l2haCy6522cROo1+1O+9r1nN0KavPKAVrfDRMWqJKo8zd4RmIRfMmdu+l3aj783YuCo/padQU3dkCLtNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022311; 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=B6cF7lQvkk+FkcOqj6DRLMk1v+/6oqu6ycHyF+8k1zE=; b=OnY7ER0yaR8ywnQDB0Gv7h+EqXVjztW+5OaZ++kAZzXABxhBZf9kRN9U/PNoR7TFArNwuAvcNuAl7LedyB3PvTEgXnsFjXk4Rn8QbchUFLFectwOEuh7SVprzffacKIS4ZM1uTQcks2e7LStNv89o3+tUbDjB+Z5aAiyO0mcYF8= 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 16020223119491009.7052550853364; Tue, 6 Oct 2020 15:11:51 -0700 (PDT) Received: from localhost ([::1]:46350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvBW-0008Oy-L5 for importer@patchew.org; Tue, 06 Oct 2020 18:11:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9U-0006Xp-Mg for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9S-0006Ne-TM for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09: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-55-IKqgTpFsOCeIIL_l6o6NYA-1; Tue, 06 Oct 2020 18:09:39 -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 1E2068015A4; Tue, 6 Oct 2020 22:09: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 6F34755770; Tue, 6 Oct 2020 22:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022182; 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=B6cF7lQvkk+FkcOqj6DRLMk1v+/6oqu6ycHyF+8k1zE=; b=Gse+Z0LFujvXrbFxIKxKHZ3UxswGalAVAoJJGXbzUO4HZSnCuOvjZa9ItB7iDrjsYYDSXe DlMBUW6eYjvX/RF7mDR2wdz1xxXOHmVtch1cM7LcCdHOEUozrYVOLTy6gCFNOyolUj//jX jKuSirfAzuH+ZA1Nq8zPhcFiXIJpahA= X-MC-Unique: IKqgTpFsOCeIIL_l6o6NYA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 01/21] hw/core/qdev-properties: Use qemu_strtol() in set_mac() handler Date: Tue, 6 Oct 2020 18:09:10 -0400 Message-Id: <20201006220930.908275-2-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 343c824da0..080ba319a1 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 May 19 01:26:52 2024 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=1602022514; cv=none; d=zohomail.com; s=zohoarc; b=nwgVx3Wn0kI4OOubc1ZO7nKUby4sQBRf4DZ8K9f6yDDmwACU5+Qos9unJXE191w4pFBmc63205IMZWHtgQseODBWP+3saFHD6RRfpDKqWxESMe0sAYvbGpwYS8Ziyyxwo3Coc6guUVbaLlMaXKf4iTaNK3hGf4aQBQMNCoobNFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022514; 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=TQrJR/6dMGOXDTDBtU3yQvNtbCLkiFO0qMnbgwdKuNQ=; b=CtOq6kShI4fVFp/vQ4gdqSjN/4Z7SQa9SxIODkBiG8CHnVBoifTQi41t8JQp7+g9MZ2IfIWBpx4dXjKb+1TMfYnza9l3YT0KtNUjitBL+K2Z3QuQa8hosVVplFjCsQgx08u8OeF8ddgsS908S+DE3FamsAS+CKzB7v5lZPUlkuI= 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 1602022514082136.48902620377874; Tue, 6 Oct 2020 15:15:14 -0700 (PDT) Received: from localhost ([::1]:53688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvEm-00032N-Gx for importer@patchew.org; Tue, 06 Oct 2020 18:15:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9X-0006dH-CD for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9V-0006Nw-6B for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:47 -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-38-mpwyeuacO7OeOVp3ydzRXQ-1; Tue, 06 Oct 2020 18:09:40 -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 3D13B1007472; Tue, 6 Oct 2020 22:09: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 0089B55770; Tue, 6 Oct 2020 22:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022184; 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=TQrJR/6dMGOXDTDBtU3yQvNtbCLkiFO0qMnbgwdKuNQ=; b=SVyrGzXb0L0hf4gIISAneLlzPb+gflk9NL8AkQVFsRYo5ELhOggSszqfxl7A9zSc4DtWJy c0hyCdveu8c3OTqqMHpZq7Z9LUJHJawuCJsHRDMTi9/U933tfBKdY0Ex26uOOXxPb0Ej0K Lg1xQTeGuC/m4GwaJBfDwqSo9PHrKjc= X-MC-Unique: mpwyeuacO7OeOVp3ydzRXQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 02/21] hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr() Date: Tue, 6 Oct 2020 18:09:11 -0400 Message-Id: <20201006220930.908275-3-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 01:55:55 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 080ba319a1..a1190a5db9 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 May 19 01:26:52 2024 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=1602022313; cv=none; d=zohomail.com; s=zohoarc; b=VTG/6nKfk1Rd2alczsMJYuRe8Vr5c8uDLX49/32ah6KZzHKzJ8ni4QkgUKk3zRGPEkpEzkQVcN8pAZsfLeipDkwwRsdBRCD9sU0UUskSBTyAkL/Bfco71vIR5QdpS0z++X7qQy0iy8lrI/1QPVABuqyBMAQtszB9NyIqDCeSKvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022313; 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=Tob52WJXbRQTgBbAGe3gjemoLfoU6QvcwdYp5p4ZS+c=; b=i0PLxXN22ukT4iET7lz61bF4loQvaP+igX50ZjvH1KrSNavXO4QKLX5vdK+2pFBX4AMB41MY8ApbGtbyNMDGsIj51z5aS4MwiL7Q0n2gJkDBSIcTQACQubQ5YCH9rfimghZ2ezJclgnZepEdBmGWm5zCrSujJGnPtWpDYrSBiE4= 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 1602022313457634.5693239659548; Tue, 6 Oct 2020 15:11:53 -0700 (PDT) Received: from localhost ([::1]:46526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvBY-0008TK-5i for importer@patchew.org; Tue, 06 Oct 2020 18:11:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9W-0006aI-2Q for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9U-0006Np-Dz for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09: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-493-EMHPQUpKM6KyZD61LhpHmQ-1; Tue, 06 Oct 2020 18:09:41 -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 6D9A8804015; Tue, 6 Oct 2020 22:09:40 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25ED76115F; Tue, 6 Oct 2020 22:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022183; 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=Tob52WJXbRQTgBbAGe3gjemoLfoU6QvcwdYp5p4ZS+c=; b=KUBiJBYmPek7+Z1SMSJCpO8nC17yLZIj9xz165L8s9DNyZpBvJlkGiLFhVszYytTQcFtKy uChM+PuCHuHn7mr0nVEslWRB36PX01BdbjVzI40d/dzh5dWIpcM9DXWchiLxMv44KDDjCg TAObOPlV9+vQ1dT2fvChOS7wEIxTmvo= X-MC-Unique: EMHPQUpKM6KyZD61LhpHmQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 03/21] hw/core/qdev-properties: Fix code style Date: Tue, 6 Oct 2020 18:09:12 -0400 Message-Id: <20201006220930.908275-4-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 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 a1190a5db9..071fd5864a 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 May 19 01:26:52 2024 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=1602022713; cv=none; d=zohomail.com; s=zohoarc; b=n1JvmtIGvGdLci067sMVeINuMsiPPPzFo8h3hnMA8XQm8Twg2vH883te0qlfDFIlegSGcg5whC9RTJ+a/sM1w4uiHvlnEwkjq1gK/7q1kQBTy6UOtp4RrZ8snfsMxivMQ2Zs77P8aHDiopPBhcECup8dY8Eyxhpq0uwRIW8JFNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022713; 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=pQPKxH+xyKblM5N24NT1ykX8A0kYnSIEW2cQbV0qbko=; b=P2zCTsHqdkdktnPxaVhnyAt3HErmShcB1xZ96WpKK3kbEKzeFZ2wKu8IEVlBIWh4MCmcDFO7Mb1xNd0e58fpk08Gsbygysjx88iLnKGZl2yvRj5u3JX5I5CKqm8uaBcYNvyIblgd24gcMziH/eBH5EzBwSo93ZFl6rEYWt72Az0= 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 16020227130761003.3767219714135; Tue, 6 Oct 2020 15:18:33 -0700 (PDT) Received: from localhost ([::1]:33888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvHz-0006eo-Q1 for importer@patchew.org; Tue, 06 Oct 2020 18:18:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9Y-0006ep-2L for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9V-0006O1-T7 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:47 -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-182-csjWj25vMQesuXSafKVjLA-1; Tue, 06 Oct 2020 18:09:43 -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 D31BD393B4; Tue, 6 Oct 2020 22:09:41 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B9436EF44; Tue, 6 Oct 2020 22:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022185; 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=pQPKxH+xyKblM5N24NT1ykX8A0kYnSIEW2cQbV0qbko=; b=hiyqSu2FFA16PNfoNE9WXPlokq2olb/jUAbWu2/0LFY1itXWvZyGDrwdgXkxLN3mhozZDM gAIseGZ4jv/p7/Jyd6BQbyuOobgRGegCJwlexm5tIbRcjI770T1HQH66wyNuJYifNnMr3K +e7rnfVbNqzOXAVuqWqmhkVdebcGE2o= X-MC-Unique: csjWj25vMQesuXSafKVjLA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 04/21] hw/core/qdev-properties: Export enum-related functions Date: Tue, 6 Oct 2020 18:09:13 -0400 Message-Id: <20201006220930.908275-5-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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 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 0000000000..2a8c9a306a --- /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 071fd5864a..76417d0936 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 May 19 01:26:52 2024 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=1602022316; cv=none; d=zohomail.com; s=zohoarc; b=dtLd3ReZcbTb4u8/Y52Pq2a8EkXIr1is+UbKd66ny+RobAg3dyVC+hjhnV1rAbq2UTZYgwk+W1Y78AMpBUyg+EnYNNOqXIm6mamGJq6/sd3DLEYxtrQKtY78Gg/2X3KmXmEI/uY4NuoqzCi3g4OsfJfw79CKGLM9RoR5n2IfITs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022316; 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=0gJxsvwebiBR0X3LwAWoFDimHE1dHMJfymqECue56co=; b=TqtrcshctYRe/xliBwx/oXLBWUYf+sLtdtWBO/t8BuV7FMv6Pg29vN7m7OQMlYEuRxL/545RpC1+orqq+71MMLKsh9uoKh/cbvu+6k2b/03znF6C1LxxUeVDOn3Vc4hWrVyBpjXvjxhjq9D9gy8Vmnid0M/2Gjxyc8PgOIgzM5A= 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 160202231656196.70556650749324; Tue, 6 Oct 2020 15:11:56 -0700 (PDT) Received: from localhost ([::1]:46844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvBb-00009P-8c for importer@patchew.org; Tue, 06 Oct 2020 18:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9Y-0006gr-TZ for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9W-0006OE-Rb for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:48 -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-542-_BcP59-fOBeKfAzgbdh8CA-1; Tue, 06 Oct 2020 18:09:44 -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 CABCE80400D; Tue, 6 Oct 2020 22:09:42 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9091E6EF44; Tue, 6 Oct 2020 22:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022186; 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=0gJxsvwebiBR0X3LwAWoFDimHE1dHMJfymqECue56co=; b=HiFrj8/bo+ddgqwbn48HP3TdYsIaRN2FjbL5aWXh3ieJo0Yd0qylZ9vDqPXLwrxlpjoO+F nY8iIxdtrusS6cHuoQTtN8rRL+trPVlxjRufmcKYZPWuPYxJAMhLRybppzuOmApSi19yDd 16VrhVP02k3HvMRl0GW5g1dyqbcEWws= X-MC-Unique: _BcP59-fOBeKfAzgbdh8CA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 05/21] hw/core/qdev-properties: Export qdev_prop_enum Date: Tue, 6 Oct 2020 18:09:14 -0400 Message-Id: <20201006220930.908275-6-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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 528310bb22..4437450065 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 76417d0936..31dfe441e2 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 May 19 01:26:52 2024 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=1602022606; cv=none; d=zohomail.com; s=zohoarc; b=EuqUFOB0aFje2KVXYwjAqzwDf2IoEkekJbjbfGgPs65rNO7fP1Oxjn2VHAjqwkqgrLkRJACF51w85Kkteha4vE7sKysX9Lx7H8G6OQwTcEvL+wKhRBhXTxiCf2ZEdVpPGx5ZbfXgXkwmr+DWIKtxIB173eSMzXJJkhQrrjbd+j4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022606; 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=yjvdzkE+xZm75SW25GId3gVQ78ZG6AlqaQK4IFwHnU4=; b=Yl4UiwS7ps28hvS0QKXUvA3FOm6hnS8s7meI9Du1gsHDGY76f8xWZNVdM3WpoSEtSVbzElbr3m0+7DbE8qabikgHC5tkbcIuaeRaxTChUEMl7erfrkGd0r+tM433jqx5FaVTm7ny9TRv1lxvRJBGbT5Hyq9pGbhG3eG8pTe5O3U= 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 1602022606788992.8723958842384; Tue, 6 Oct 2020 15:16:46 -0700 (PDT) Received: from localhost ([::1]:57786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvGG-0004ph-Jo for importer@patchew.org; Tue, 06 Oct 2020 18:16:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9a-0006k7-Bn for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9Y-0006OZ-9e for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:50 -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-354-A_gp8Z0SOkec0uk-cXxJ9A-1; Tue, 06 Oct 2020 18:09:45 -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 E86C6393B1; Tue, 6 Oct 2020 22:09:43 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9C9E610F3; Tue, 6 Oct 2020 22:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022187; 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=yjvdzkE+xZm75SW25GId3gVQ78ZG6AlqaQK4IFwHnU4=; b=hDbZB/g4pMyLtPzaeSXARL9ISX5A4vy0awJG88Fv2za5mZVyGbNxraohpAjc+4ceVmbR87 a0PDe9RJiywz2bzwO5YSZTFt0sa3GbAeRRrskoLnjRkAQjwQ4HwY3+6hGmR6mkqtn43/WC OgnEPYbSAuDXczx7xBFSAP2inyiRpl8= X-MC-Unique: A_gp8Z0SOkec0uk-cXxJ9A-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 06/21] hw/core/qdev-properties: Export some integer-related functions Date: Tue, 6 Oct 2020 18:09:15 -0400 Message-Id: <20201006220930.908275-7-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 01:55:55 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 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 2a8c9a306a..9cf5cc1d51 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 31dfe441e2..37e309077a 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 May 19 01:26:52 2024 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=1602022797; cv=none; d=zohomail.com; s=zohoarc; b=PI1leZxsJrLHOpzt4kfyLonUkreRYWx010UDIaRCC6wY2L1yPu4McEpLFh+DfhRAdvvvAuN7LT7JWNLj0slr8EC/w87unuSJVSXDTS7FIXUSOLQDbWqfyvH0UHIVTqxyAk9IrKaITUFT6cbT4yr23VLX+nMuOgMctevc4UcHbZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022797; 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=I14GSdy/IMSQlkp4atg7Lb0MA+2BVhMkUUIKIeAUFqk=; b=KV0Pg07GD/6iJpuUBMXX4Ec7rcnVbDvhhVEu6xYdHlTTr4q4KtNQbu9DyhafHoYKf4roDc4Ar2H6/ZpSwiDln1GJY74HadL27HmM3yPC7UjfLeUSSdpO0c2Fr6CtCPLOpX3Q5F/OFcZsEuHq6fRXP8SHNsEP22PZeDg6Ga1YZt4= 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 1602022797988286.6990799902437; Tue, 6 Oct 2020 15:19:57 -0700 (PDT) Received: from localhost ([::1]:38224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvJM-0008Rd-GI for importer@patchew.org; Tue, 06 Oct 2020 18:19:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9g-0006vQ-RK for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9Z-0006Ol-Hc for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-vLB2w9bdP4uPQ_WAnuNDwA-1; Tue, 06 Oct 2020 18:09:46 -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 46690186DD28; Tue, 6 Oct 2020 22:09:45 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9E595C1C4; Tue, 6 Oct 2020 22:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022188; 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=I14GSdy/IMSQlkp4atg7Lb0MA+2BVhMkUUIKIeAUFqk=; b=bdvszxR0ynRSY2524i1cwFgx6QLAcuHGO8u24pTBb9yjLQQW/1l7AvWz7BNUobyGaNDOEW C10yN0UdBXopNwNfVNQKvRk7ZhpV6f3931rVXlPnh9ZBYFiEOgBJAV3CY8on+g0smz5vIh 2Zi0zvHhnK/AG+oWHaXXauhnb8F8lG4= X-MC-Unique: vLB2w9bdP4uPQ_WAnuNDwA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 07/21] hw/core/qdev-properties: Extract system-mode specific properties Date: Tue, 6 Oct 2020 18:09:16 -0400 Message-Id: <20201006220930.908275-8-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 01:55:55 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 b29daf4fb5..49bdd12581 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 37e309077a..509cbf155d 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 May 19 01:26:52 2024 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=1602022545; cv=none; d=zohomail.com; s=zohoarc; b=UMboPfr8PZUrp1EomzrYQl+fBOgyUAstRn8tQKSZkB125JWTKUolhC+l5PZcOPlNRNUF5vLB9exubY7zQbOoDzFJHG1FrIgpnk0r5NyNcfUxww2L3XPIxYHhNQuyCl4csnEs+ZOTvD+XczQNAGP6V7GB9HzjRbjhm2+Jit2sKug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022545; 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=YKCkiaBWgmXwTIOi3dm1ldBMIOifsVSdk8OwCSTSmCk=; b=P8vPFWIP9PQ59jNEp5nCz0BMf+UsYdWfFrDFePEnMHf3+8t/ROoWYyUE9pX/4MFoztoXr9XZO+46oe7/gZAjF0Yet3Li6viOCkee14yjMGBHO4CcPSInSdvOYAwud3KjlKGfWlmaGwvdegSJxgqsJIKPf+zKtr+qWRFU3qCgkZY= 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 160202254538866.3660146680786; Tue, 6 Oct 2020 15:15:45 -0700 (PDT) Received: from localhost ([::1]:55240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvFI-0003gF-28 for importer@patchew.org; Tue, 06 Oct 2020 18:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9d-0006sA-Ng for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9c-0006P1-1G for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:53 -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-353-jeenq5M9NkSBuyojzb25ng-1; Tue, 06 Oct 2020 18:09:47 -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 4639C804011; Tue, 6 Oct 2020 22:09:46 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFE0B5D9D2; Tue, 6 Oct 2020 22:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022191; 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=YKCkiaBWgmXwTIOi3dm1ldBMIOifsVSdk8OwCSTSmCk=; b=QeUFxDYYCrSN3AWsG/RJt72l2uI6rDAVTnV3mPOs79y7Z9f/o/jeCfgak4KcY4jFm4I2uC 66W1pgWLH1OPpkKtb0EiVNaPvfKqvmfMG+lY4Wcj/PuCn/wCeVTTHGqo+1UxWd7Cidjk4z JmxPUm7XH6sMnQBZX9WxooLo5gpyfMA= X-MC-Unique: jeenq5M9NkSBuyojzb25ng-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 08/21] hw/core/cpu: Add missing 'exec/cpu-common.h' include Date: Tue, 6 Oct 2020 18:09:17 -0400 Message-Id: <20201006220930.908275-9-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 00:55:20 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 c55c09f734..b06eb38ecc 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 May 19 01:26:52 2024 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=1602022865; cv=none; d=zohomail.com; s=zohoarc; b=F4rJMiU0W7Lb2fVZ8XI/gETaMg8tMZrO3JCntHEdo3m3uZcdQXrg/iBNxzvtKZyCzpBjcBj8Kjk4/oYsxx4F7tn1O5X874IXnOyoFFY0gazQgL0gaMNiz6U7t6VcwRIue0V+WLjcxkSK7X89xdjJO5D+kart3Dl3HLizCJn0aDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022865; 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=msMKr4jy4cvV0aBat9MPAID6/pVxztok8ewRpD09LUY=; b=D8AnAr8AliwU/TjdKNOVETe/HChJ7u4LpV6dRtgio3c9klMnXoiCMa8jscsGWKS1WyVEpWdydzdCfi+BtY7S9URfd30RRRvw71LCPsiVxvYXDAvMMwIgG2QkgxxMVhByyrG4Sab36EXZ1C0rjDVfYNvpQTqzd2BYE6k6jEXE1QI= 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 1602022865208337.1546622809076; Tue, 6 Oct 2020 15:21:05 -0700 (PDT) Received: from localhost ([::1]:41550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvKR-0001Qj-MI for importer@patchew.org; Tue, 06 Oct 2020 18:21:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9d-0006rB-DP for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9b-0006Ow-FI for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:53 -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-102-MdLodyApO9WpkLfuom-Olg-1; Tue, 06 Oct 2020 18:09:48 -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 521BE1091069; Tue, 6 Oct 2020 22:09:47 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04FFB6EF44; Tue, 6 Oct 2020 22:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022190; 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=msMKr4jy4cvV0aBat9MPAID6/pVxztok8ewRpD09LUY=; b=cWXsHGpG4+YvjQtffHD4X312S3Oq/r9In0gZdPPNVbzNJE38Nh2XCxf6gGoTZwRfBgbHBs 6FmxWa4ZINmPo1qCm7WIiuOJesNsQ+urTGuxqaasj1vEulv/3nTliWNQ56FC1GwIO8WHNf 3eI3E3l7wLF2SNX/Fx4IVCSM6mTV+tc= X-MC-Unique: MdLodyApO9WpkLfuom-Olg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 09/21] qom: Improve error message displayed with missing object properties Date: Tue, 6 Oct 2020 18:09:18 -0400 Message-Id: <20201006220930.908275-10-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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 , 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 c335dce7e4..1065355233 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 May 19 01:26:52 2024 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=1602022744; cv=none; d=zohomail.com; s=zohoarc; b=PANI2Q9QrDXZdMLajUPcr+S22Fm64Slq4hTdsyy3yzuKnoxRc0kVEqa4MtKoqXa9fLDy93H2gLnFFhkSG0zQ72VyKli4V/6ffAFr/mIILGuyuOlntIVCHV3Kj0gpVnHOBEEcVmJUjdCi+leXRyGR13BesxyaUqdfIsDb1aX9uP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022744; 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=OsOiiuvqOs2Dd30cGtUozQ7z6HBtUUrHJem2QryIQsk=; b=dAlUqpdWzEnKjgyPrz+sXvrzksEdcbIAd0qTUSz6htu4DsfoTJdadvUdnQRilCJW+ozHA3a8ssNiqNvQWc0nEW8fFGj57Zs27b3aYl7wDG5195s8423dAllnv6E+rXmaJqWA0uYaXQfMBfWR0mz2aFMX5CW4BPdvSOOpzczXSJg= 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 1602022744391662.759131807708; Tue, 6 Oct 2020 15:19:04 -0700 (PDT) Received: from localhost ([::1]:35426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvIV-0007Hp-2a for importer@patchew.org; Tue, 06 Oct 2020 18:19:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9e-0006uX-LX for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9c-0006PO-MC for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:54 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-TFUQ_w45OcK76NjybXH3DA-1; Tue, 06 Oct 2020 18:09:49 -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 6F54180400C; Tue, 6 Oct 2020 22:09:48 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 366299F54; Tue, 6 Oct 2020 22:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022191; 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=OsOiiuvqOs2Dd30cGtUozQ7z6HBtUUrHJem2QryIQsk=; b=WbO+jqhS1A7xsDr6jLI22lD19Je/vOaLoWltNzRfqCWNJe/Zg2QqB8obnphWflqCqahJZC rklklmWXYpw5PNPK1ak4h4P0QYAuyqz9d8QS9U246+I3+TrQPCCx//orHBeskp1+gVEyF5 HByrohu4yXlWGyvB4D9oE8gDQ9q6Y5s= X-MC-Unique: TFUQ_w45OcK76NjybXH3DA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 10/21] qom: Fix DECLARE_*CHECKER documentation Date: Tue, 6 Oct 2020 18:09:19 -0400 Message-Id: <20201006220930.908275-11-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 01:55:55 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 27aaa67e63..de121d8d8e 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 May 19 01:26:52 2024 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=1602022878; cv=none; d=zohomail.com; s=zohoarc; b=fes871iJeT3wuO+Qpa6RulMlBBBv8s0nYnN7LmFnyg7aUiXcrJTopG8cFDnstcNFAyNd8HQXjhRDp3gExOqPIsY2cgz2kbqe01nyZoSzS7lzRrGgbvEy0i+s/3nFYyo0CrjZj7chZJZ2sqjT0+eQm2MhZcOKIGVffwcITPvTruw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022878; 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=6j4I3T1AQxgWNexEUqKVfn14dDoHgmXBvUQWwTTcuq4=; b=kyAZ52mR2gOYXSNRYQScsimeDgq5FKsu+IdG9MHvRqti9tHugz4tTf0MuQzwmYpzaT266gg8VBs9pNb9f4m/yxbwIFVJeu9mJ+LWLcLJY3hr5j7Dvcik27pU9JGVXMh5az/yJluhS6i9bwbgHXz0+x4Hd7NumCuJK02cwQ3vvz4= 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 1602022878385969.7225510695674; Tue, 6 Oct 2020 15:21:18 -0700 (PDT) Received: from localhost ([::1]:42588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvKf-0001sB-5R for importer@patchew.org; Tue, 06 Oct 2020 18:21:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9h-0006vu-0M for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9d-0006Pu-KH for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:09:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-1HVqyq8EM9igAnVVgrSDGQ-1; Tue, 06 Oct 2020 18:09:50 -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 ADD218064B1; Tue, 6 Oct 2020 22:09:49 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70C936EF47; Tue, 6 Oct 2020 22:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022192; 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=6j4I3T1AQxgWNexEUqKVfn14dDoHgmXBvUQWwTTcuq4=; b=G2udnyJ5qc+nJUtR7Os8zr7HwnZG9hFIMhY0afIHjncUuEgjGUAlpNofeF+l90TwLBItnr Zz2BbfAtbM1ru+M5URqsWt+mCt62aYmafsCf7Mh1ZHz7pb243JNXP/CAELMP991KVbHDmG H3rlI174mURBFEnw1urIpcNPdA71hCM= X-MC-Unique: 1HVqyq8EM9igAnVVgrSDGQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 11/21] docs/devel/qom: Fix indentation of bulleted list Date: Tue, 6 Oct 2020 18:09:20 -0400 Message-Id: <20201006220930.908275-12-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 0b943b2a1a..c4857d95c8 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 May 19 01:26:52 2024 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=1602022997; cv=none; d=zohomail.com; s=zohoarc; b=doRiGRDNosGMOrAOF5Z5dOylY/nB3J9lF3b6x28Jb3+Phl+FBGXPKR2l5ZrGBppAdy3Ct8/GAnjZMVmCT6mFXtxsVnDMo9oe1jgvTvCjLWmO3UJhCzBnEIyF7gHl7Z1x06tjFhaVsr86QqJqhfB9HaEWZlcGTTZUKcUCzfen/7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022997; 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=tnsjj9C5RQu2WRx13/fI7VawgK6FrgrAigOLfZASKdU=; b=nA3BCqo2pU2e6VLhY7vEiUm/FOlWNROrdaazX7b3NjdhfWNSdUL/R4gAZ/bC96WGS0I97xji6zeiDkYC4HGJp1JJdptTU0XQbJC/Pc5iSumvAz0tvLkZkZq5m0MFNiyq7+zkAf7rPyItLtRDKcOR+uBRkg1hklSFjep3LIi9Das= 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 1602022997535177.48447781019263; Tue, 6 Oct 2020 15:23:17 -0700 (PDT) Received: from localhost ([::1]:47832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvMa-00041W-3m for importer@patchew.org; Tue, 06 Oct 2020 18:23:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9r-0006xP-LU for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9k-0006QR-2d for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:05 -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-44-lLaNHBF5OlWOMPReeAFICA-1; Tue, 06 Oct 2020 18:09:52 -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 5773B8064DD; Tue, 6 Oct 2020 22:09:51 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AEFF10013BD; Tue, 6 Oct 2020 22:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022196; 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=tnsjj9C5RQu2WRx13/fI7VawgK6FrgrAigOLfZASKdU=; b=X/jqJPfYQfpOvQEhIY0+3Abe2v8BTIDUq5q/9j1G7yW/rw24ZeZu16rEIzpnflecFDDu7s D8Xu+jcs91aPuM0CN6usVPulOXjQ51FI6oYCwU5jm/pmkMGbS10mbgCFoBxwd6ymnAHX2Y KUD+pdsKEiikjBXenktR17fbeECzz5A= X-MC-Unique: lLaNHBF5OlWOMPReeAFICA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 12/21] docs/devel/qom: Fix indentation of code blocks Date: Tue, 6 Oct 2020 18:09:21 -0400 Message-Id: <20201006220930.908275-13-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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 c4857d95c8..a47e1b9a23 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 May 19 01:26:52 2024 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=1602023038; cv=none; d=zohomail.com; s=zohoarc; b=dHGsWO0jA4bYno0XuBE+sK74pCdrX5HQdODQpFoLrfJ225H5t9lYasti6H578i/15nX7Na5lNzXMrGXUUz4ua4nYFsbBjOBPfj8BkiaaAbnyS5XTYXWrdL2hWhHtGlehWf+iDcApYHW/sTLPxN+yW/zipG3Vb1WnQlzMss8P6fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023038; 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=0/DM8LdvkAX3OKo9k6OAPh30L61ayGkkr7+pmXORRKQ=; b=mvI9q9uDmc5BcmXISnOEsP6aGhxb6a1vwZ58Cs/covuBEaZr9Qmw+jCFoZb6ckMYtvY1lxmKKZiIpQUyXeHjsdaC0aAW6+VtwE5S0gK6gGb4aSmYIuG881KYmLAnKcbHT0vl58EjHQpXBPmqFaBYKnOYBfo210Y3iohGnNXVIsU= 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 1602023038919396.16618490547967; Tue, 6 Oct 2020 15:23:58 -0700 (PDT) Received: from localhost ([::1]:48960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvNF-0004Uk-Lq for importer@patchew.org; Tue, 06 Oct 2020 18:23:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9p-0006x9-9G for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9g-0006QK-IH for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:03 -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-505-NUA-zrhyNSG48PNjeFtcRA-1; Tue, 06 Oct 2020 18:09:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CBD180400D; Tue, 6 Oct 2020 22:09:52 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43A8038A; Tue, 6 Oct 2020 22:09:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022195; 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=0/DM8LdvkAX3OKo9k6OAPh30L61ayGkkr7+pmXORRKQ=; b=ReRCt/lz55Ke98ol9aD+3ZtZbaK3SQy4//wyjduMd5lvfgK/+V4XXBd3SG4YWvl5z43ER7 qVs9VddwyjcuYyfyTq5uzaoSsXNhTWvEj3uYqELEfQXBQlI7uIL3ZeoUyZhCN7NpBT1PDP 2QahbfXvFZA0xPqKQWeE5OP/b0FT01M= X-MC-Unique: NUA-zrhyNSG48PNjeFtcRA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 13/21] docs/devel/qom: Use *emphasis* for emphasis Date: Tue, 6 Oct 2020 18:09:22 -0400 Message-Id: <20201006220930.908275-14-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=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/06 00:55:20 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 a47e1b9a23..0c610e20d6 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 May 19 01:26:52 2024 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=1602023190; cv=none; d=zohomail.com; s=zohoarc; b=g7f4RFZdpOBZ573csjv+4MOzrZIKrLsf01jYj1IbSCRRI5xgZPHcr8J81J3720etnEJixU+thw0PhjzxljAcvVRJhL7udlZJBiOVzqUPxSHjIX8F80E1fT0ZnNkpN22+Vt1RE+cd+FwoIgxay4CVnpphj8Ao5ky+a0tetDsBZzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023190; 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=TxzBiWyZbfg1Cf7kyIFDKW2qT3du2mroxbtRPNPBeLQ=; b=bHiBXnMHzR2t1dWTWN66kKMrBJ61dajZq2RqJtDsVMoPfjTaNZCbPsMvdbs3t5fnevRM0OGAbrezp/WIG2T5jE8vKdYu5Vc94yeOCqNmklW+3QTLeSbSB0roRZLRmJE0oZuoorE8W+tYwf8ED3hzXo69LXw5HPvr0CCuhLY1Xio= 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 1602023190812744.1142105333386; Tue, 6 Oct 2020 15:26:30 -0700 (PDT) Received: from localhost ([::1]:55374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvPh-0007Dt-A3 for importer@patchew.org; Tue, 06 Oct 2020 18:26:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9w-0006yu-A6 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9k-0006Qb-DO for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18: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-285-_YMKmGEHMlu6-I5vOGuJRw-1; Tue, 06 Oct 2020 18:09:54 -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 98BB510082E6; Tue, 6 Oct 2020 22:09:53 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C98C76641; Tue, 6 Oct 2020 22:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022197; 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=TxzBiWyZbfg1Cf7kyIFDKW2qT3du2mroxbtRPNPBeLQ=; b=HXET2XzU6TjfHDit1VWjV+UErFMiC1U8v20J6W9BZRQKalrQomAASz1zMKl1VQHC31xdmN q56bSJtY7zdOk429DS3l81uTr0prszzY9zIks0UGJQc9M9noKK7tiYO9nW3xPHXRZLkodA mnx8AoDQ6Zee6Q0cCHKpAa8HRNWXCFg= X-MC-Unique: _YMKmGEHMlu6-I5vOGuJRw-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 14/21] docs/devel/qom: Remove usage of Date: Tue, 6 Oct 2020 18:09:23 -0400 Message-Id: <20201006220930.908275-15-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 de121d8d8e..e80092f349 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 May 19 01:26:52 2024 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=1602022951; cv=none; d=zohomail.com; s=zohoarc; b=Dw1roWAxpL9hic+kX3vGe3GAJmomNoHoBpFcUlJ2nA++l90peB9eRU/bxKoXKHyjLLZR9DtNTZ3a+Wy/ZbO8kZJYf+JH2jOvGSaLx9i9u6Csw7T6+JHxXN2piCqPIgb22TaLqGDSBvW14vkvZ1fe2qrDF5BuKtuppvNaKcoES70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022951; 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=0NiMn8tMJFfC7+1aj5pWZLH/OfpiYwNGWD61hCDLyTs=; b=lfOWnK+144fhHg7fGijrwl/paj0Eocq+RDCvmjj1FMgNHYWA+2INN9HhFPaoxU7hKv8dIJPZfDSQQET4OpzEUoAI/AlkoXSlYiMmnHzmGPXV0G9g54NWEk/r6uyg4WrcuMgb+r5EJaz30lpPkF29FM3HQx+uy7qXerc+H3sNSjw= 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 1602022951085599.1356695266771; Tue, 6 Oct 2020 15:22:31 -0700 (PDT) Received: from localhost ([::1]:45042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvLp-0002tC-Lw for importer@patchew.org; Tue, 06 Oct 2020 18:22:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9u-0006xj-5F for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9m-0006Qh-U4 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:07 -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-456-DIUq7Bt2PQucZ7h8nmNUSA-1; Tue, 06 Oct 2020 18:09:56 -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 A257410082EA; Tue, 6 Oct 2020 22:09:54 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6815755770; Tue, 6 Oct 2020 22:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022198; 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=0NiMn8tMJFfC7+1aj5pWZLH/OfpiYwNGWD61hCDLyTs=; b=Yt9c0XLXBhATpeZ/ywE4OlRCai8f3vnZzQ2xBSInVcT3lClg0vvrNfRDkR9WqFRNkK53Do 0AovbLZoRE2sHGqDtdwKhBI15ksMFlZ0qDH8Fajs1ySrpGtkbP8Pau2Ckf8tC+/Z0j94yn KEUR5tkCFVVD1VyilOTX+OcX3wSfNfg= X-MC-Unique: DIUq7Bt2PQucZ7h8nmNUSA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 15/21] docs/devel/qom: Avoid long lines Date: Tue, 6 Oct 2020 18:09:24 -0400 Message-Id: <20201006220930.908275-16-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 01:55:55 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 0c610e20d6..42d0dc4f4d 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 May 19 01:26:52 2024 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=1602022542; cv=none; d=zohomail.com; s=zohoarc; b=TjKwtd6SGV4SS5lyGIrQoFD1ZFg6Ty3SHUWh1E1ObD4KK7SWMiWBXx4uKsp4vOIffYH9zv0SCMaJrkmJLikf09hn0fdqq6zT7LI0bkRPPPMqS+UJwmS4SU6PZgyGuyY1GfYaGwJ75QUg5P/L2YvEQB7NL+DyiXqIK8+BqSVChts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022542; 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=oPydp3bkYwR6GH+LZESlXGy3MqkTdWCORJFCS9/vfSs=; b=Hhu3pYVh8vFFTDD6sorBcSnV2goE3qtlsKikxZnhNAKczRtCFjkIQiZsDNGYscleb+kXrKJPQbbZqwBI4ZnwSOtHd/7mfZJP1lZfs7pfg5YXeYaM/+tueoYbr0pGffY1qGrqfDohDut/WdPx0tVtPXGwE3JKpJe50yuWJNI3kZU= 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 1602022542641176.79226135826252; Tue, 6 Oct 2020 15:15:42 -0700 (PDT) Received: from localhost ([::1]:55026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvFF-0003b6-Ea for importer@patchew.org; Tue, 06 Oct 2020 18:15:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9x-00072L-OD for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9t-0006R3-Ts for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:13 -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-32-3h1kuw24Pv6iXN1KLTJH0g-1; Tue, 06 Oct 2020 18:09:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD246804018; Tue, 6 Oct 2020 22:09:55 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 840761A835; Tue, 6 Oct 2020 22:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022204; 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=oPydp3bkYwR6GH+LZESlXGy3MqkTdWCORJFCS9/vfSs=; b=Om1Q5cg1P7WEvEYa20BQSqBvo5q6gXMOy3v6PPjGxR8I9J7i6u8RM+HOE2cw9xSZnVUqg+ Pu2d9xpf62TqNiBVNqaimARDzTaKOOaBAo1EM3Hs6ke1bOWiWHrE/oSzHkm/i43IGoDvsi TE3UUPbqnaasPTK4aGdwYjEBW0ZMhic= X-MC-Unique: 3h1kuw24Pv6iXN1KLTJH0g-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 16/21] kernel-doc: Handle function typedefs that return pointers Date: Tue, 6 Oct 2020 18:09:25 -0400 Message-Id: <20201006220930.908275-17-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=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/06 01:55:55 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" 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 40ad782e34..57a4a72970 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 May 19 01:26:52 2024 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=1602022740; cv=none; d=zohomail.com; s=zohoarc; b=HHT1X8NFUvEFHyOx3mYJLkTE0BSDK7WLsVlKS6ykXuUIZ+TO5NA3vkvHTOGNVobnzr0/Sa3246sKQ42XCmqdpeOLhkP7NKNq+rj8w4aZAXmffS221f8QbVArtbCO4EywYacNbngzOtegp8j0Q0mAVVnwt+GU8PYntjM2Sw1rGVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602022740; 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=UYwFN2wkjmvGZMKWCU1JjrjkGzTCLANtS6KjRc+D2pI=; b=FtGNK3IAYSPuecXJ4F4vowaZccXfSuGt2UZEyDoots4aRAlUy2d5LUsAocpKKlkCcv1rLJbZuEvFVwCuUGu+pyegjfCEY/ghJCKPC07zWBdWtn4LN7hatkh31ya7RrlMCiqnO2IWh6cbqnrEaopWZeMLzSKATeCtZPdqQE5VvGQ= 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 1602022740561211.9891245978631; Tue, 6 Oct 2020 15:19:00 -0700 (PDT) Received: from localhost ([::1]:35162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvIR-0007BM-4F for importer@patchew.org; Tue, 06 Oct 2020 18:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9z-00076q-4P for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9t-0006Qs-Tm for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:14 -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-110-hw4yifdOOHu7MkWkiJlXFQ-1; Tue, 06 Oct 2020 18:09:58 -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 836D980400D; Tue, 6 Oct 2020 22:09:57 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42D591002C25; Tue, 6 Oct 2020 22:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022202; 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=UYwFN2wkjmvGZMKWCU1JjrjkGzTCLANtS6KjRc+D2pI=; b=CCmba1nPKVBMYDFVg2CABMofSMgr7LCygdWnMS3bPg2itq3qlh4eh8pwt0iIMBQO4RTw0O zT1mLBS/upzaPI6siM4DEVloJHnlUJTOi8hEK8vNQhHvDGmDDsiujEB8cKWz4ZFk/3TLlq bNKD1U5sfp6TzOGVbED5Nr3F4ZmhJYs= X-MC-Unique: hw4yifdOOHu7MkWkiJlXFQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 17/21] kernel-doc: Handle function typedefs without asterisks Date: Tue, 6 Oct 2020 18:09:26 -0400 Message-Id: <20201006220930.908275-18-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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" 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 57a4a72970..57b911ff17 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 May 19 01:26:52 2024 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=1602023110; cv=none; d=zohomail.com; s=zohoarc; b=EwfXiYIsPHpWSHTM8mapJdCpWyp305eRakrn/FPQhPCzjogSG2ubUVTZCl8gWYIA16SnMrgC3QqAtG+c9+kezlg6zczCHHxqjpYGGF61eafph/OQLK3Myk5klSTRMvUWUzKMXySW8qtwABYhpJzx5bIQEedYSkZZVxMKmy+mz4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023110; 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=33Q2Vi1AhdpNi+URew9hE9hNBXhtoc0//Oh0Xh/8tIo=; b=kGRfWO93PD6h1T+0BOTF8C3kLWgJq8VdQq4ZYXninkVpFIiPzmjTXqshiMxLOBzjlQQ7pLhXgL/dJH0dKKcbTR4+gaiJAsUAT+lrHtByG8TZpRcxoz5FXJL8/E7BD27wMu6vXDIzv6SrdPa92dX4J0uUTIoTyFJAtGPAoPhip5M= 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 1602023110629212.66836512556551; Tue, 6 Oct 2020 15:25:10 -0700 (PDT) Received: from localhost ([::1]:51220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvOP-0005Ra-EB for importer@patchew.org; Tue, 06 Oct 2020 18:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9w-0006yi-8o for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9o-0006Qo-C8 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:09 -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-261-8c4qQTj4OVyUknBhmVpIaQ-1; Tue, 06 Oct 2020 18:09:59 -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 A008B18829D4; Tue, 6 Oct 2020 22:09:58 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62C3E6EF47; Tue, 6 Oct 2020 22:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022202; 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=33Q2Vi1AhdpNi+URew9hE9hNBXhtoc0//Oh0Xh/8tIo=; b=MpxqLW9Z67jsUNVKSwIO/Kj4mES9PWeg59OGOu46bB2PgAKxSb3X4K49xvGONMtvPsI4/i 31bQgM7HvotTtEn1P26SG9nTIsKeFOD1QKzGWJe/UDiO7XE4LbKF/CnT0pB4OzJ9CdR4Wn Cp3jpbyAT6WbmrD6y0njynwdD+jTUvE= X-MC-Unique: 8c4qQTj4OVyUknBhmVpIaQ-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 18/21] qom: Explicitly tag doc comments for typedefs and structs Date: Tue, 6 Oct 2020 18:09:27 -0400 Message-Id: <20201006220930.908275-19-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 e80092f349..d378f13a11 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 May 19 01:26:52 2024 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=1602023382; cv=none; d=zohomail.com; s=zohoarc; b=HngWXORm2moMHs5YyZfqI28yMWe9SC4R3WLg3a8SL1NY2OSQxKGHEtWRS/AAiqw/UzXu+Ctve6Xuaq+BY94Npr76CImk3660b9v534hcajZ6ZowSqcBrKiibHsI4byuSQEvBZvSlkODKUdusF8q3cJcOCeEArdfcSCyFPl5jQtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023382; 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=h4ogneDYBvVq18dZ2y7hPL4IVvfOmaXh9FYWhRrlJag=; b=WyP+5krwwZNd/v1ExHckjb16tLe+MW/ITKyM+5OU2+8+JNaMJ1Vi02uXF4/UIHobTp8XPIwVK+/Y+qRe6Do9tncPzcE7Hmeqvf/54NUalQ4mzdpWsDtAhCc57neV+jzeuR58NC159uDI2QqmiDqvCmlajlUYnD/fU5Bu87eme4Y= 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 1602023382750277.1656462188606; Tue, 6 Oct 2020 15:29:42 -0700 (PDT) Received: from localhost ([::1]:33264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvSn-0001NQ-IC for importer@patchew.org; Tue, 06 Oct 2020 18:29:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9z-00077y-IG for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9v-0006Qv-SD for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18: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-486-z43qWC_RPwi3-kC542yyXg-1; Tue, 06 Oct 2020 18:10:00 -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 BAF4C1091060; Tue, 6 Oct 2020 22:09:59 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EE5010013BD; Tue, 6 Oct 2020 22:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022202; 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=h4ogneDYBvVq18dZ2y7hPL4IVvfOmaXh9FYWhRrlJag=; b=Cl8jtulw2AHaYJrm7fzEDj7+//SC0OFCJQmCbwZnrNH+MfFaCHAmej45AmozH/HPbOskIQ VRHzNjKjhlO1GLBrOp1jlyuMewR2kVIZYvrECJjkdlR5VqLzbfSifgyWbx4GjuF7tWNKtv F7Cm8g+iVZpBzHnNduYrb/tV3NOIVLI= X-MC-Unique: z43qWC_RPwi3-kC542yyXg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 19/21] memory: Explicitly tag doc comments for structs Date: Tue, 6 Oct 2020 18:09:28 -0400 Message-Id: <20201006220930.908275-20-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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=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/06 01:55:55 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 dee0985162..622207bde1 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 May 19 01:26:52 2024 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=1602023161; cv=none; d=zohomail.com; s=zohoarc; b=R4IH0je7rXYxFaWjknMiV08an1PszH+ZJCUNJTeuzys2ChNboY85+FdOzj2NVsEP8ExeG6TwLTx95s31Zhu+/Rt+YuhayCCbn/1mx/U4eH2kzju7omkc5Xg6D5ibxk1EDghmZ2BlbDqqTQUMZn3uxY1lzji10qXQUD27KStDc8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023161; 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=Wabzeqjx4gl9MHSoxV5ky7HBWx939+T9xiX3U/dgbwI=; b=bu8/g4GO5HHVS8JaTNLJEMkYbv48etPMUT38LFfbKNQWrN+EA5Pw+wQCiGdgwrrnI9RdJXVAI89jlEzYlXOMAdrwWtMYTmwjk2QcDCt8ZtR6d3kSEZ2ntEqG1QPIPi8Uxll9rNy0Tw/cWSD2HAVg6JbHbIQ1ZTo0U5QRaWUUImY= 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 1602023161240323.725509458906; Tue, 6 Oct 2020 15:26:01 -0700 (PDT) Received: from localhost ([::1]:54292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvPE-0006nQ-2M for importer@patchew.org; Tue, 06 Oct 2020 18:26:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPvA0-00079O-5S for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9v-0006RA-Qv for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18: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-73-zGoc1BbMMFmmseS-qe6DSA-1; Tue, 06 Oct 2020 18:10:01 -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 B501580400C; Tue, 6 Oct 2020 22:10:00 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 770406EF43; Tue, 6 Oct 2020 22:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022204; 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=Wabzeqjx4gl9MHSoxV5ky7HBWx939+T9xiX3U/dgbwI=; b=XjH0piKSixdASl90jFcQU5OSAp5CAu+g+9z9duDpHhRPA2lJ19Dkcu/ynU6DC9TDk68J09 s+3KfU3rQu3Justtk6DstrGChNimQFGSekqaZKHR3xWf9eJ2UyQV2lB167Vr9Wjf6Y+h5Q z2ioo+umZjbB0dqwg75wUwFVDayLvT0= X-MC-Unique: zGoc1BbMMFmmseS-qe6DSA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 20/21] kernel-doc: Remove $decl_type='type name' hack Date: Tue, 6 Oct 2020 18:09:29 -0400 Message-Id: <20201006220930.908275-21-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-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/06 00:55:20 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 57b911ff17..0ff62bb6a2 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 From nobody Sun May 19 01:26:52 2024 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=1602023262; cv=none; d=zohomail.com; s=zohoarc; b=GP8jlwFesPn7mEYpGxXOfUGGsN8Q9w8+pX5uqrKZWf0UVVxz6E7mmP5oUCgBb50gc6hFVpSCBx4tGZ5lIz/L0LsMpF/GiaHUPWKaXtmJJ5IkJ53N5SpOAeibLvRL4Up4w3u3YaYH9mumpJfkZBGCYCqzojUXPDQtJpr7BozqOks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602023262; 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=adKz+t15Ay7dYk3xI2XJtbX9dWYumdGT/9CD6sJlYlk=; b=OM2L6Wc1Xx41ERnIVkIv+5k+wiSNoAr+YHfXCjKEIIturb6U00jbQqxvpqXLF51zPJluh1ZKzKchGnLgyKvqPJ9YBlu6vYCPW1o/OBW0AMe7V5yPojZANcs2E3ytqFpC6xXIVMo3zXXTyaTRxMmKw28kHZDPIZRZelocwgSalEA= 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 1602023262458701.1431098668596; Tue, 6 Oct 2020 15:27:42 -0700 (PDT) Received: from localhost ([::1]:57606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPvQr-00088i-7A for importer@patchew.org; Tue, 06 Oct 2020 18:27:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPv9y-00074M-6C for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kPv9v-0006RV-Sv for qemu-devel@nongnu.org; Tue, 06 Oct 2020 18:10:13 -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-527-JWsNrgsnNOatUJOe7hCnZw-1; Tue, 06 Oct 2020 18:10:02 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB85310082EC; Tue, 6 Oct 2020 22:10:01 +0000 (UTC) Received: from localhost (ovpn-119-102.rdu2.redhat.com [10.10.119.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88CAE1A835; Tue, 6 Oct 2020 22:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602022207; 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=adKz+t15Ay7dYk3xI2XJtbX9dWYumdGT/9CD6sJlYlk=; b=RXFfSw7HXDs1wFTZzQ9VCPnOv3MkeoViPFR3CQuiz5UnsvYUdE0twmjKjXuiqhi5YzfwOW n87w+I1K2Pr8yB6BgoPx2tJ+QdsXEJ9mci6ETbEU/AJYvVgyeIO+ITIFGzVdCDOkQl8iZG yZTh5NDuhpfDL0lOY9hzZqhuMaG0CHc= X-MC-Unique: JWsNrgsnNOatUJOe7hCnZw-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 21/21] numa: hmat: require parent cache description before the next level one Date: Tue, 6 Oct 2020 18:09:30 -0400 Message-Id: <20201006220930.908275-22-ehabkost@redhat.com> In-Reply-To: <20201006220930.908275-1-ehabkost@redhat.com> References: <20201006220930.908275-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=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/06 00:55:20 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 Signed-off-by: Eduardo Habkost Message-Id: <20201006150002.1601845-1-imammedo@redhat.com> 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 7d5d413001..7c4dd4e68e 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%u 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