From nobody Tue Dec 16 09:01:44 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=1742512135; cv=none; d=zohomail.com; s=zohoarc; b=MYL7YSc+XnDeVbb8YXA8tN0OSi8mJtRaQJsPjqYZuyM0Gz7IvMCRtN5AQt68jly81Pi2Vv6YBCRm/pLaqvObM+VbTC9A54zHHDBmU+C2W/vAFbhkwT0s7ZtH1xzKxz4M7wAo/YbOtFLhOXabtwtCoxwh2NavvyVTq3iYoc4/Amk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742512135; 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=jrKR+gg/JSn/ClUKW4uTL11DIL+iAxrA3WE2gpVe2js=; b=YSH9R2b6ZxHBqyDud0z6pupF6pxzXWGVQEz5lyIoxxxEJn1XQ5AFqi8tuX19SwqX+k1ZCjsKIrAga07ZFYGEjTH28iwcAYQv/ipmiOvVstLStJc9HPRu5qSDykNHj0wvMECeFEQPXsM3rut8mLyy53v1n2hOyzPUEKSEtcDOG08= 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 1742512135825576.152758932884; Thu, 20 Mar 2025 16:08:55 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3065417DE; Thu, 20 Mar 2025 19:08:55 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2572F1595; Thu, 20 Mar 2025 19:07:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 155D515B1; Thu, 20 Mar 2025 19:07:24 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 393781595 for ; Thu, 20 Mar 2025 19:07:23 -0400 (EDT) Received: from mx-prod-mc-04.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-408-xz4obZg9MjSVJZW8z4xeIA-1; Thu, 20 Mar 2025 19:07:20 -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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6FF21903081 for ; Thu, 20 Mar 2025 23:07:19 +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 E5BB71828A96 for ; Thu, 20 Mar 2025 23:07:18 +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_H2, 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=1742512042; 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=ZK0oguvGirMLHdtT/PoK2xA6DIRP14mAKbsXlhhUtgE=; b=FVuNbiscQMBWQEH2Yj7cXmsi2Ncl2zwgt7bCiKKN/HiSPe9ij7043+i1ff3WuLVM3YAF8h cC+J9WfJWnsl3ckb5RNlk0Am+viybnTYPms23FkVeOqRKxYlKuc+Au6IDMEErDWwWtj5vp Tto8dV5mno686Ke2Q8Ost4dTkaYVCbA= X-MC-Unique: xz4obZg9MjSVJZW8z4xeIA-1 X-Mimecast-MFC-AGG-ID: xz4obZg9MjSVJZW8z4xeIA_1742512039 To: devel@lists.libvirt.org Subject: [libvirt PATCH 2/6] tools: remote --parallel from virsh save command Date: Fri, 21 Mar 2025 00:07:10 +0100 Message-ID: <8f6508e41f5abe7f31e3055323ff67889b30084a.1742511952.git.phrdina@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: Fwf_5YmHLAaLuOgd6dkTK0EF7d6QFygEhs_o0fI7Jno_1742512039 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FCFP4LD3WFIPOXSWAYJN2LAT4YPC4RXZ X-Message-ID-Hash: FCFP4LD3WFIPOXSWAYJN2LAT4YPC4RXZ 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: 1742512137979019000 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Pavel Hrdina There is no need to have --parallel and --parallel-channels especially when --parallel on its own is the same as not used at all. In both cases libvirt will default to single channel. Signed-off-by: Pavel Hrdina --- docs/manpages/virsh.rst | 11 +++++------ tools/virsh-domain.c | 20 +++++++------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index fede984e11..65ec03cf20 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4179,7 +4179,7 @@ save :: =20 save domain state-file [--bypass-cache] [--xml file] - [--parallel] [--parallel-channels channels] + [--parallel-channels channels] [{--running | --paused}] [--verbose] =20 Saves a running domain (RAM, but not disk state) to a state file so that @@ -4213,11 +4213,10 @@ based on the state the domain was in when the save = was done; passing either the *--running* or *--paused* flag will allow overriding which state the ``restore`` should use. =20 -*--parallel* option will cause the save data to be written to file -over multiple parallel IO channels. The number of channels can be -specified using *--parallel-channels*. Using parallel IO channels -requires the use of ``sparse`` image save format. Parallel save may -significantly reduce the time required to save large memory domains. +*--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 +reduce the time required to save large memory domains. =20 Domain saved state files assume that disk images will be unchanged between the creation and restore point. For a more complete system diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index bb49860604..7adf6c16fa 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4530,13 +4530,9 @@ static const vshCmdOptDef opts_save[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("avoid file system cache when saving") }, - {.name =3D "parallel", - .type =3D VSH_OT_BOOL, - .help =3D N_("enable parallel save") - }, {.name =3D "parallel-channels", .type =3D VSH_OT_INT, - .help =3D N_("number of extra IO channels to use for parallel save") + .help =3D N_("number of IO channels to use for parallel save") }, {.name =3D "xml", .type =3D VSH_OT_STRING, @@ -4571,8 +4567,7 @@ doSave(void *opaque) virTypedParameterPtr params =3D NULL; int nparams =3D 0; int maxparams =3D 0; - int nchannels =3D 1; - int rv =3D -1; + int nchannels =3D 0; unsigned int flags =3D 0; const char *xmlfile =3D NULL; g_autofree char *xml =3D NULL; @@ -4592,8 +4587,6 @@ doSave(void *opaque) flags |=3D VIR_DOMAIN_SAVE_RUNNING; if (vshCommandOptBool(cmd, "paused")) flags |=3D VIR_DOMAIN_SAVE_PAUSED; - if (vshCommandOptBool(cmd, "parallel")) - flags |=3D VIR_DOMAIN_SAVE_PARALLEL; =20 if (vshCommandOptString(ctl, cmd, "file", &to) < 0) goto out; @@ -4602,13 +4595,14 @@ doSave(void *opaque) VIR_DOMAIN_SAVE_PARAM_FILE, to) < 0) goto out; =20 - if (flags & VIR_DOMAIN_SAVE_PARALLEL) { - if ((rv =3D vshCommandOptInt(ctl, cmd, "parallel-channels", &nchan= nels)) < 0) - goto out; - + if ((rc =3D vshCommandOptInt(ctl, cmd, "parallel-channels", &nchannels= )) < 0) + goto out; + if (rc =3D=3D 1) { if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, VIR_DOMAIN_SAVE_PARAM_PARALLEL_CHANNELS, = nchannels) < 0) goto out; + + flags |=3D VIR_DOMAIN_SAVE_PARALLEL; } =20 if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0) --=20 2.48.1