From nobody Mon Feb 9 15:45:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585120431; cv=none; d=zohomail.com; s=zohoarc; b=TLX0s3CDvo3K3KnvL8qojRB6PokUviijmc+gX0BnGy8HD/BDpmRaT91ues1tkiP2MENXF8gl34Fixt01j0Q6PGkSkO9+YtHJCNKIfO9p9LMydM8jKf+sxJr9z4OfNJ+so/vNv8j8EfFr0a6L4KhtKXLqSjwU4iZtx6lumJfYlVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585120431; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=c3XPfJYhkr0duLlirffSgJPFvxmkVhlG+TC6IE6m1D8=; b=XgdnAuJvL2MUU87/Bm4IO1hTiDfFadfmxusXIgiQtTAAK8FuJY/l2+sAehaN8bR53D8jFfoog+2MDGbzJU3O51vUdctu5DFKEHaUtXLVOITwKAr32MU5Z7IxlpNnnJjqNO4cFc8TMnVfHj+/3i8ZpKa4OhZmnQJXkkOurHCnfQQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585120431476683.4722674799293; Wed, 25 Mar 2020 00:13:51 -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-101-hJYHG9-ZMwu4Ta8EYSU2JA-1; Wed, 25 Mar 2020 03:13:47 -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 EF30A189F769; Wed, 25 Mar 2020 07:13: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 AF991953CF; Wed, 25 Mar 2020 07:13: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 3AD68180350B; Wed, 25 Mar 2020 07:13:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02P7CU8r023915 for ; Wed, 25 Mar 2020 03:12:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75BCF108BC7; Wed, 25 Mar 2020 07:12:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E866108BDC for ; Wed, 25 Mar 2020 07:12:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31CD080029B for ; Wed, 25 Mar 2020 07:12:30 +0000 (UTC) Received: from mail-m24147.qiye.163.com (mail-m24147.qiye.163.com [220.194.24.147]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-tqSNgfZUN7q90TUhgDv3dg-1; Wed, 25 Mar 2020 03:12:27 -0400 Received: from localhost.localdomain (unknown [123.232.151.103]) by smtp4 (Coremail) with SMTP id JedpCgD3ftNNBHtey+koAw--.408S29; Wed, 25 Mar 2020 15:12:23 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585120430; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=c3XPfJYhkr0duLlirffSgJPFvxmkVhlG+TC6IE6m1D8=; b=MobV575ihndLp7cRnmVpS/bf8YfO7kvUfXjxQVjsDfgO/TXScWcoUDCRF72foWhOs9UXYs wygDVakpZGEpJuwgldy6TgTLA/Zix1TYuWguqwr1GDQGAzVkSDt+fL8qPIOkGnV+SEAwrQ AeyGbhZm3yNDARxnuBl2m+sD++3auX0= X-MC-Unique: hJYHG9-ZMwu4Ta8EYSU2JA-1 X-MC-Unique: tqSNgfZUN7q90TUhgDv3dg-1 From: Shi Lei To: libvir-list@redhat.com Subject: [RFC 27/29] conf: Apply virNetworkDNSSrvDefFormatBuf(generated) in virNetworkDNSDefFormat Date: Wed, 25 Mar 2020 15:12:07 +0800 Message-Id: <20200325071209.20841-28-shi_lei@massclouds.com> In-Reply-To: <20200325071209.20841-1-shi_lei@massclouds.com> References: <20200325071209.20841-1-shi_lei@massclouds.com> X-CM-TRANSID: JedpCgD3ftNNBHtey+koAw--.408S29 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRBmh7UUUUU X-Originating-IP: [123.232.151.103] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiSxfxT1dqAJv8KgAAsS X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02P7CU8r023915 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: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Shi Lei --- docs/schemas/network.rng | 1 + src/conf/network_conf.c | 20 ++------------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng index 1d7b854..b97510f 100644 --- a/docs/schemas/network.rng +++ b/docs/schemas/network.rng @@ -339,6 +339,7 @@ {"name": "partialOkay", "type": "Bool"} ] }, + "formatfunc": {"output": "src/conf/network_conf"}, "members": [ {"id": "service", "opt": true}, {"id": "protocol", "opt": true} diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index b40ab4d..1e8bfbc 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -1975,24 +1975,8 @@ virNetworkDNSDefFormat(virBufferPtr buf, } =20 for (i =3D 0; i < def->nsrvs; i++) { - if (def->srvs[i].service && def->srvs[i].protocol) { - virBufferEscapeString(buf, "srvs[i].service); - virBufferEscapeString(buf, "protocol=3D'%s'", def->srvs[i].pro= tocol); - - if (def->srvs[i].domain) - virBufferEscapeString(buf, " domain=3D'%s'", def->srvs[i].= domain); - if (def->srvs[i].target) - virBufferEscapeString(buf, " target=3D'%s'", def->srvs[i].= target); - if (def->srvs[i].port) - virBufferAsprintf(buf, " port=3D'%d'", def->srvs[i].port); - if (def->srvs[i].priority) - virBufferAsprintf(buf, " priority=3D'%d'", def->srvs[i].pr= iority); - if (def->srvs[i].weight) - virBufferAsprintf(buf, " weight=3D'%d'", def->srvs[i].weig= ht); - - virBufferAddLit(buf, "/>\n"); - } + if (virNetworkDNSSrvDefFormatBuf(buf, "srv", &def->srvs[i]) < 0) + return -1; } =20 if (def->nhosts) { --=20 2.17.1