From nobody Fri Dec 12 14:05:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1764251693; cv=none; d=zohomail.com; s=zohoarc; b=eSmI0mDIaF8EHS07ISeq1Lpmz1kFuDDFaDOD+kldvsy/MgRe4L4WVPoqEs1Uw5PGK68WBwgBYOHUj2w3Q/zd/+h9dMF6xoAylYgiJOSaMoDpHBt+ZUlG+k9ebdDC/Vvq08APkt9pvcsXHQWuhjtCv73rp67CeyUarzb6mIdlpRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764251693; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=7N+lgbYhK6D9yZ/dgBYENd/IErTI5gm4Y6/bnGKqGsw=; b=g0/LzNk9azRaLIKbNlL3lnGLgQsnK/TgFjOlG1SsaJERp7Lag++RyEP2yMX3ALyta1Zrzu5612X3zQYnrAHMoooCxSNpf9ZgbflP3H/f8ylkiKlNchhapPUBKrvnhBkIrWufFylXb8z/i230aFzGOKW+/iZnezUU1ofYGiK/FrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 176425169346964.1128293147533; Thu, 27 Nov 2025 05:54:53 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id C6CF244C31; Thu, 27 Nov 2025 08:54:52 -0500 (EST) Received: from [172.19.199.74] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5E9BB44BC6; Thu, 27 Nov 2025 08:53:06 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3C20E41A87; Thu, 27 Nov 2025 08:52:36 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 82CE244B4A for ; Thu, 27 Nov 2025 08:51:10 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-HUWWcF6kMtyQIUaLMKITHQ-1; Thu, 27 Nov 2025 08:51:08 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EBF961800359 for ; Thu, 27 Nov 2025 13:51:07 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 40D361800451 for ; Thu, 27 Nov 2025 13:51:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764251470; h=from:from: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; bh=7N+lgbYhK6D9yZ/dgBYENd/IErTI5gm4Y6/bnGKqGsw=; b=MEessRjSaxHSbjz2q/iYh/yC/V1fgTjwhRMtDNL0xFe1roS5OeVQCUc73Ii4ofWRUqJrNb rw6nQimnh1CAoECi0mAIY4fHdioiCJor64gAve3jFx50JUDh15gTxjGJWrEjqO6cOFOGcR M6+fIgfwcwpMPownLNMafTEO/vjaiQ0= X-MC-Unique: HUWWcF6kMtyQIUaLMKITHQ-1 X-Mimecast-MFC-AGG-ID: HUWWcF6kMtyQIUaLMKITHQ_1764251468 To: devel@lists.libvirt.org Subject: [PATCH 1/8] vircommand: Update documentation to virCommandSetDryRun() Date: Thu, 27 Nov 2025 14:50:56 +0100 Message-ID: <0f169af8f95ee49b619c45e1ede0020821ebee26.1764251323.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -6JUSummU-MtQLbqTvJBhchMCJjCSRXMqkFDU28bKKc_1764251468 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TRXGRDZQKZXXADPDXMFCUPDVHBMYT6KI X-Message-ID-Hash: TRXGRDZQKZXXADPDXMFCUPDVHBMYT6KI X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764251693816019200 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Throughout years, virCommandSetDryRun() has gained more functionality and arguments. But: 1) not all arguments are covered in documentation, 2) the example wouldn't even compile. Expand the documentation to reflect current behaviour. Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index d9e4c0181f..1390c80a32 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -3184,6 +3184,7 @@ virCommandDryRunTokenFree(virCommandDryRunToken *tok) * @bufArgLinebreaks: add linebreaks after command and every argument or a= rgument pair * @bufCommandStripPath: strip leading paths of command * @callback: callback to process input/output/args + * @opaque: data blob to pass to @callback * * Sometimes it's desired to not actually run given command, but * see its string representation without having to change the @@ -3200,13 +3201,14 @@ virCommandDryRunTokenFree(virCommandDryRunToken *to= k) * The strings stored in @buf are escaped for a shell and * separated by a newline. For example: * - * virBuffer buffer =3D VIR_BUFFER_INITIALIZER; - * virCommandSetDryRun(&buffer); - * + * g_auto(virBuffer) cmdbuf =3D VIR_BUFFER_INITIALIZER; + * g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunTokenN= ew(); * virCommand *echocmd =3D virCommandNewArgList("/bin/echo", "Hello world"= , NULL); + * + * virCommandSetDryRun(dryRunToken, &cmdbuf, false, false, NULL, NULL); * virCommandRun(echocmd, NULL); * - * After this, the @buffer should contain: + * After this, the @cmdbuf should contain: * * /bin/echo 'Hello world'\n * --=20 2.51.2