From nobody Tue Dec 16 17:13:46 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=1742512191; cv=none; d=zohomail.com; s=zohoarc; b=WbaJrG1EBS6JyccNB0pRFTmQtVsPtfrixpvGM5ZrKir6xn5uO20VzZpWts98eT+a5iUmgGtnfBVxYekDe0VuELsEfE5jyUoE0+WKg2+n5Nfvpp9JljxS2S4jWul139uxnIeGhkNObvKXHoL1Qrr/kfVtRDIQxCPFZVORQFtzk60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742512191; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post: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=t1t4BesMv7Znv19ivj9hRq1M8WvQV7ueYmNJ6P9DvRQ=; b=jdmcspXAGOCWmAwbocTJGFTY7id77LifLsDm8pUWa1+EK/yPnYegSJvXiKd08OW9EJ1ZJt2TiO27gOCswYaIJaHccn6oz6fstUhfv4K/0Qmp/YseFup2u7K1Jpxm9sPCsxSQgMDW7C+QdQUtcYfo/fMIuRyGjz+3aurGpZ5Nmdc= 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 1742512191096955.893858653753; Thu, 20 Mar 2025 16:09:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6F39E15F5; Thu, 20 Mar 2025 19:09:50 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C19F61642; Thu, 20 Mar 2025 19:07:44 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 50C6A179B; Thu, 20 Mar 2025 19:07:39 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 3540617A5 for ; Thu, 20 Mar 2025 19:07:27 -0400 (EDT) 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-651-kNE9svqqOYWRwEFW--y4xA-1; Thu, 20 Mar 2025 19:07:25 -0400 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 9B2E9180AF4C for ; Thu, 20 Mar 2025 23:07:24 +0000 (UTC) Received: from antique-work.lan (unknown [10.45.226.90]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB4991800370 for ; Thu, 20 Mar 2025 23:07:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742512046; 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=iV2zhYDX/GLsXmYerrCmoquv/grWPnxqNKeGqXGBlgw=; b=VwrMau6ZFLJ4Ubd2JAzlyguUOSXnBkHNvXJfdEBVJnlzEsEzr9oyATzwvWgjHGb1SHI5hI n1l6V7AsaOIVDQA8i2mJrAHuWlyX3M9xGN71frBX7LzjCTg/YCpGwvhaEtA+C7uyIKz7IE tDWcv3OhGGEcNoo8LiatYijtaE7ZLDE= X-MC-Unique: kNE9svqqOYWRwEFW--y4xA-1 X-Mimecast-MFC-AGG-ID: kNE9svqqOYWRwEFW--y4xA_1742512044 To: devel@lists.libvirt.org Subject: [libvirt PATCH 6/6] virsh: add --image-format option to the save command Date: Fri, 21 Mar 2025 00:07:14 +0100 Message-ID: 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: 7CrnncturHxPZtZY6fIJQzO0BBHsh-IhJQbvPe5T7ow_1742512044 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ETAMFMXMBVALXW7OX3N4OT3R46LJLKYV X-Message-ID-Hash: ETAMFMXMBVALXW7OX3N4OT3R46LJLKYV X-MailFrom: phrdina@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Pavel Hrdina via Devel Reply-To: Pavel Hrdina X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742512191894019000 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Pavel Hrdina Option --parallel-channels would require changing configuration file to be used so introduce this option as well to make it convenient for users. Signed-off-by: Pavel Hrdina --- docs/manpages/virsh.rst | 5 +++++ tools/virsh-domain.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 65ec03cf20..35ae6af547 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4179,6 +4179,7 @@ save :: =20 save domain state-file [--bypass-cache] [--xml file] + [--image-format format] [--parallel-channels channels] [{--running | --paused}] [--verbose] =20 @@ -4213,6 +4214,10 @@ based on the state the domain was in when the save w= as done; passing either the *--running* or *--paused* flag will allow overriding which state the ``restore`` should use. =20 +*--image-format* option can change the default image format used to +save data into file. For more details consult the qemu.conf configuration +file. + *--parallel-channels* option can specify number of parallel IO channels to be used when saving memory to file. Using parallel IO channels requires the use of ``sparse`` image save format. Parallel save may significantly diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 98f0e60ed4..ceff6789d8 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4534,6 +4534,10 @@ static const vshCmdOptDef opts_save[] =3D { .type =3D VSH_OT_INT, .help =3D N_("number of IO channels to use for parallel save") }, + {.name =3D "image-format", + .type =3D VSH_OT_STRING, + .help =3D N_("format of the save image file") + }, {.name =3D "xml", .type =3D VSH_OT_STRING, .unwanted_positional =3D true, @@ -4570,6 +4574,7 @@ doSave(void *opaque) int nchannels =3D 0; unsigned int flags =3D 0; const char *xmlfile =3D NULL; + const char *format =3D NULL; g_autofree char *xml =3D NULL; int rc; #ifndef WIN32 @@ -4598,6 +4603,13 @@ doSave(void *opaque) VIR_DOMAIN_SAVE_PARAM_PARALLEL_CHANNELS, ncha= nnels) < 0) goto out; =20 + if (vshCommandOptString(ctl, cmd, "image-format", &format) < 0) + goto out; + if (format && + virTypedParamsAddString(¶ms, &nparams, &maxparams, + VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT, format= ) < 0) + goto out; + if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0) goto out; =20 --=20 2.48.1