From nobody Fri Dec 19 20:16:39 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=1738953653; cv=none; d=zohomail.com; s=zohoarc; b=AY6SMzinPV4IWgK/xsWhrm/rJvw5KHYhXYbbbNU3cctf4AUjH8tgUU7aEnsUuSQb5w0VXsakiEC7h3hNoAnW66LvN9lgKAmaJtDs7tPpVtgLGdI2sDsNJArfQ7mUcQ7hU8yd1YhBWyttxV4lPjG7RPXGvF+oT0h7cA74+6WFRTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738953653; h=Content-Transfer-Encoding:Cc:Cc: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; bh=O9u7Cs+l1YTtwFL8TRxa+p3w0S0NPUMCHRKMoBo6lQU=; b=KGOKWG2gztg3Z7cbOio0gw7riPM4v8Xqrh6h+XM36+MuU93pxvr5In6zftyuYV1Bnh4zAU0TkXJNLlKimgasHU9wgk2vfzWuOkoNxZ3j05glr+2s4AKnNmBjSbcbdni2kQLUxxh3OY35hLlRloRnbScP4/scD2gILZvUrQa7BvA= 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 173895365330320.428731801931463; Fri, 7 Feb 2025 10:40:53 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 582981941; Fri, 7 Feb 2025 13:40:52 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A7F731744; Fri, 7 Feb 2025 13:38:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id EAA38153A; Fri, 7 Feb 2025 13:38:07 -0500 (EST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 961EE15B4 for ; Fri, 7 Feb 2025 13:37:49 -0500 (EST) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-38dcac27bcbso637358f8f.0 for ; Fri, 07 Feb 2025 10:37:49 -0800 (PST) Received: from localhost (205-201-32-8.scinternet.net. [205.201.32.8]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-73048c1623dsm3399896b3a.132.2025.02.07.10.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 10:37:47 -0800 (PST) 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=suse.com; s=google; t=1738953468; x=1739558268; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BYVpqNRnIk0iGdrdba8UNztTzwReQwWb373ObpYQ6iI=; b=amUE5I6bgekOd4+B5wOC0AQ0c9hPoM1BaUPoVTlb25LfRIsXj+2d4mgBtOxbjAj+wp /pu9PjKnItPreKiZHNYJkx+vePvyUzwP23zGhWjD34qYIKj5rcjbBZ8oN9Wo9rRPhqlD haJ8E30EFlwoCNsMPZj0EXolUEaeX6KnlYFpxI57+KresxQZBHQCG+NEfmYHC1ADnDcI nNEHJ6cRhdL9Eprr7nIvI3SnU/Tv2+NxLrj/XfBtHeZX8Hjsx6cvsSXrWUlqa4utLsVS RZBU3uc/RrEflhRrEtcrWg+HI87wNUn9c6U9n64KMee7o66EIissF7MlnVHxlmG1oS/t SFEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738953468; x=1739558268; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BYVpqNRnIk0iGdrdba8UNztTzwReQwWb373ObpYQ6iI=; b=tdQ4tlzaf/bwlxBsXVvVm+IuG6TXLBqlobj6OzQUBYHi+JaR5SMT0HsUcH6RwhN/Lx m+eDFGOCsWK5mdDoOn0jMNQBBZNPyi7dMZHtKlamvU1YpJWGMcQ731Qlv1zcR04Aphjg Ke0MBOII2yUO6evWNCB/kR62nFYCMHjZIu7onaysviS09HoQFIRm0h4UwjGklIpyo53B lsK7/ZEzkPojUs48b/wE8flvcA3C2FGb0IimU97mDAQ2/NEELSSAei7e7fDuxAS6Z7I0 AWMeg6Op09sz0/HIhKIsJPVDYTlNKUFv9BMhskTkcevbq+kOjOvbHIcRlbgj82FxTp0K 246Q== X-Gm-Message-State: AOJu0YxD+Ysx7Vh31NNZ7lYOXdj6tN8eMBRMj9PPtpjc9Udea+3ptGha amHmIuaK1Wjd4N62PsZrNq0J6zKi1TJj1K3qU0b4nHNQe/btq6JIFToCyP769h8ldwMje5QT3Vb u X-Gm-Gg: ASbGncuN4sFXrGaqbpHexQvKE7sWEfeD69lfA1G65Cu8aMvhoyJNAs2lIcQhSbMvSPN qAU9ZPQtsttmaWOd0OxTriz7VTCt2N7yJtn+/Tm9cS5XTHIAvftUIB/AmiFCAQqGifGX6mhkEgq U1qKt5V5y65nyCOfoIhTrihmMOIKjw/MV53G4uQMU59ACI/+ckdnIANJU7cMdUHzwIITaGv+RDO tFGjzZ9RvgNWRJpkT2SVAwxPmr/11rZabvF+FHyHsCS8182pnkA7AyoeU8KvgNB3FrxV6v5AlwG GeXCkT2DBXq9pcKgoj4nXgBwpf4jQwlENA== X-Google-Smtp-Source: AGHT+IHZAhGUtOiCgJo85lAlqd0MoAxFASVce7DDJtW6klTIhgvzxHKpLKSre9I/FWIjDez6UL2XWA== X-Received: by 2002:a5d:47c8:0:b0:38d:b8fd:591f with SMTP id ffacd0b85a97d-38dbb20b89amr6338473f8f.5.1738953468378; Fri, 07 Feb 2025 10:37:48 -0800 (PST) To: devel@lists.libvirt.org Subject: [PATCH V3 07/19] qemu_saveimage: add "sparse" to supported save image formats Date: Fri, 7 Feb 2025 11:27:18 -0700 Message-ID: <20250207183730.21686-8-jfehlig@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250207183730.21686-1-jfehlig@suse.com> References: <20250207183730.21686-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZPK7HUVV5F6DWY6TZDD4SK4MTKCHDFCX X-Message-ID-Hash: ZPK7HUVV5F6DWY6TZDD4SK4MTKCHDFCX X-MailFrom: jfehlig@suse.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 CC: farosas@suse.de 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: Jim Fehlig via Devel Reply-To: Jim Fehlig X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738953655079019100 Content-Type: text/plain; charset="utf-8" Extend the list of formats to include "sparse", which uses QEMU's mapped-ram stream format [1] to write guest memory blocks at fixed offsets in the save image file. [1] https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/migration= /mapped-ram.rst?ref_type=3Dheads Signed-off-by: Jim Fehlig --- src/qemu/qemu.conf.in | 9 ++++++++- src/qemu/qemu_saveimage.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index d853136f10..ab9725e40d 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -588,11 +588,18 @@ # disk space when saving large memory guests. Various compression formats = are # available for specifying a save image compressed by the named algorithm. # Supported compression formats are "zstd", "lzop", "gzip", "bzip2", and "= xz". +# The "sparse" format uses QEMU's mapped-ram stream format to write guest = memory +# blocks at fixed offsets in the save image file. =20 # save_image_format can be used to select the desired save format. "raw" is # the traditional format used by libvirt and is also the default. The # compression formats can be used to save disk space, although this typica= lly -# results in longer save and restore times. +# results in longer save and restore times. The "sparse" format results in= a +# save image file that is roughly the logical size of the guest's memory, +# although on-disk size is a function of guest memory usage. The "sparse" +# format is useful when a predictable maximum save image file size is +# needed. The other formats can result in a save image file much larger +# than guest memory if the guest runs a memory intensive workload. # # save_image_format is used with 'virsh save' or 'virsh managedsave'. It is # an error if the specified save_image_format is not valid, or cannot be diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 5c889fee11..6888528729 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -48,6 +48,7 @@ typedef enum { QEMU_SAVE_FORMAT_XZ =3D 3, QEMU_SAVE_FORMAT_LZOP =3D 4, QEMU_SAVE_FORMAT_ZSTD =3D 5, + QEMU_SAVE_FORMAT_SPARSE =3D 6, /* Note: add new members only at the end. These values are used in the on-disk format. Do not change or re-use numbers. */ @@ -64,6 +65,7 @@ VIR_ENUM_IMPL(qemuSaveFormat, "xz", "lzop", "zstd", + "sparse", ); =20 static inline void --=20 2.43.0