From nobody Mon Feb 9 01:22:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1642433390; cv=none; d=zohomail.com; s=zohoarc; b=gt3Io4XxAS64jq5YkCTqLC9FA8FiMGoRrE2RpHUJJ5eFHRf0bYfNpPXEtktGVuivIcEvFIqW4nchjDWxVistoe+i+NyV2u6TV5uX914yOdsmD/vTnddQSxAueOi30CqkK1BzwgyxeuyqHJXAWQzFnjUYs2Ao/o/Eqhg0/KYI6FA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642433390; 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=Z8NZkCcLFOMXonzuit7JaROLi7/XYTqtTiGXD88eqT21jvhA764Dox3CdvE6VJ6JZf6+hdq+qAW7e+xn8Z3RNzt/NHYsex5zqAL7PBdPedQX0Q1p60XpZQFdewz5fjDvPnNU02S5HqkPP78TBkMpzZ/9S1e/oOZ5rVXQVDlz/Tg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 16424333906299.13003983151691; Mon, 17 Jan 2022 07:29:50 -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-447-e3LxfstkPWKN9dv-iVKMNw-1; Mon, 17 Jan 2022 10:24:55 -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 7DE8019324A5; Mon, 17 Jan 2022 15:24:39 +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 324E87D5B4; Mon, 17 Jan 2022 15:24:39 +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 C44AF1806D1C; Mon, 17 Jan 2022 15:24:38 +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 20HFJeam031589 for ; Mon, 17 Jan 2022 10:19:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 094CC26576; Mon, 17 Jan 2022 15:19:40 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 848DE2B5A5 for ; Mon, 17 Jan 2022 15:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642433389; 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=BIj21w2vj0H6Ms3yog9J/xGzJdNxPKDy2EnIErGXbF6DUECi2weAnEPWw9gNbPk4yrh6tT Z06ng7bBeEZ6vuA6/oqBg/fjUEwbaOofwVbsfXLXBs/2UoRnJrV2lXNZ7aDOkZmj1OIBg9 FEsCpmSTz7WklH41zzavEApGH37AQ8c= X-MC-Unique: e3LxfstkPWKN9dv-iVKMNw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v4 13/13] virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary() Date: Mon, 17 Jan 2022 16:19:27 +0100 Message-Id: <83dd7a90b5daa42b28fabf50fd516eaa0d33eba1.1642432611.git.mprivozn@redhat.com> 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: 1642433392455100001 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