From nobody Mon Feb 9 23:14:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1579490705; cv=none; d=zohomail.com; s=zohoarc; b=Poav8hP9Urt4gUzuyvCMxj2So+yTfWah3YOkthZEPwd7YepfiAf79PHdMGBML4zDpAru+u9wsseIKND+EKV97yjRucDOU9lDXSz99qqpGr+i52ul5j9wZ4vELup6RChje6/Tvx94k+jRpLvHElRVU5AsJw9uDBQ+E+mEFmGq7Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579490705; 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=fbD8Br5aMIDioL/8KXQ7sUTdGGQ7TuRzh/XpmDRqt2E=; b=WyzEb6/XvcyIa4aPYLb7Fd3QUGu4BURRBkFjLAZ/MwV4PZJZk1kz6FF+ttVcU7JmhVA0ngacfPEKhPvMHyOcNuIDQKvoOisVLxvULODLtzi34QDq94CXR8T5jEP3lz0fz+IQ+FGpQPtoBg3kHpYaBOkEE8GOTsobxFcjcVwuIBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 157949070508850.63148114979617; Sun, 19 Jan 2020 19:25:05 -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-409-HCqkGvL6MCCLdTSvbdXvWQ-1; Sun, 19 Jan 2020 22:25:01 -0500 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 E8F2B800D5C; Mon, 20 Jan 2020 03:24:54 +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 BCC8060BF7; Mon, 20 Jan 2020 03:24:54 +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 7965E18089D8; Mon, 20 Jan 2020 03:24:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00K3ORDU002385 for ; Sun, 19 Jan 2020 22:24:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2BAC15C299; Mon, 20 Jan 2020 03:24:27 +0000 (UTC) Received: from tilapia.redhat.com (ovpn-121-72.rdu2.redhat.com [10.10.121.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 854FF5C1BB; Mon, 20 Jan 2020 03:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579490703; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fbD8Br5aMIDioL/8KXQ7sUTdGGQ7TuRzh/XpmDRqt2E=; b=VX01Tu/kk01Z8NOrX86Fs6P/1GC9DVfBtx0ooCwEzZcsGKlTba9+y1KX9glXNDtVhWMGNX 8bTe7oLkjwNng1Rm5qMmSmRE+snZ1ACZLkQhj5b0sk1qV4KxA6+LHW61uQIXPyuA+ho7AG XykoL7Ra9XVVBozR3mF6/wFzYr3jptc= From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 02/12] conf: change virDomainVirtioNet*Format() to return void Date: Sun, 19 Jan 2020 22:24:09 -0500 Message-Id: <20200120032419.448310-3-laine@redhat.com> In-Reply-To: <20200120032419.448310-1-laine@redhat.com> References: <20200120032419.448310-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Jens Freimann 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.12 X-MC-Unique: HCqkGvL6MCCLdTSvbdXvWQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" All three of these functions could only return 0 anyway, so just get rid of all the extra red tape. Signed-off-by: Laine Stump Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_conf.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0208d330c3..69e3b7be9a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25317,7 +25317,7 @@ virDomainActualNetDefFormat(virBufferPtr buf, } =20 =20 -static int +static void virDomainVirtioNetGuestOptsFormat(char **outstr, virDomainNetDefPtr def) { @@ -25345,11 +25345,10 @@ virDomainVirtioNetGuestOptsFormat(char **outstr, virBufferTrim(&buf, " ", -1); =20 *outstr =3D virBufferContentAndReset(&buf); - return 0; } =20 =20 -static int +static void virDomainVirtioNetHostOptsFormat(char **outstr, virDomainNetDefPtr def) { @@ -25385,11 +25384,10 @@ virDomainVirtioNetHostOptsFormat(char **outstr, virBufferTrim(&buf, " ", -1); =20 *outstr =3D virBufferContentAndReset(&buf); - return 0; } =20 =20 -static int +static void virDomainVirtioNetDriverFormat(char **outstr, virDomainNetDefPtr def) { @@ -25422,7 +25420,6 @@ virDomainVirtioNetDriverFormat(char **outstr, virDomainVirtioOptionsFormat(&buf, def->virtio); =20 *outstr =3D virBufferContentAndReset(&buf); - return 0; } =20 =20 @@ -25696,15 +25693,13 @@ virDomainNetDefFormat(virBufferPtr buf, virBufferEscapeString(buf, "\n", virDomainNetGetModelString(def)); if (virDomainNetIsVirtioModel(def)) { - int rc =3D 0; g_autofree char *str =3D NULL; g_autofree char *gueststr =3D NULL; g_autofree char *hoststr =3D NULL; =20 - if (virDomainVirtioNetDriverFormat(&str, def) < 0 || - virDomainVirtioNetGuestOptsFormat(&gueststr, def) < 0 || - virDomainVirtioNetHostOptsFormat(&hoststr, def) < 0) - rc =3D -1; + virDomainVirtioNetDriverFormat(&str, def); + virDomainVirtioNetGuestOptsFormat(&gueststr, def); + virDomainVirtioNetHostOptsFormat(&hoststr, def); =20 if (!gueststr && !hoststr) { if (str) @@ -25722,9 +25717,6 @@ virDomainNetDefFormat(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); } - - if (rc < 0) - return -1; } } if (def->backend.tap || def->backend.vhost) { --=20 2.24.1