From nobody Tue Sep 9 23:56: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=1737588356; cv=none; d=zohomail.com; s=zohoarc; b=LkytTMSP/08XAPfsfe3AA8BvEXcV2kCFn6y+pBqpJc2FtfjI5cMMLXaaodmVUf1Pu4WBOic0NwROcBFCv22ZocbduoD7pku40zTNMnKTQxhOQtIDB3kQYaWZiNuImDhaIv+1JWAuaEU4r18UFjsgHKHezJQjjsNhMIlyRzlRiHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737588356; 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=A/DK5cuzJAyOppqGdjS5jKXRTEEeVAhA0aR2xzmh2eE=; b=Cv2fqHrHj4SfiCg9OqouJVPSw3nKuzi0+OuwAQl+ke99sxZ/jluB9aw2N8sOH9pm6XU9M0Poi7Mu1XW4Sgs1ABDbFmpPl7Vg4BDu5Lwr02zS8wKNflqpJkokrZVllbtmo0RKbqk9DVi3WIeQLDAvtJzLNgIogeGBuQjEV2/CtHc= 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 173758835648193.3451888522859; Wed, 22 Jan 2025 15:25:56 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C9E3A13F8; Wed, 22 Jan 2025 18:25:55 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6C5A61353; Wed, 22 Jan 2025 18:23:06 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7118412E5; Wed, 22 Jan 2025 18:23:00 -0500 (EST) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 5A42012DE for ; Wed, 22 Jan 2025 18:22:44 -0500 (EST) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5d3bdccba49so619514a12.1 for ; Wed, 22 Jan 2025 15:22:44 -0800 (PST) Received: from localhost (75-169-8-111.slkc.qwest.net. [75.169.8.111]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72dab7f1925sm11493647b3a.5.2025.01.22.15.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 15:22:42 -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=1737588163; x=1738192963; 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=ZGilm2Ex9hDbV9sBzITBrtELXkK7mlQEFez+W78tXOE=; b=TdlfcJQFgQ90udrQMH3f9KkZaKD3z1EvEc20afxVPMrlQ37uOWao90fxH66J98Tkx6 9wNO7+nExgVVfXX1S0UXN9GoFHYQfQLqA0s2ZiNcOTlXao5CO87tRoxCOs+NdFaImU6G WtxbGGnE22PWqDc+zEB+7jA9kIB+f/iQ52S1sDNwAanCsg35bfHKD4Ovy50khd2jY4iz U2UPzMMyDGRhZrWaNgxr8njLYJZRDo4Izl+Kjt4+h7eooBXmPAE7vVdow0fJ4Gw7eNv5 M0QOzeT2PIwpPq0FQOIHpgDgqOEN5n28YP3cJ8iflirz18rYWSiKbi9SctiYO1pRTxy1 p/Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737588163; x=1738192963; 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=ZGilm2Ex9hDbV9sBzITBrtELXkK7mlQEFez+W78tXOE=; b=RnPOui7CSWG3O1URo1FtDYU9zDvJWhnUaQUE4JGBTeq/P+QathhN5A6gThCHf9xfq6 XlyEB1QqtTURMwUdDhTOJ4NGQNRzurIxBCCBV51Y2pF2iwUpL104IhfpK1HkeC6M6bOx EqiUenhIXYgYhh1Enw9RfcxLNCmoVdAkFCo9d0GDgIuImmXORaSbJVBfjNfKD7nxb+61 9kwZPlpfdHJ938jayzDgT6rUHdFkrJl4amnjTOzcXDktpijrYKGOHw/64uzhbg8BRW30 5eU8rGEm62F45ZUf9ev59fYm9bnJn0FJBqM6jlx0Mcz3+6ZsoG+TbBWR/yX+hiqxSXGK UVtg== X-Gm-Message-State: AOJu0YyfYZPrCxNmDQvni0U5VqSir5eCNiiJTOBOj0R/Y5SyqWlOcmw0 /6JXk+uaBaHDFV4M8K+OeglElDsPw9Aeb9ukMS0Zn77VfOzBrZOHNbpQnaYbg86YH5RQkH7bL1v 7 X-Gm-Gg: ASbGncvXdiBAtf42cZWTuQ8de6Hy4cZ99iCI2pZySvju3cyVVv0LN/akYTbvWzbsGA1 JhRE9mbb/O65gJZ8FjWgFwwgubQawKC0lvAMKGrVcfP61PUmOBMKoUMy3rLr0R2QwQ5gw0dOl92 M+BwaJjw8xQuZD0YkuOq+XiqxfzpDamT7LRXGa44+2wEoYy1RksrnujvzOjEyXe+NCY+7h/XDct VaKKlGeVqbFmSg6pcbLoRVeOIp6QHd8H3h+93eal5k4EJW6Zb6naUkXbkxfZjerl1NefcJc6Xit jzYqoc96mOlDxl6yXGq66/w= X-Google-Smtp-Source: AGHT+IFfB3a6/c5KQEJGrMgqacch0EN5gBD8TNVhB/e3tjvTh/yp4bmGIId88HihC97wXzqE1Mmnsw== X-Received: by 2002:a17:906:c143:b0:aa6:7737:199c with SMTP id a640c23a62f3a-ab38b26f3cfmr2090900166b.15.1737588163112; Wed, 22 Jan 2025 15:22:43 -0800 (PST) To: devel@lists.libvirt.org Subject: [PATCH V2 07/20] qemu_saveimage: add "sparse" to supported save image formats Date: Wed, 22 Jan 2025 16:16:41 -0700 Message-ID: <20250122232228.19306-8-jfehlig@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250122232228.19306-1-jfehlig@suse.com> References: <20250122232228.19306-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: O774FMACKVFK2EH46CIPRNEIXS4XUYHK X-Message-ID-Hash: O774FMACKVFK2EH46CIPRNEIXS4XUYHK 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: 1737588358759019000 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 69617e07eb..ff5b9e72eb 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