From nobody Mon Feb 9 00:55:57 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=1642433081; cv=none; d=zohomail.com; s=zohoarc; b=Ajo7F/xSWXxdyieZ1qzZOLM9Bq7qUGLFc4Ik//8HrjWjQFucgolVRS9YqB0oDIskJ+SUl19Q4f9GmFI2foti4DKEbH4wgOnjKBd0eaoyKpBCP9QpwfDoq5TnIgflXof3GvoruFQDOBZxkuFieDEneJHr8ZBOci6jlYZRmh45vhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642433081; 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=la9A23M/vy5zDfY2Wqe3A1xzZ14A17Q/D2DUtV5xKLM=; b=Y1ItVM3zCT+0z1XTyYbkIV/M9nzNaM1nPHxG6p1irBTxgXxo2wkt5RKSBPBR4Yu+QIGuo6m/wbzJjzZ+3Adp3zO2Dxld4297+XbHx/hcYzZEvevTI8l0SBLbBjnaePxhMxlLXghzDoykBi7/JND9jFlGNYMAgMKAA0THiRdedCc= 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 1642433081018265.533850025441; Mon, 17 Jan 2022 07:24:41 -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-422-aoGmABwBMVukujzTtdGpYw-1; Mon, 17 Jan 2022 10:24:15 -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 20857102CB35; Mon, 17 Jan 2022 15:23:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED27B71DE0; Mon, 17 Jan 2022 15:23:58 +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 B63E64BB7C; Mon, 17 Jan 2022 15:23:58 +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 20HFJZr4031531 for ; Mon, 17 Jan 2022 10:19:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2B73126576; Mon, 17 Jan 2022 15:19:35 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id A96152B5A5 for ; Mon, 17 Jan 2022 15:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642433080; 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=la9A23M/vy5zDfY2Wqe3A1xzZ14A17Q/D2DUtV5xKLM=; b=Vzt/fwUZ+UUFoU8YUEdGQUU4Nie/JOCaEV8F1GUYuhp3Fe4y6P+HjRVQrl+5jhc2XGv5BM ctrNyBy0HnGFLPUVnwWO6al2TFD9PNP1zt/ir/uAj8pbHww1sd+aVgKVxH9HJjhUlk987T xz+zOphkoM/fK8f5f5BnnP96LmAeUvo= X-MC-Unique: aoGmABwBMVukujzTtdGpYw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v4 07/13] virdnsmasq: Don't run 'dnsmasq --help' Date: Mon, 17 Jan 2022 16:19:21 +0100 Message-Id: <243857a3bd69cf3b9903c05cafdd6ab9bbe58b76.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.13 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: 1642433083283100001 Content-Type: text/plain; charset="utf-8" We don't query any capabilities of dnsmasq. We are only interested in dnsmasq's version (obtained via 'dnsmasq --version'). Therefore, there's no point in running 'dnsmasq --help'. Its output is not processed even. Signed-off-by: Michal Privoznik --- src/util/virdnsmasq.c | 14 +------------- tests/networkxml2conftest.c | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index 9f50ce7755..5bed8817e5 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -648,10 +648,7 @@ static int dnsmasqCapsRefreshInternal(dnsmasqCaps *caps) { g_autoptr(virCommand) vercmd =3D NULL; - g_autoptr(virCommand) helpcmd =3D NULL; - g_autofree char *help =3D NULL; g_autofree char *version =3D NULL; - g_autofree char *complete =3D NULL; =20 /* Make sure the binary we are about to try exec'ing exists. * Technically we could catch the exec() failure, but that's @@ -670,16 +667,7 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps) if (virCommandRun(vercmd, NULL) < 0) return -1; =20 - helpcmd =3D virCommandNewArgList(caps->binaryPath, "--help", NULL); - virCommandSetOutputBuffer(helpcmd, &help); - virCommandAddEnvPassCommon(helpcmd); - virCommandClearCaps(helpcmd); - if (virCommandRun(helpcmd, NULL) < 0) - return -1; - - complete =3D g_strdup_printf("%s\n%s", version, help); - - return dnsmasqCapsSetFromBuffer(caps, complete); + return dnsmasqCapsSetFromBuffer(caps, version); } =20 static dnsmasqCaps * diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index d79c2b4783..6a2c70ead1 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -114,7 +114,7 @@ mymain(void) int ret =3D 0; g_autoptr(dnsmasqCaps) full =3D NULL; =20 - full =3D dnsmasqCapsNewFromBuffer("Dnsmasq version 2.67\n--bind-dynami= c\n--ra-param"); + full =3D dnsmasqCapsNewFromBuffer("Dnsmasq version 2.67"); =20 #define DO_TEST(xname, xcaps) \ do { \ --=20 2.34.1