From nobody Sat Feb 7 06:45:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1642516801; cv=none; d=zohomail.com; s=zohoarc; b=iNTX7CCm88utcXwswtSS1hNn9eFQ+cB0Nc/hDsTYnhEVFoY+NAU+rh9fXGf5jP9VJO8hiFs7ZCCD8c2fmIAe9b0XbPWcyw/wVyVVrQwr9nfFeYVIOuN2Khlyi20lVOw5amUkbBAlL/+VGCLO5bnXVtbkxbHZHwsv1aY4xtWa+4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642516801; 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=9F1Jp8sJDVHx1WRg+qj/oZoRwHVHFX+cDlKZcSF4upo=; b=I7/BIPnmT2K391OexDlfBa7t6n/3Cc8+DpXbCAJQfTbVGnt/fx1Du3oR0dNT82BL9Du0oTp8FdkNbwIKWineOj29lvm9qH9/n/s5mxRZI8svhYdfLTiu67bgCJg1vaNPJU5KLZjwITlzEqzcCrcFI2XJQzX7iDksXyd87AjIHNw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642516801616798.0843089006659; Tue, 18 Jan 2022 06:40:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-531-CGVb_nPyPnSU8f3DnhcyWQ-1; Tue, 18 Jan 2022 09:39:56 -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 48D3B760CD; Tue, 18 Jan 2022 14:39:50 +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 295F17E90C; Tue, 18 Jan 2022 14:39:50 +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 E4D681806D2F; Tue, 18 Jan 2022 14:39:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20IEbo6A016748 for ; Tue, 18 Jan 2022 09:37:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 10F422BE77; Tue, 18 Jan 2022 14:37:50 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F13C2BE75 for ; Tue, 18 Jan 2022 14:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642516800; 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=9F1Jp8sJDVHx1WRg+qj/oZoRwHVHFX+cDlKZcSF4upo=; b=cLsdyLjisCKpKgyRKjZlhgQxMhI/iKnnivVRESkJiJkXttMhgdbC712NxFVwHOdWg4kDMI 28EfkeRA1i5GC2tMAWm7PBUcBPqci1ikGUCsXCrJCyKhEcAVxqYcqYHGtDXDQuxBHoA4u4 S+fAkOb8RWpR5ovQM1bzLdWeOl/pJwQ= X-MC-Unique: CGVb_nPyPnSU8f3DnhcyWQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v5 13/13] virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary() Date: Tue, 18 Jan 2022 15:37:20 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642516803459100001 Content-Type: text/plain; charset="utf-8" After previous cleanups, there's just one caller of dnsmasqCapsNewEmpty() and it is dnsmasqCapsNewFromBinary(). And the former is pretty short. Therefore, it is not necessary for the code to live in two separate functions. Dissolve the former in the latter. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/util/virdnsmasq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index f5029d2fdc..57b24c9f6a 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -661,13 +661,14 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps) return dnsmasqCapsSetFromBuffer(caps, version); } =20 -static dnsmasqCaps * -dnsmasqCapsNewEmpty(void) +dnsmasqCaps * +dnsmasqCapsNewFromBinary(void) { g_autoptr(dnsmasqCaps) caps =3D NULL; =20 if (dnsmasqCapsInitialize() < 0) return NULL; + if (!(caps =3D virObjectNew(dnsmasqCapsClass))) return NULL; =20 @@ -677,17 +678,6 @@ dnsmasqCapsNewEmpty(void) return NULL; } =20 - return g_steal_pointer(&caps); -} - -dnsmasqCaps * -dnsmasqCapsNewFromBinary(void) -{ - g_autoptr(dnsmasqCaps) caps =3D dnsmasqCapsNewEmpty(); - - if (!caps) - return NULL; - if (dnsmasqCapsRefreshInternal(caps) < 0) return NULL; =20 --=20 2.34.1