From nobody Fri Dec 12 14:06:20 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=1765273952; cv=none; d=zohomail.com; s=zohoarc; b=Yb4AtqWBfaRo0BhtmFrd4bjzcvWzgXXHipyk2MAwgXGFNdS8RGRHgaiEOjO3p089SHYRzoDexfiKm8WhKKoCOfD3iNXfKMipJ8r9BEjxTxagDTYsv4JP3PTfcnjUvVEVoeOQ9536J0MA0iY4jgAEsHARUfOKTcL+jlZy7RGuKu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765273952; 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=tYMIGQ7J18wohQX3pj55YHxVKHZBnEw8QGQvLXJ2hVw=; b=V6sSaDHlWZu2S5Btfg2+m95WdkE3O+43xeq1/kmQoo3RhIzbForRZiMfP3QlW3ngaoZkEZkNJZlrYLSKsNQw762zqmuLnMFtrQjroJ5O/P2ul0oWTMqaFfBx35XVpS/TrSsl6QfBHysuDZEnbfbhGV6bQb+/WONwzkR9S7zgJ1I= 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 1765273952532502.4487295999817; Tue, 9 Dec 2025 01:52:32 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 7FE6F43DF4; Tue, 9 Dec 2025 04:51:45 -0500 (EST) Received: from [172.19.199.80] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D92F741840; Tue, 9 Dec 2025 04:47:20 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 9B0C043EFF; Tue, 9 Dec 2025 04:46:31 -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 1ACE33F366 for ; Tue, 9 Dec 2025 04:46:22 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-301-C8Oij5s_NRa75ZdelBF3lw-1; Tue, 09 Dec 2025 04:46:20 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 908E71956052 for ; Tue, 9 Dec 2025 09:46:19 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D61401956095 for ; Tue, 9 Dec 2025 09:46:18 +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=1765273581; 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=tYMIGQ7J18wohQX3pj55YHxVKHZBnEw8QGQvLXJ2hVw=; b=KAE78WnWvjrJAoPnmSEFab/amSs3lKkP7JNMQyxnbGrnKGOcXiFfXw8Uxeml9KSUvY8RyH U2hwcFAn1o5ucW4/XMZFs2+Fgb9rrmUFQusJ9rmEQ9eEwqBcGq+EgC0dSTisbuoNL7UZvl yuOv5s+JITc3dD+YLYAJD2cXxbkL5P8= X-MC-Unique: C8Oij5s_NRa75ZdelBF3lw-1 X-Mimecast-MFC-AGG-ID: C8Oij5s_NRa75ZdelBF3lw_1765273579 To: devel@lists.libvirt.org Subject: [PATCH 7/9] virsh: Add completer for '--image-format' option of 'save' command Date: Tue, 9 Dec 2025 10:46:07 +0100 Message-ID: <9f2c4579fe18d4470b9f602a2c0e090cc503b5b5.1765272832.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LPoOiTLKrNuNeFAWgMN8_Sn147RFNlGMCeIJHlmhyyo_1765273579 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FGJP4XEFOJPB6QISUEWNTXJNC2GWZPZU X-Message-ID-Hash: FGJP4XEFOJPB6QISUEWNTXJNC2GWZPZU X-MailFrom: pkrempa@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: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1765273953513158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 6e18d195e6..cb9dd069b6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4528,6 +4528,26 @@ static const vshCmdInfo info_save =3D { .desc =3D N_("Save the RAM state of a running domain."), }; + +static char ** +virshCompleteSaveImageFormat(vshControl *ctl G_GNUC_UNUSED, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int completerflags G_GNUC_UNUSED) +{ + const char *formats[] =3D { + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_RAW, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_GZIP, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_BZIP2, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_XZ, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_LZOP, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_ZSTD, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT_SPARSE, + NULL + }; + + return g_strdupv((char **) formats); +} + static const vshCmdOptDef opts_save[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "file", @@ -4546,6 +4566,7 @@ static const vshCmdOptDef opts_save[] =3D { }, {.name =3D "image-format", .type =3D VSH_OT_STRING, + .completer =3D virshCompleteSaveImageFormat, .help =3D N_("format of the save image file") }, {.name =3D "xml", --=20 2.52.0