From nobody Sun Feb 8 12:37:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589893324; cv=none; d=zohomail.com; s=zohoarc; b=FMwS1EN+B0a8haQyiOEvHO9Rd0UOYwbXkukibYhCkvGARfFiTRf4uvxMimcyBSb8vh9xsNpPkah9qiwY1HwI9w4mr0lveVm+CaxBMrwBZVcn6J6ZpbeHeXA7/mvOn3/HU1Xu2AjvvfA71vDc0PJagdfaqajJg19NXGYGgaruZBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589893324; h=Content-Type:Content-Transfer-Encoding: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=MrBLL4IGPxA97c47827pJZyoYRWQyxiQeUZJxHHLLwE=; b=I98M8UoN09HLOi0w/FFEEwaH91TCKqwKW0VfxUN2UbVAoiiuXkKdMT6YEf+A0Y5pEzD2d53cEMJyLG5m9+AWcoELm++hIVCK+Jw3cEflqg+tKTzWCRnBimaraSrShUY5Ngpg1kIClq+T4alGPPjgm0nWwmZVkRodc6EYhRxrBYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1589893324141981.0110984499718; Tue, 19 May 2020 06:02:04 -0700 (PDT) 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-298-JDr3AqtlMemigaYjYre27A-1; Tue, 19 May 2020 09:01: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 53EFD15C4E; Tue, 19 May 2020 13:01:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF7D66EA26; Tue, 19 May 2020 13:01:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 89DB51800429; Tue, 19 May 2020 13:01:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04JD1Yvw024007 for ; Tue, 19 May 2020 09:01:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCD965D9E2; Tue, 19 May 2020 13:01:34 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id A59D95D9C5; Tue, 19 May 2020 13:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589893322; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MrBLL4IGPxA97c47827pJZyoYRWQyxiQeUZJxHHLLwE=; b=Blgt60yU2HSETyfcKiv2GJHL3nh50gqwGj0zf1rpuO8k998GH5+oktM4L5evj1W7uKr72n NttQ/lcfa1jceg2HAIk0AV/HsXTQuTu+dXGDXWSEvp08I/5l/H18A0OvX7FU4fp7lw8BzZ d+Ul+aTVIO+jppWYrP4yZs080sSbTwE= X-MC-Unique: JDr3AqtlMemigaYjYre27A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] scripts: emit raw enum value in API build description Date: Tue, 19 May 2020 14:01:19 +0100 Message-Id: <20200519130119.2149052-5-berrange@redhat.com> In-Reply-To: <20200519130119.2149052-1-berrange@redhat.com> References: <20200519130119.2149052-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Currently the value for an enum is only emitted if it is a plain string. If the enum is an integer or hex value, or a complex code block, it is omitted from the API build. This fixes that by emitting the raw value if no string value is present. With this change: ...snip... ...snip... Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- scripts/apibuild.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 9faf15a75e..d63489ba62 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -1027,11 +1027,14 @@ class CParser: return token =20 strValue =3D None + rawValue =3D None if len(lst) =3D=3D 1 and lst[0][0] =3D=3D '"' and lst[0][-= 1] =3D=3D '"': strValue =3D lst[0][1:-1] + else: + rawValue =3D " ".join(lst) (args, desc) =3D self.parseMacroComment(name, not self.is_= header) self.index_add(name, self.filename, not self.is_header, - "macro", (args, desc, params, strValue)) + "macro", (args, desc, params, strValue, raw= Value)) return token =20 # @@ -2178,13 +2181,16 @@ class docBuilder: desc =3D None params =3D None strValue =3D None + rawValue =3D None else: - (args, desc, params, strValue) =3D id.info + (args, desc, params, strValue, rawValue) =3D id.info =20 if params is not None: output.write(" params=3D'%s'" % params) if strValue is not None: output.write(" string=3D'%s'" % strValue) + else: + output.write(" raw=3D'%s'" % rawValue) output.write(">\n") =20 if desc is not None and desc !=3D "": --=20 2.26.2