From nobody Sun Feb 8 04:23:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1693493726; cv=none; d=zohomail.com; s=zohoarc; b=DT7SYr8u5awnVkBoE0hIhWUqcP+4xOQ9XX/GGxfqvKwYo0hqedqaX778bD8USOE9arT2TIl04Qc+RRcG2LxmkFqKIRCsZ+0Uh5Qn/RPyKevjF4zcLfWxrACR9qJnGOadH7bi95TeNLgS4zjdjnR5qZQ6FKY/qS8sX797Ui5l/wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693493726; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vKMIqG3sP1quCr/hjuMGI8PjmewLPAT89jUjlEQ2OjY=; b=GRKRJUEAPwAEX302a4e+BGpKA3CsJxEMuBsubwZg6nUQe/G5Y2TLWFmpZfUcE33wBEw331AFuFt4m13HY/MZN/NznYg1JQxX5DTcdvyQ+3Qpg4X2yqG/1mGgT3MK6osF6ZSWUpZokM7nnBcKRm+uWS+EfAAzlj1P4P5dX3/HiNY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1693493726154146.15897595848242; Thu, 31 Aug 2023 07:55:26 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-505-tZtDsQANPQCTi30_1xc2gg-1; Thu, 31 Aug 2023 10:55:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1AE13101A52E; Thu, 31 Aug 2023 14:55:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08C9E1121315; Thu, 31 Aug 2023 14:55:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8F104194658D; Thu, 31 Aug 2023 14:55:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2D59B1946587 for ; Thu, 31 Aug 2023 14:55:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F39FD40C2073; Thu, 31 Aug 2023 14:55:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.224.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95BEB40C2063 for ; Thu, 31 Aug 2023 14:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693493725; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vKMIqG3sP1quCr/hjuMGI8PjmewLPAT89jUjlEQ2OjY=; b=PBXScTBtTDouEjR3o8I3XabPpK/xFWm058VQUVy+qQff7wovd+Wp6KSxxeg9kMRWZnsoyP HLyCDkbW1UZPSPbsC9iPO9b94jXFhMQjaORsV2psfnG9lEu+8UqSPKfR1ZkxcJSy7hmNlN T/RenUpwd/YGZjts6hGzRDGS6TrERN4= X-MC-Unique: tZtDsQANPQCTi30_1xc2gg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 4/7] qemuSaveImageStartProcess: make it possible to use without header Date: Thu, 31 Aug 2023 16:55:03 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693493728294100009 Content-Type: text/plain; charset="utf-8"; x-default="true" When used with internal snapshots there is no header to be used and no memory state to be decompressed. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_saveimage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 73115af42d..2538732901 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -573,7 +573,7 @@ qemuSaveImageOpen(virQEMUDriver *driver, * @fd: FD pointer of memory state file * @path: path to memory state file * @snapshot: snapshot to load when starting QEMU process or NULL - * @header: header from memory state file + * @header: header from memory state file or NULL * @cookie: cookie from memory state file * @asyncJob: type of asynchronous job * @start_flags: flags to start QEMU process with @@ -605,7 +605,7 @@ qemuSaveImageStartProcess(virConnectPtr conn, g_autofree char *errbuf =3D NULL; int rc =3D 0; =20 - if ((header->version =3D=3D 2) && + if (header && (header->version =3D=3D 2) && (header->compressed !=3D QEMU_SAVE_FORMAT_RAW)) { if (!(cmd =3D qemuSaveImageGetCompressionCommand(header->compresse= d))) return -1; --=20 2.41.0