From nobody Mon Feb 9 01:01:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1573661207; cv=none; d=zoho.com; s=zohoarc; b=CaxN7WASaDpEqdpnGh6NSb8CkR+S8bxL/t08hCM6HatBDM7rkWfRKA6zTDYaGiHM8q3jy+RRmP76ZOkhHagl8cJN+APxDYDIINaj98urAp2P7Kf1Y9uhYUdeFq2I6rRTjXJx7fhXE2bmvK9BfvbqYFc64Nv4lM93py/mQMuxKPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573661207; 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=5/zu04qsLtv/7RZBZAxsubwcYCCr3rGi6EFtJhDo8GM=; b=jrQyCdmEpCD9/PiBsVhO8q2Mr0/sVmalmUkKGfmbF8LYFsuG108KqnpUZIZPI5/ljgt/tUUjVekvfg1sO4Lrfc9Yn4mj1vrzxWTd62G1UzpuJeuuwKPJdkSvRFSgCdQ0gp+hDQLoVSBDJ9oZ3lgMF4wQPtzJ6i1huwI+iIcZZHY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1573661207852637.566829984974; Wed, 13 Nov 2019 08:06:47 -0800 (PST) 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-288-SgDNoHg0PHeq41dy7XqI3w-1; Wed, 13 Nov 2019 11:05:50 -0500 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 EF0A6100F102; Wed, 13 Nov 2019 16:05:40 +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 C4E0666094; Wed, 13 Nov 2019 16:05:40 +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 7FFFA18034EA; Wed, 13 Nov 2019 16:05:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xADG5XHk019847 for ; Wed, 13 Nov 2019 11:05:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5BF0D18381; Wed, 13 Nov 2019 16:05:33 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9CF159 for ; Wed, 13 Nov 2019 16:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573661206; 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=5/zu04qsLtv/7RZBZAxsubwcYCCr3rGi6EFtJhDo8GM=; b=caUuNvOOwx63Vv0BP/b3s/fEGxLO9kjWgw7/7SwwTX16+j/P8wKH2e7B/RQ0lnNQ7ZZhuL 5LZJz3pLaGpoQtm02PuUsbI4qW+80dXypM+fioZvEg/FgfzUmcyR/NlUtXQ0WZ5+itSlJZ M67Vuz7m4WuTY4LXQi7rTBZ7THz3mFI= From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 13 Nov 2019 17:05:19 +0100 Message-Id: <57f278447178a181af770316e6efe20a5426cc6a.1573661034.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] conf: domaincaps: Replace FORMAT_SINGLE macro by a function 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.13 X-MC-Unique: SgDNoHg0PHeq41dy7XqI3w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Introduce qemuDomainCapsFeatureFormatSimple which does exactly the same thing but it's a function. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_capabilities.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f922cb9055..099963dc6a 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -380,14 +380,6 @@ virDomainCapsStringValuesFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); \ } while (0) -#define FORMAT_SINGLE(name, supported) \ - do { \ - if (supported !=3D VIR_TRISTATE_BOOL_ABSENT) { \ - virBufferAsprintf(&buf, "<%s supported=3D'%s'/>\n", name, \ - (supported =3D=3D VIR_TRISTATE_BOOL_YES) ? "yes" : "no= "); \ - } \ - } while (0) - #define ENUM_PROCESS(master, capsEnum, valToStr) \ do { \ virDomainCapsEnumFormat(buf, &master->capsEnum, \ @@ -395,6 +387,19 @@ virDomainCapsStringValuesFormat(virBufferPtr buf, } while (0) +static void +qemuDomainCapsFeatureFormatSimple(virBufferPtr buf, + const char *featurename, + virTristateBool supported) +{ + if (supported =3D=3D VIR_TRISTATE_BOOL_ABSENT) + return; + + virBufferAsprintf(buf, "<%s supported=3D'%s'/>\n", featurename, + virTristateBoolTypeToString(supported)); +} + + static void virDomainCapsLoaderFormat(virBufferPtr buf, const virDomainCapsLoader *loader) @@ -614,7 +619,7 @@ virDomainCapsFormat(const virDomainCaps *caps) if (caps->maxvcpus) virBufferAsprintf(&buf, "\n", caps->maxvcpus); - FORMAT_SINGLE("iothreads", caps->iothreads); + qemuDomainCapsFeatureFormatSimple(&buf, "iothreads", caps->iothreads); virDomainCapsOSFormat(&buf, &caps->os); virDomainCapsCPUFormat(&buf, &caps->cpu); @@ -635,8 +640,8 @@ virDomainCapsFormat(const virDomainCaps *caps) virBufferAdjustIndent(&buf, 2); virDomainCapsFeatureGICFormat(&buf, &caps->gic); - FORMAT_SINGLE("vmcoreinfo", caps->vmcoreinfo); - FORMAT_SINGLE("genid", caps->genid); + qemuDomainCapsFeatureFormatSimple(&buf, "vmcoreinfo", caps->vmcoreinfo= ); + qemuDomainCapsFeatureFormatSimple(&buf, "genid", caps->genid); virDomainCapsFeatureSEVFormat(&buf, caps->sev); virBufferAdjustIndent(&buf, -2); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list