From nobody Mon Feb 9 06:59:50 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614957821; cv=none; d=zohomail.com; s=zohoarc; b=as3GPjCxombIMsvgAe0mKPCDNF/ne3oXgTbylHxn86AWfqlwyXk3X0buKGsfSASKvnjQv8pGljQK7qLYvKg66PG0juDeFdw8H8NL7rtpI4lG0mX4pbj1Osfd0HYKQ7Y2HqH4E22nsx7C0WhLtDYZnl2jiK6YxVcpjgwKsJ6ZRRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614957821; 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=KwUITLh7DanxHf2ZXN5CFzcBLbQSQkaevZRh+6hWBrU=; b=Nj4MYS0fbGogxVvpxfd0cH0zMULrbCG5kIJvbi3qcqAdnd1r422olahW2cxoPyvBsT/QFX0kWww3S6SReYw/0GJM5vndUSSFwyCqFk+tb4HpD8A3yxHcxh7+GoGBwqOADNTagNn8J3u7ypR2XhuSx9RnBek4JJjGWhWvj07fcp8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614957821897730.7948826232874; Fri, 5 Mar 2021 07:23:41 -0800 (PST) Received: from localhost ([::1]:52856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICIm-0007y4-Oo for importer@patchew.org; Fri, 05 Mar 2021 10:23:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIC7S-0000Nj-Nb for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lIC7P-0000Yj-IG for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:58 -0500 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-129-V09vM242NQelZ6H4Ha5dHA-1; Fri, 05 Mar 2021 10:11:46 -0500 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 66471E4963; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CC705D6B1; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 870B91132C13; Fri, 5 Mar 2021 16:11:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957111; 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=KwUITLh7DanxHf2ZXN5CFzcBLbQSQkaevZRh+6hWBrU=; b=gbXFk4ZWkH/QQ1j1nxjsePAo7JWvWvW72zAUwMeiQLNtyX1vOxy7V+C1MO3CK/maZsIPBP WFb95i+G/Gi6m+ndUzlEXwoJopNFAseHCMMYI1BYadnbTCNO7NROnlZn8Wx2wjBx/l0p/d DZHNGoopclWdLwlkxsTVTgAje3XCOBA= X-MC-Unique: V09vM242NQelZ6H4Ha5dHA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 1/4] error: Fix "Converting to ERRP_GUARD()" doc on "valid at return" Date: Fri, 5 Mar 2021 16:11:40 +0100 Message-Id: <20210305151143.741181-2-armbru@redhat.com> In-Reply-To: <20210305151143.741181-1-armbru@redhat.com> References: <20210305151143.741181-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Setting errp =3D NULL is wrong: the automatic error propagation still propagates the dangling pointer _auto_errp_prop.local_err. We need to set *errp =3D NULL to clear the dangling pointer. Signed-off-by: Markus Armbruster Message-Id: <20210125132635.1253219-1-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/error.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qapi/error.h b/include/qapi/error.h index eaa05c4837..4a9260b0cc 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -235,7 +235,7 @@ * error_propagate_prepend(errp, *errp, ...) by error_prepend(errp, ...) * * 4. Ensure @errp is valid at return: when you destroy *errp, set - * errp =3D NULL. + * *errp =3D NULL. * * Example: * --=20 2.26.2 From nobody Mon Feb 9 06:59:50 2026 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=1614958460; cv=none; d=zohomail.com; s=zohoarc; b=An+MCplw8YrK9nhmbcnwHeWiGRXrbtGrTFRLO+DBW24KOW2Qbher943Ak2F3Uw/+VWFKSoMSu8VHekW7nYrtCxIYamwFeMRmygGXU9fp8Rt6kDLMh70mWkdupgapHqCcV32DyPvgf/QLepoWu3M7duNSzlJQxSCnGaPWvEtmUv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614958460; 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=Vn9sBDpZiB6mi4qRLuN+t1wlAzmgPPRwityf4InaUSA=; b=FbwsiRYoEe5pRVJufd+MktOyFAEV/GcKjpLuxQTyxOnLQj7Mbp0hFrBZqt+ojPVTTMetzCei7n1Jc20XlHBj5r9sHIu5aAMrBl4Bodpgn7JQ2Ym5iIDdMydTBT4bdOHdLzG/P1orHzOHFIMxE1rIvyvQGCA2gN0lPPL56vqB7+U= 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 1614958460562587.4274726213717; Fri, 5 Mar 2021 07:34:20 -0800 (PST) Received: from localhost ([::1]:60930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICT5-0006Tt-Dn for importer@patchew.org; Fri, 05 Mar 2021 10:34:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIC7R-0000LZ-1u for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lIC7K-0000YQ-3i for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:56 -0500 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-566-1Ro8zbXDN3K03xrM4nijLg-1; Fri, 05 Mar 2021 10:11:47 -0500 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 61EC21005D45; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D76D100E114; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8A1AF1132C14; Fri, 5 Mar 2021 16:11:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957109; 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=Vn9sBDpZiB6mi4qRLuN+t1wlAzmgPPRwityf4InaUSA=; b=LeQpVSuazoFdCQq7s5AAeUy9gML1LeDdSxRi3OW4CjHfN1B0Z+u9Ek5qRi5tcoXEpQ1kkn kVfD5yNbWASzh2Mx+0kgWJFmnaftUGUDnj3x/wpja/bb5+3jRgnQRstCVJ3GDErSL+Kpew hlah0SN3bM9pDEgMN+0mWzBGPfOoVUM= X-MC-Unique: 1Ro8zbXDN3K03xrM4nijLg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 2/4] qga: Utilize QAPI_LIST_APPEND in qmp_guest_network_get_interfaces Date: Fri, 5 Mar 2021 16:11:41 +0100 Message-Id: <20210305151143.741181-3-armbru@redhat.com> In-Reply-To: <20210305151143.741181-1-armbru@redhat.com> References: <20210305151143.741181-1-armbru@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=armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: peter.maydell@linaro.org 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: Eric Blake I found another spot that can benefit from using our macros instead of open-coding qapi list creation. Signed-off-by: Eric Blake Message-Id: <20210205171634.1491258-1-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qga/commands-posix.c | 75 ++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 8dd94a3314..3f18df1bb6 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -2153,17 +2153,17 @@ void qmp_guest_suspend_hybrid(Error **errp) guest_suspend(SUSPEND_MODE_HYBRID, errp); } =20 -static GuestNetworkInterfaceList * +static GuestNetworkInterface * guest_find_interface(GuestNetworkInterfaceList *head, const char *name) { for (; head; head =3D head->next) { if (strcmp(head->value->name, name) =3D=3D 0) { - break; + return head->value; } } =20 - return head; + return NULL; } =20 static int guest_get_network_stats(const char *name, @@ -2232,7 +2232,7 @@ static int guest_get_network_stats(const char *name, */ GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp) { - GuestNetworkInterfaceList *head =3D NULL, *cur_item =3D NULL; + GuestNetworkInterfaceList *head =3D NULL, **tail =3D &head; struct ifaddrs *ifap, *ifa; =20 if (getifaddrs(&ifap) < 0) { @@ -2241,9 +2241,10 @@ GuestNetworkInterfaceList *qmp_guest_network_get_int= erfaces(Error **errp) } =20 for (ifa =3D ifap; ifa; ifa =3D ifa->ifa_next) { - GuestNetworkInterfaceList *info; - GuestIpAddressList **address_list =3D NULL, *address_item =3D NULL; - GuestNetworkInterfaceStat *interface_stat =3D NULL; + GuestNetworkInterface *info; + GuestIpAddressList **address_tail; + GuestIpAddress *address_item =3D NULL; + GuestNetworkInterfaceStat *interface_stat =3D NULL; char addr4[INET_ADDRSTRLEN]; char addr6[INET6_ADDRSTRLEN]; int sock; @@ -2257,19 +2258,12 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) =20 if (!info) { info =3D g_malloc0(sizeof(*info)); - info->value =3D g_malloc0(sizeof(*info->value)); - info->value->name =3D g_strdup(ifa->ifa_name); + info->name =3D g_strdup(ifa->ifa_name); =20 - if (!cur_item) { - head =3D cur_item =3D info; - } else { - cur_item->next =3D info; - cur_item =3D info; - } + QAPI_LIST_APPEND(tail, info); } =20 - if (!info->value->has_hardware_address && - ifa->ifa_flags & SIOCGIFHWADDR) { + if (!info->has_hardware_address && ifa->ifa_flags & SIOCGIFHWADDR)= { /* we haven't obtained HW address yet */ sock =3D socket(PF_INET, SOCK_STREAM, 0); if (sock =3D=3D -1) { @@ -2278,7 +2272,7 @@ GuestNetworkInterfaceList *qmp_guest_network_get_inte= rfaces(Error **errp) } =20 memset(&ifr, 0, sizeof(ifr)); - pstrcpy(ifr.ifr_name, IF_NAMESIZE, info->value->name); + pstrcpy(ifr.ifr_name, IF_NAMESIZE, info->name); if (ioctl(sock, SIOCGIFHWADDR, &ifr) =3D=3D -1) { error_setg_errno(errp, errno, "failed to get MAC address of %s", @@ -2290,13 +2284,13 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) close(sock); mac_addr =3D (unsigned char *) &ifr.ifr_hwaddr.sa_data; =20 - info->value->hardware_address =3D + info->hardware_address =3D g_strdup_printf("%02x:%02x:%02x:%02x:%02x:%02x", (int) mac_addr[0], (int) mac_addr[1], (int) mac_addr[2], (int) mac_addr[3], (int) mac_addr[4], (int) mac_addr[5]); =20 - info->value->has_hardware_address =3D true; + info->has_hardware_address =3D true; } =20 if (ifa->ifa_addr && @@ -2309,15 +2303,14 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) } =20 address_item =3D g_malloc0(sizeof(*address_item)); - address_item->value =3D g_malloc0(sizeof(*address_item->value)= ); - address_item->value->ip_address =3D g_strdup(addr4); - address_item->value->ip_address_type =3D GUEST_IP_ADDRESS_TYPE= _IPV4; + address_item->ip_address =3D g_strdup(addr4); + address_item->ip_address_type =3D GUEST_IP_ADDRESS_TYPE_IPV4; =20 if (ifa->ifa_netmask) { /* Count the number of set bits in netmask. * This is safe as '1' and '0' cannot be shuffled in netma= sk. */ p =3D &((struct sockaddr_in *)ifa->ifa_netmask)->sin_addr; - address_item->value->prefix =3D ctpop32(((uint32_t *) p)[0= ]); + address_item->prefix =3D ctpop32(((uint32_t *) p)[0]); } } else if (ifa->ifa_addr && ifa->ifa_addr->sa_family =3D=3D AF_INET6) { @@ -2329,15 +2322,14 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) } =20 address_item =3D g_malloc0(sizeof(*address_item)); - address_item->value =3D g_malloc0(sizeof(*address_item->value)= ); - address_item->value->ip_address =3D g_strdup(addr6); - address_item->value->ip_address_type =3D GUEST_IP_ADDRESS_TYPE= _IPV6; + address_item->ip_address =3D g_strdup(addr6); + address_item->ip_address_type =3D GUEST_IP_ADDRESS_TYPE_IPV6; =20 if (ifa->ifa_netmask) { /* Count the number of set bits in netmask. * This is safe as '1' and '0' cannot be shuffled in netma= sk. */ p =3D &((struct sockaddr_in6 *)ifa->ifa_netmask)->sin6_add= r; - address_item->value->prefix =3D + address_item->prefix =3D ctpop32(((uint32_t *) p)[0]) + ctpop32(((uint32_t *) p)[1]) + ctpop32(((uint32_t *) p)[2]) + @@ -2349,29 +2341,22 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) continue; } =20 - address_list =3D &info->value->ip_addresses; - - while (*address_list && (*address_list)->next) { - address_list =3D &(*address_list)->next; + address_tail =3D &info->ip_addresses; + while (*address_tail) { + address_tail =3D &(*address_tail)->next; } + QAPI_LIST_APPEND(address_tail, address_item); =20 - if (!*address_list) { - *address_list =3D address_item; - } else { - (*address_list)->next =3D address_item; - } + info->has_ip_addresses =3D true; =20 - info->value->has_ip_addresses =3D true; - - if (!info->value->has_statistics) { + if (!info->has_statistics) { interface_stat =3D g_malloc0(sizeof(*interface_stat)); - if (guest_get_network_stats(info->value->name, - interface_stat) =3D=3D -1) { - info->value->has_statistics =3D false; + if (guest_get_network_stats(info->name, interface_stat) =3D=3D= -1) { + info->has_statistics =3D false; g_free(interface_stat); } else { - info->value->statistics =3D interface_stat; - info->value->has_statistics =3D true; + info->statistics =3D interface_stat; + info->has_statistics =3D true; } } } --=20 2.26.2 From nobody Mon Feb 9 06:59:50 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614957915; cv=none; d=zohomail.com; s=zohoarc; b=LEvA7Wh0xPRdFleBxlMIzSVlZ0gM2hqtaxFKf9TdLTaqmquwzKa5M26hf4PXx5BAol3Ez0JKr+m28XH2TTrjv6/0F3MuCNxw10fgLRrhBGkjwPkt096Rc1ie5l6toUGbIWhjulUhE5rPFUAln3dNGDsOoKcNHQG8f5/usWVvPFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614957915; 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=Z4ULXyEp5tV+JRrFBklGVGN4Ny53XdvyHZfUVKFwFI0=; b=VKS71FT8bHM3bLEGtFCMDQcROU/0dimRj5XYPHGGdVThCGoNHIFV3WOqRhx4VGHxQxz1kcS6uTN7OgQQ0UP5v83Wy4ScXJjMs0l1JFhmXdIvtLogPEtoqEz9WHbIqNfGwC+kyHsnnZD/XkYlx8LhYcKbqZGyAj0++n47mZJMc7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614957915282413.29065339059844; Fri, 5 Mar 2021 07:25:15 -0800 (PST) Received: from localhost ([::1]:59150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICKI-0002Fj-0i for importer@patchew.org; Fri, 05 Mar 2021 10:25:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIC7Q-0000Ji-Ea for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lIC7K-0000YO-35 for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:56 -0500 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-250-3AawvJjmP_-T3vci8-UbGA-1; Fri, 05 Mar 2021 10:11:47 -0500 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 584A2E4962; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CCE35D6DC; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8D8061131C01; Fri, 5 Mar 2021 16:11:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957109; 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=Z4ULXyEp5tV+JRrFBklGVGN4Ny53XdvyHZfUVKFwFI0=; b=FCN0sEvD3rKA91FlfA6EeyNkDQLkLBJeQcaod9HgqBebLpXDrXaYvxTNbt4g73uWP5sA+7 SxvdqWqth+3Gb0CzK3Ox0xPcsDSg9n5Ft55s6mvDqX0Di3dJh+Lpu+VBtX3c40nbtmB9+3 jF6rS2vFMbuvzj8AgrwXr+AeCZrpxzQ= X-MC-Unique: 3AawvJjmP_-T3vci8-UbGA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 3/4] qapi: Remove QMP events and commands from user-mode builds Date: Fri, 5 Mar 2021 16:11:42 +0100 Message-Id: <20210305151143.741181-4-armbru@redhat.com> In-Reply-To: <20210305151143.741181-1-armbru@redhat.com> References: <20210305151143.741181-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: peter.maydell@linaro.org, =?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: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 We removed the QMP loop in user-mode builds in commit 1935e0e4e09 ("qapi/meson: Remove QMP from user-mode emulation"), now commands and events code is unreachable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210224171642.3242293-1-philmd@redhat.com> Acked-by: Paolo Bonzini Signed-off-by: Markus Armbruster --- qapi/meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qapi/meson.build b/qapi/meson.build index 0652569bc4..fcb15a78f1 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -102,11 +102,15 @@ foreach module : qapi_all_modules 'qapi-types-@0@.h'.format(module), 'qapi-visit-@0@.c'.format(module), 'qapi-visit-@0@.h'.format(module), - 'qapi-events-@0@.c'.format(module), - 'qapi-events-@0@.h'.format(module), - 'qapi-commands-@0@.c'.format(module), - 'qapi-commands-@0@.h'.format(module), ] + if have_system or have_tools + qapi_module_outputs +=3D [ + 'qapi-events-@0@.c'.format(module), + 'qapi-events-@0@.h'.format(module), + 'qapi-commands-@0@.c'.format(module), + 'qapi-commands-@0@.h'.format(module), + ] + endif if module.endswith('-target') qapi_specific_outputs +=3D qapi_module_outputs else --=20 2.26.2 From nobody Mon Feb 9 06:59:50 2026 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=1614957717; cv=none; d=zohomail.com; s=zohoarc; b=bSaOOvsJ4gyLAJLQ+5F6OfxXun7aKu0Ac2v+jO78Pl2n2B/sqVmJYBZ/gaoSmIEJHYnu6OaJZmzavUuMWiXl3HByuKan5KkzHoHngg/ggQV5t1PxNsQ/f+02BUa5nR3bFEam+usVd2FTtdYLD48Xk0zspvESzT2bJygRe6oSObY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614957717; 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=pjqVoLn2Kp31wT8P+UKELG1yEY+VGQv+opU+hLJzeXM=; b=h7jhfiYthbz+KzHUfKu4Fm58Yp4dVs0fQGeDVt1I5LorWnsTHA8Cc8NVQO00EVfGD0YHRLiSgZCqzOmjgFES2Z2Rpa/ztajo3V9m0Bt1tPHqUKBV0oLu0QPyvUx8psjg+SXhqtZzxp2EoiyEgyX6VehlO0TMFEIt6e/bgLfQG7g= 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 1614957717586427.23885999889615; Fri, 5 Mar 2021 07:21:57 -0800 (PST) Received: from localhost ([::1]:44356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICH4-0004VL-HE for importer@patchew.org; Fri, 05 Mar 2021 10:21:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIC7R-0000Lg-4O for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lIC7J-0000Xn-Qk for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:11:56 -0500 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-250-n-yz70HyPdigceF5D5kkyA-1; Fri, 05 Mar 2021 10:11:46 -0500 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 3B68110866A3; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CD455D71D; Fri, 5 Mar 2021 15:11:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 90B7A1141CBD; Fri, 5 Mar 2021 16:11:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957108; 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=pjqVoLn2Kp31wT8P+UKELG1yEY+VGQv+opU+hLJzeXM=; b=i5aw5jfuJ1A7+3XlztFlierE3fu9Gv8Z/dYAyHcgC3aIZS2z1NcU3UA71Bs8q5VZ1/z14G N8Q0YBrh8DBGDLyFplmXueKXeHRzIqjCRAmBN+IIIPMxZZpQzZp9hRo5FQlByaGS67acQt iNClIJtsQmVHj7qTXPpdC3Vf37/O2/I= X-MC-Unique: n-yz70HyPdigceF5D5kkyA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 4/4] qapi: Fix parse errors for removal of null from schema language Date: Fri, 5 Mar 2021 16:11:43 +0100 Message-Id: <20210305151143.741181-5-armbru@redhat.com> In-Reply-To: <20210305151143.741181-1-armbru@redhat.com> References: <20210305151143.741181-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: John Snow , peter.maydell@linaro.org 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" Commit 9d55380b5a "qapi: Remove null from schema language" (v4.2.0) neglected to update two error messages. Do that now. Signed-off-by: Markus Armbruster Message-Id: <20210224101442.1837475-1-armbru@redhat.com> Reviewed-by: Eric Blake Reviewed-by: John Snow --- scripts/qapi/parser.py | 8 ++++---- tests/qapi-schema/leading-comma-list.err | 2 +- tests/qapi-schema/trailing-comma-list.err | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index e7b9d670ad..116afe549a 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -236,9 +236,9 @@ def get_values(self): if self.tok =3D=3D ']': self.accept() return expr - if self.tok not in "{['tfn": + if self.tok not in "{['tf": raise QAPIParseError( - self, "expected '{', '[', ']', string, boolean or 'null'") + self, "expected '{', '[', ']', string, or boolean") while True: expr.append(self.get_expr(True)) if self.tok =3D=3D ']': @@ -257,12 +257,12 @@ def get_expr(self, nested): elif self.tok =3D=3D '[': self.accept() expr =3D self.get_values() - elif self.tok in "'tfn": + elif self.tok in "'tf": expr =3D self.val self.accept() else: raise QAPIParseError( - self, "expected '{', '[', string, boolean or 'null'") + self, "expected '{', '[', string, or boolean") return expr =20 def get_doc(self, info): diff --git a/tests/qapi-schema/leading-comma-list.err b/tests/qapi-schema/l= eading-comma-list.err index 76eed2b5b3..0725d6529f 100644 --- a/tests/qapi-schema/leading-comma-list.err +++ b/tests/qapi-schema/leading-comma-list.err @@ -1 +1 @@ -leading-comma-list.json:2:13: expected '{', '[', ']', string, boolean or '= null' +leading-comma-list.json:2:13: expected '{', '[', ']', string, or boolean diff --git a/tests/qapi-schema/trailing-comma-list.err b/tests/qapi-schema/= trailing-comma-list.err index ad2f2d7c97..bb5f8c3c90 100644 --- a/tests/qapi-schema/trailing-comma-list.err +++ b/tests/qapi-schema/trailing-comma-list.err @@ -1 +1 @@ -trailing-comma-list.json:2:36: expected '{', '[', string, boolean or 'null' +trailing-comma-list.json:2:36: expected '{', '[', string, or boolean --=20 2.26.2