From nobody Sat Nov 23 15:08:57 2024 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=1723847180; cv=none; d=zohomail.com; s=zohoarc; b=YssIVP7ae09xyu5cHcEuwXdA19Iyc2uAFQecS6xWZtwIn3KseFOmcq4DYEHpxsGp2bj0aRou3AR8/11EVJOLBtFSq6jIGsNvZMIssZVPk3PF1BFwj5SmOaC0P9W6KvPydoxYkAzHr+ynYI/GxsEyFMmfOOHPt77ZqKG3yeViF2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723847180; h=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=MGB5ws6gv/iRBtPgZRmVcE7aIvzUYQwSTiQpGqrQ7RA=; b=GPEDlo08q1rNEmfsxgGxPvixJE0Y6cKileDyjWZXa91la8FVks+RjQptzaH5oEVEq/9pINClYBXzgDMAVAkxT7dCaFRm/pwmJpMNjEtqBOoyxuh3MlQhSE2EOi/G2TkU13QypKoMMO9PIcyRBgooMsy38u9Hok0rO7RZ72pk0BQ= 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 1723847180281376.11163687456576; Fri, 16 Aug 2024 15:26:20 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1BF231456; Fri, 16 Aug 2024 18:26:19 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AFD22157F; Fri, 16 Aug 2024 18:25:37 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 07A4C13AD; Fri, 16 Aug 2024 18:25:33 -0400 (EDT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 305411276 for ; Fri, 16 Aug 2024 18:25:32 -0400 (EDT) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-37186c2278bso1378755f8f.1 for ; Fri, 16 Aug 2024 15:25:32 -0700 (PDT) Received: from localhost ([69.51.98.148]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ccd6f74c38sm1496478173.135.2024.08.16.15.25.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 15:25:30 -0700 (PDT) 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,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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=1723847131; x=1724451931; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1PXGh1vBYYJeBZrRN8LQG0i+JamNi3g98nZEl1uEjDw=; b=aKBvQ8ZLrM8D8ovf0R04v5zGVsu8u7trxylrOgdFUFTMNhJ2oyTcOaBsWws9pburX2 2x7c29tRLClcL89Fxfj9/fDHaU6gXAM8Ip3yuz0PqJ7YdH55UO62Ew+blGXfpXvBUm08 JNt276eV5A7MiYWDhX3LgyUqWrgdCqV1DJ+6rEBiTMb3EipMPJFFwRK/HsZaQwaHxSkb ifXlAdd33ZF/h6x6vAogDnz++MjH718yH88hUOfRASFvsGZyOs6PzbV0LhCXycQ9j4zP e+PN+dexj473dOGcoH05IN3gwXxMaqLzgWIMPq7Q9cToIh8sZq/kA2T5ftVhxaTesR50 LOeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723847131; x=1724451931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1PXGh1vBYYJeBZrRN8LQG0i+JamNi3g98nZEl1uEjDw=; b=ZkG3W5ywkxhe0ZzA2dEjwwgLLbbGJZH6NIHcXD1XM+m/jGoTwhfX9b75nAd7JN8/xu ItVhqjZfAkojAshFd6GBd9zL6Lw+/QNw8EW//EOv7tL0aIiuFQK9Rl1xzbpp3JQXt3Qt hF7yz9N/3nQ2ttQjscJiZCycszgIXmvqVrY+W4oEZLvzBJgfYWNPILp5UEeMCJPYHpty T5LOhLsmLd1AosUNLlCG/zHat2MIUKkksFsItMWcV1lDSrSAsrFdbieMVFnG5NFFbWN/ VsC5YrZoiHPb6vOegHb2knmcbaPR4AJrwXFr1DTJVyuJnVgL0AZhbC9GwX/DHieQ7Vr0 AmYA== X-Gm-Message-State: AOJu0YyehLMWdV9q1RgxhSmJRUVOr8VZhs7nDmKOgAkGqKAOmTOTGHDp u8BL2p1lTES5Oh6TrCkzO9dtFBXShHxjUnGABH0bO/QKlq5DzhqH6bXbz6uQfZYogXbJhTNHGpV v X-Google-Smtp-Source: AGHT+IHVpzN/e2Re+cGjJVA3By9CmplblJlj+pKYE3fl5/cfqiUQDDTxViYjYcJKapN/0+8OwCH/1w== X-Received: by 2002:a5d:4f03:0:b0:368:4467:c23e with SMTP id ffacd0b85a97d-37186df4026mr4116852f8f.30.1723847130780; Fri, 16 Aug 2024 15:25:30 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH V2 1/2] qemu: conf: Improve the foo_image_format setting descriptions Date: Fri, 16 Aug 2024 16:25:25 -0600 Message-Id: <20240816222526.21199-2-jfehlig@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240816222526.21199-1-jfehlig@suse.com> References: <20240816222526.21199-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FQ6FFV4PXSIUVZFK4PPS3CLCWIYFS65N X-Message-ID-Hash: FQ6FFV4PXSIUVZFK4PPS3CLCWIYFS65N 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 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: 1723847181544116600 Content-Type: text/plain; charset="utf-8" The current description of the various foo_image_format settings can be construded to imply the setting is only used to control compression of the image. Improve the documentation to clarify that format describes the representation of guest memory blocks on disk, which includes compression among other possible layouts. Signed-off-by: Jim Fehlig Reviewed-by: Martin Kletzander --- src/qemu/qemu.conf.in | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 6bc2140dcb..d4fdd717ba 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -578,27 +578,35 @@ # "/dev/infiniband/uverbs0" =20 =20 -# The default format for QEMU/KVM guest save images is raw; that is, the -# memory from the domain is dumped out directly to a file. If you have -# guests with a large amount of memory, however, this can take up quite -# a bit of space. If you would like to compress the images while they -# are being saved to disk, you can also set "zstd", "lzop", "gzip", "bzip2= ", -# or "xz" for save_image_format. Note that this means you slow down the pr= ocess -# of saving a domain in order to save disk space. +# The libvirt QEMU driver supports serveral different save image formats. +# The term "format" is used loosely to describe how the save image data is +# represented on disk. It could be a continguous stream of guest memory bl= ocks, +# or a stream of compressed memory blocks. # -# save_image_format is used when you use 'virsh save' or 'virsh managedsav= e' -# at scheduled saving, and it is an error if the specified save_image_form= at -# is not valid, or the requested compression program can't be found. +# A continguous stream of guest memory blocks is the default format for QE= MU/KVM +# guest save images and is termed "raw". The raw format can consume consid= erable +# 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". + +# 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. # -# dump_image_format is used when you use 'virsh dump' at emergency -# crashdump, and if the specified dump_image_format is not valid, or -# the requested compression program can't be found, this falls -# back to "raw" compression. +# 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 +# supported by the system. # -# snapshot_image_format specifies the compression algorithm of the memory = save +# dump_image_format is analogous to save_image_format and is used with +# 'virsh dump' at emergency crashdump. If the specified dump_image_format = is +# not valid or cannot be supported by the system, this falls back to the +# "raw" format. +# +# Likewise, snapshot_image_format specifies the format of the memory save # image when an external snapshot of a domain is taken. This does not apply # on disk image format. It is an error if the specified format isn't valid, -# or the requested compression program can't be found. +# or the system cannot support the requested format. # #save_image_format =3D "raw" #dump_image_format =3D "raw" --=20 2.35.3 From nobody Sat Nov 23 15:08:57 2024 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=1723847212; cv=none; d=zohomail.com; s=zohoarc; b=W15Qp1qJQy7wb6Wot2ZmehF5/ZCN+cbGQaJA2hfXthQ3zFXpAuUfAXXt7X8P8C7Uh5AiiExgLp99s0RqQvvF3n/2Zt6MK0XasFRbQ/F/80568Qfys+5gEd6XXs7PamNrr+FN5vG+4rKQ1Nig5b48M5SY/CGrD+S8wH+MkiWLSL8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723847212; h=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=kl4g+4K/A2n/2evwYeG/yaFlIElu04OhYo703L/sh9s=; b=Fd4TzH9lu6WoC688JILpfkafkF5hmOeE9DCtnRMNq3dX5D2/LvoIaWSJ20C8/CINIUbiZ5UFJg0H1jW0Q4gE05kSTd7G7JvM+Xixf2pVN+fjVQHOClcc4Jm6DiGUQfQCr6dpcCJoj+QmxzXHXZtBfFE/shwXlwdL4ZFY6nLUZy0= 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 1723847212568299.1078217867047; Fri, 16 Aug 2024 15:26:52 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 782791412; Fri, 16 Aug 2024 18:26:51 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D4EC5158D; Fri, 16 Aug 2024 18:25:46 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 671C51477; Fri, 16 Aug 2024 18:25:41 -0400 (EDT) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 3644F141F for ; Fri, 16 Aug 2024 18:25:34 -0400 (EDT) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-428fb103724so18192915e9.1 for ; Fri, 16 Aug 2024 15:25:34 -0700 (PDT) Received: from localhost ([69.51.98.148]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-824e990f965sm150212739f.17.2024.08.16.15.25.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 15:25:32 -0700 (PDT) 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,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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=1723847133; x=1724451933; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nkodgCrne+z0yE7FclC7SFfNLIZxM+RvAxd+PKR/etU=; b=Cjy5fxDvqJ5bhLkeZDI5/qWUMR1yq1mcaNjhrJFR93xEzaFduJaIZAZMpEcO43C6ME p8HfQKpUXhgVseT6grj2sQLngNLZHhwdRMclfHmbNO56cnmaKs9YsI4QV9H0k2a4DxD9 G+/7BfZlYhi4sbwosK8qbtmcuVLpo/7LkebefiGzvMqyvx9XbHUkbKoWsbYsX4nCYSOG WuwkOHzjYNd+Fr1h2ODhDZFS+gJsogWhmTcJD2VsgRL2pqNZt+NvvnDmDNQFai/D/w+w CxM1NWpUO7Sea3BnAcB5XzHeEjK6CMgdzpbY4EkLKLl+sfeeN088kI1yZACYsDPe9SEK v3Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723847133; x=1724451933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nkodgCrne+z0yE7FclC7SFfNLIZxM+RvAxd+PKR/etU=; b=xGam0pEK75pOpeYZKFO0D9PDl8IQ4/NHK//s4lKMo3IvsO/2AmR+3rX/3IOuNa/HBU ZPyc5YydDje6XVIz2lYNUNBr3Un9qXoxwhOt4WtHQ56SSHXb4N79j5CGKPuCOJKkcVrf 8rKPxlH3Mg8SeRL5j61AVLTfatD8CdcZdJ5oSxJFftxRaELmDcS+zDCrk4eCsWcLW1+i gT6c7PrSsqTLSGzsH31H6YOaZnG9YuTrYzBMsPPFzOH7MlcuCIZ3sojFjIbLgeoqriAN K0VSCBUpJrThhstjbvnsWTtMPKlzhwok38chbvWjq+Gc8nBq52CpdpCiKUB7XG1qFT+Z tqMw== X-Gm-Message-State: AOJu0YwLDl26C24tQ+nuJwEbRn+lNZ9QrG408UdpBZhIukkVtiso6Pov UhGivcgwNLlYk1X9g3yvKKpLbPBp4t0tcsdzGkJH5EhUxgWVpg5D86+wcwgllLdnX8wonF71Wq7 w X-Google-Smtp-Source: AGHT+IFCE+RIlmC+zhK+g7+20g+e3lz9g5oZ9mjo8HFclecjNUChrRLJerG/rEzmM9ojMt8TH68mDQ== X-Received: by 2002:a05:6000:bd2:b0:368:4488:66f8 with SMTP id ffacd0b85a97d-37186d72b36mr5563794f8f.23.1723847132924; Fri, 16 Aug 2024 15:25:32 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH V2 2/2] qemu: Use consistent naming for save image format Date: Fri, 16 Aug 2024 16:25:26 -0600 Message-Id: <20240816222526.21199-3-jfehlig@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240816222526.21199-1-jfehlig@suse.com> References: <20240816222526.21199-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MYPREEBDDAOIIXGB5INSZUCU6BPCORH5 X-Message-ID-Hash: MYPREEBDDAOIIXGB5INSZUCU6BPCORH5 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 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: 1723847213662116600 Content-Type: text/plain; charset="utf-8" The image format setting in qemu.conf is named 'save_image_format'. The enum of supported format types is declared with name 'virQEMUSaveFormat'. Let's be consistent and use 'format' instead of 'compressed' when referring to the save image format. Signed-off-by: Jim Fehlig Reviewed-by: Martin Kletzander --- src/qemu/qemu_driver.c | 30 +++++++++++++++--------------- src/qemu/qemu_saveimage.c | 32 ++++++++++++++++---------------- src/qemu/qemu_saveimage.h | 4 ++-- src/qemu/qemu_snapshot.c | 6 +++--- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3801ad623a..b114f4b9c2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2749,7 +2749,7 @@ qemuDomainManagedSaveHelper(virQEMUDriver *driver, g_autoptr(virQEMUDriverConfig) cfg =3D NULL; g_autoptr(virCommand) compressor =3D NULL; g_autofree char *path =3D NULL; - int compressed; + int format; =20 if (virDomainObjCheckActive(vm) < 0) return -1; @@ -2761,16 +2761,16 @@ qemuDomainManagedSaveHelper(virQEMUDriver *driver, } =20 cfg =3D virQEMUDriverGetConfig(driver); - if ((compressed =3D qemuSaveImageGetCompressionProgram(cfg->saveImageF= ormat, - &compressor, - "save", false)) <= 0) + if ((format =3D qemuSaveImageGetCompressionProgram(cfg->saveImageForma= t, + &compressor, + "save", false)) < 0) return -1; =20 path =3D qemuDomainManagedSavePath(driver, vm); =20 VIR_INFO("Saving state of domain '%s' to '%s'", vm->def->name, path); =20 - if (qemuDomainSaveInternal(driver, vm, path, compressed, + if (qemuDomainSaveInternal(driver, vm, path, format, compressor, dxml, flags) < 0) return -1; =20 @@ -2784,7 +2784,7 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *pat= h, const char *dxml, unsigned int flags) { virQEMUDriver *driver =3D dom->conn->privateData; - int compressed; + int format; g_autoptr(virCommand) compressor =3D NULL; int ret =3D -1; virDomainObj *vm =3D NULL; @@ -2795,9 +2795,9 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *pat= h, const char *dxml, VIR_DOMAIN_SAVE_PAUSED, -1); =20 cfg =3D virQEMUDriverGetConfig(driver); - if ((compressed =3D qemuSaveImageGetCompressionProgram(cfg->saveImageF= ormat, - &compressor, - "save", false)) <= 0) + if ((format =3D qemuSaveImageGetCompressionProgram(cfg->saveImageForma= t, + &compressor, + "save", false)) < 0) goto cleanup; =20 if (!(vm =3D qemuDomainObjFromDomain(dom))) @@ -2809,7 +2809,7 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *pat= h, const char *dxml, if (virDomainObjCheckActive(vm) < 0) goto cleanup; =20 - ret =3D qemuDomainSaveInternal(driver, vm, path, compressed, + ret =3D qemuDomainSaveInternal(driver, vm, path, format, compressor, dxml, flags); =20 cleanup: @@ -2835,7 +2835,7 @@ qemuDomainSaveParams(virDomainPtr dom, g_autoptr(virCommand) compressor =3D NULL; const char *to =3D NULL; const char *dxml =3D NULL; - int compressed; + int format; int ret =3D -1; =20 virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | @@ -2869,15 +2869,15 @@ qemuDomainSaveParams(virDomainPtr dom, } =20 cfg =3D virQEMUDriverGetConfig(driver); - if ((compressed =3D qemuSaveImageGetCompressionProgram(cfg->saveImageF= ormat, - &compressor, - "save", false)) <= 0) + if ((format =3D qemuSaveImageGetCompressionProgram(cfg->saveImageForma= t, + &compressor, + "save", false)) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) goto cleanup; =20 - ret =3D qemuDomainSaveInternal(driver, vm, to, compressed, + ret =3D qemuDomainSaveInternal(driver, vm, to, format, compressor, dxml, flags); =20 cleanup: diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 018ab5a222..69617e07eb 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -55,8 +55,8 @@ typedef enum { QEMU_SAVE_FORMAT_LAST } virQEMUSaveFormat; =20 -VIR_ENUM_DECL(qemuSaveCompression); -VIR_ENUM_IMPL(qemuSaveCompression, +VIR_ENUM_DECL(qemuSaveFormat); +VIR_ENUM_IMPL(qemuSaveFormat, QEMU_SAVE_FORMAT_LAST, "raw", "gzip", @@ -72,7 +72,7 @@ qemuSaveImageBswapHeader(virQEMUSaveHeader *hdr) hdr->version =3D GUINT32_SWAP_LE_BE(hdr->version); hdr->data_len =3D GUINT32_SWAP_LE_BE(hdr->data_len); hdr->was_running =3D GUINT32_SWAP_LE_BE(hdr->was_running); - hdr->compressed =3D GUINT32_SWAP_LE_BE(hdr->compressed); + hdr->format =3D GUINT32_SWAP_LE_BE(hdr->format); hdr->cookieOffset =3D GUINT32_SWAP_LE_BE(hdr->cookieOffset); } =20 @@ -97,7 +97,7 @@ virQEMUSaveData * virQEMUSaveDataNew(char *domXML, qemuDomainSaveCookie *cookieObj, bool running, - int compressed, + int format, virDomainXMLOption *xmlopt) { virQEMUSaveData *data =3D NULL; @@ -114,7 +114,7 @@ virQEMUSaveDataNew(char *domXML, memcpy(header->magic, QEMU_SAVE_PARTIAL, sizeof(header->magic)); header->version =3D QEMU_SAVE_VERSION; header->was_running =3D running ? 1 : 0; - header->compressed =3D compressed; + header->format =3D format; =20 data->xml =3D domXML; return data; @@ -227,22 +227,22 @@ virQEMUSaveDataFinish(virQEMUSaveData *data, =20 =20 static virCommand * -qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression) +qemuSaveImageGetCompressionCommand(virQEMUSaveFormat format) { virCommand *ret =3D NULL; - const char *prog =3D qemuSaveCompressionTypeToString(compression); + const char *prog =3D qemuSaveFormatTypeToString(format); =20 if (!prog) { virReportError(VIR_ERR_OPERATION_FAILED, _("Invalid compressed save format %1$d"), - compression); + format); return NULL; } =20 ret =3D virCommandNew(prog); virCommandAddArg(ret, "-dc"); =20 - if (compression =3D=3D QEMU_SAVE_FORMAT_LZOP) + if (format =3D=3D QEMU_SAVE_FORMAT_LZOP) virCommandAddArg(ret, "--ignore-warn"); =20 return ret; @@ -282,10 +282,10 @@ qemuSaveImageDecompressionStart(virQEMUSaveData *data, if (header->version !=3D 2) return 0; =20 - if (header->compressed =3D=3D QEMU_SAVE_FORMAT_RAW) + if (header->format =3D=3D QEMU_SAVE_FORMAT_RAW) return 0; =20 - if (!(cmd =3D qemuSaveImageGetCompressionCommand(header->compressed))) + if (!(cmd =3D qemuSaveImageGetCompressionCommand(header->format))) return -1; =20 *intermediatefd =3D *fd; @@ -443,8 +443,8 @@ qemuSaveImageCreate(virQEMUDriver *driver, =20 =20 /* qemuSaveImageGetCompressionProgram: - * @imageFormat: String representation from qemu.conf for the compression - * image format being used (dump, save, or snapshot). + * @imageFormat: String representation from qemu.conf of the image format + * being used (dump, save, or snapshot). * @compresspath: Pointer to a character string to store the fully qualifi= ed * path from virFindFileInPath. * @styleFormat: String representing the style of format (dump, save, snap= shot) @@ -454,8 +454,8 @@ qemuSaveImageCreate(virQEMUDriver *driver, * and let the path remain as NULL. * * Returns: - * virQEMUSaveFormat - Integer representation of the compression - * program to be used for particular style + * virQEMUSaveFormat - Integer representation of the save image + * format to be used for particular style * (e.g. dump, save, or snapshot). * QEMU_SAVE_FORMAT_RAW - If there is no qemu.conf imageFormat value or * no there was an error, then just return RAW @@ -475,7 +475,7 @@ qemuSaveImageGetCompressionProgram(const char *imageFor= mat, if (!imageFormat) return QEMU_SAVE_FORMAT_RAW; =20 - if ((ret =3D qemuSaveCompressionTypeFromString(imageFormat)) < 0) + if ((ret =3D qemuSaveFormatTypeFromString(imageFormat)) < 0) goto error; =20 if (ret =3D=3D QEMU_SAVE_FORMAT_RAW) diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h index e541792153..0e58dd14b6 100644 --- a/src/qemu/qemu_saveimage.h +++ b/src/qemu/qemu_saveimage.h @@ -38,7 +38,7 @@ struct _virQEMUSaveHeader { uint32_t version; uint32_t data_len; uint32_t was_running; - uint32_t compressed; + uint32_t format; uint32_t cookieOffset; uint32_t unused[14]; }; @@ -121,7 +121,7 @@ virQEMUSaveData * virQEMUSaveDataNew(char *domXML, qemuDomainSaveCookie *cookieObj, bool running, - int compressed, + int format, virDomainXMLOption *xmlopt); =20 void diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index f5260c4a22..0683bc5939 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1302,7 +1302,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *drive= r, bool memory_existing =3D false; bool thaw =3D false; bool pmsuspended =3D false; - int compressed; + int format; g_autoptr(virCommand) compressor =3D NULL; virQEMUSaveData *data =3D NULL; g_autoptr(GHashTable) blockNamedNodeData =3D NULL; @@ -1379,7 +1379,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *drive= r, JOB_MASK(VIR_JOB_SUSPEND) | JOB_MASK(VIR_JOB_MIGRATION_OP))); =20 - if ((compressed =3D qemuSaveImageGetCompressionProgram(cfg->snapsh= otImageFormat, + if ((format =3D qemuSaveImageGetCompressionProgram(cfg->snapshotIm= ageFormat, &compressor, "snapshot", f= alse)) < 0) goto cleanup; @@ -1392,7 +1392,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *drive= r, =20 if (!(data =3D virQEMUSaveDataNew(xml, (qemuDomainSaveCookie *) snapdef->= cookie, - resume, compressed, driver->xmlopt= ))) + resume, format, driver->xmlopt))) goto cleanup; xml =3D NULL; =20 --=20 2.35.3