From nobody Fri May 17 02:41:33 2024 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=1693557157; cv=none; d=zohomail.com; s=zohoarc; b=hiSPJoll6CRic6qUYYmoB6DMTmgYaElzIYSqLKX/8R589MvlEttOczCxf6aJsOLSSGeUZzhZVbcEh0n7XifW9jr/Ya7v7SHIgRbsouykaLVDYiEbqZ277mwePNcYiysqReF8hvt5d/IWGx2upm5IMW8y3JX+12ld4OiuiGuiX0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557157; 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=FHZnQuy0dwYJom25iTlkgE5yKc0Yw49dhF0V1witXEE=; b=Eh2xRP9ZCXZJtcK25hrwRSiEnxae8IxR4Xt2QYo0YvrrKqThQIZk922eeD9qpeyhC89dtMri4ZlKqZXpbkL7jUud0Y/Kd8ItK5ijP7ezyX8RXKQ6Rsor/wV596uODfZNA4Yo0/1uPqH6Kl13vnpzmstdQ54GoblUoQ6XqkWB83s= 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 169355715699749.20461678136667; Fri, 1 Sep 2023 01:32:36 -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-527-2U9GKZj7O0ql6rp5HuhZ5Q-1; Fri, 01 Sep 2023 04:32:33 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66927823D6C; Fri, 1 Sep 2023 08:32:31 +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 B8E9A40C2072; Fri, 1 Sep 2023 08:32:30 +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 968B919472AD; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E544019465B7 for ; Fri, 1 Sep 2023 08:32:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D521BC15BAE; Fri, 1 Sep 2023 08:32:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 785E0C15BAD for ; Fri, 1 Sep 2023 08:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693557156; 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=FHZnQuy0dwYJom25iTlkgE5yKc0Yw49dhF0V1witXEE=; b=EeD2aDA3WfXj7pbzSP/BpoJa+6rkZN6f908ErBIOuJ/r26LLKw/xTlbuti88BoV2TXCr0v 9HjDJn1HIDzrUicWZoOu5tFMvEwJyDKzPl7ZiOf/cfXd2Qogtw22QTz4tjDFucEVX0cmPt jtGfoRm6aoTCZw9VMYIW/g1FHtIRQQk= X-MC-Unique: 2U9GKZj7O0ql6rp5HuhZ5Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/6] qemu_snapshot: fix reverting external snapshot when not all disks are included Date: Fri, 1 Sep 2023 10:32:12 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.1 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: 1693557158542100001 Content-Type: text/plain; charset="utf-8"; x-default="true" We need to skip all disks that have snapshot type other than 'external'. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index d943281e35..ff85d56572 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2058,6 +2058,9 @@ qemuSnapshotRevertExternalPrepare(virDomainObj *vm, virDomainSnapshotDiskDef *snapdisk =3D &tmpsnapdef->disks[i]; virDomainDiskDef *domdisk =3D domdef->disks[i]; =20 + if (snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) + continue; + if (qemuSnapshotPrepareDiskExternal(domdisk, snapdisk, active, fal= se) < 0) return -1; } @@ -2098,6 +2101,9 @@ qemuSnapshotRevertExternalActive(virDomainObj *vm, return -1; =20 for (i =3D 0; i < tmpsnapdef->ndisks; i++) { + if (tmpsnapdef->disks[i].snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATIO= N_EXTERNAL) + continue; + if (qemuSnapshotDiskPrepareOne(snapctxt, vm->def->disks[i], tmpsnapdef->disks + i, @@ -2188,6 +2194,9 @@ qemuSnapshotRevertExternalFinish(virDomainObj *vm, for (i =3D 0; i < curdef->nrevertdisks; i++) { virDomainSnapshotDiskDef *snapdisk =3D &(curdef->revertdisks[i= ]); =20 + if (snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTER= NAL) + continue; + if (virStorageSourceInit(snapdisk->src) < 0 || virStorageSourceUnlink(snapdisk->src) < 0) { VIR_WARN("Failed to remove snapshot image '%s'", @@ -2203,6 +2212,9 @@ qemuSnapshotRevertExternalFinish(virDomainObj *vm, for (i =3D 0; i < curdef->ndisks; i++) { virDomainSnapshotDiskDef *snapdisk =3D &(curdef->disks[i]); =20 + if (snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTER= NAL) + continue; + if (virStorageSourceInit(snapdisk->src) < 0 || virStorageSourceUnlink(snapdisk->src) < 0) { VIR_WARN("Failed to remove snapshot image '%s'", --=20 2.41.0 From nobody Fri May 17 02:41:33 2024 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=1693557163; cv=none; d=zohomail.com; s=zohoarc; b=LMdcAGNA3526I9V58ECssOqIYH9KD971VOqYOJXnsgKZXZNWbeoNhPgBCEl43Iw3RtiVpOQ8y3kIHT3lMbUmdparDIQNL4KRTqNCjLRbixtDfhafe+akUp4sMUX3DIT/lGM9XdQVYMi4pL17f0rA6RTVy4Pk/fPVcpAAonqNbjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557163; 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=nfU3DWpSMbX7H6Mpc6MbvD0OeZQszFpQlJu96SQLmU8=; b=FNQZvARxt6MqoxdMsNN4oWkiFuJm8sf/CzKuqb4HtQSc5fTCsb+CU6DpOtASFcDTlNBXZ5VOsbh4mXgF4EUC0kF7tXiPH1aOQ9caD6ypM5Vsqlcv5SAPQ8PzW87dC+7E0zRiDZmbQyQfc9ch4VGeqy+Nedbu1DpCNzlIJHjNl1g= 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 1693557163194771.1758028838708; Fri, 1 Sep 2023 01:32:43 -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-567-WLnfiBC_P6-GgOrcLBJhBg-1; Fri, 01 Sep 2023 04:32:40 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8903E85D180; Fri, 1 Sep 2023 08:32:37 +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 7339EC15BC0; Fri, 1 Sep 2023 08:32:37 +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 AA93919451EB; Fri, 1 Sep 2023 08:32:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9BBF119452C9 for ; Fri, 1 Sep 2023 08:32:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 764DEC15BAD; Fri, 1 Sep 2023 08:32:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1982BC15BBA for ; Fri, 1 Sep 2023 08:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693557162; 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=nfU3DWpSMbX7H6Mpc6MbvD0OeZQszFpQlJu96SQLmU8=; b=b+bjFuCeBQBPttIvpMmoqeiuWQOInkCy3LK7z9nlxWhVIIWgGeSGmHHQkEukQ+Nf6kSMm1 I2fNpu4D7QSbWHFafa10IbB/TEb3NLcMtUQnryhr1Zt0U4Rx1/MKq61ZcD+iJ4/+b89gWd q2Eth9dOb0jtqefBuUfNRIX3H060YCY= X-MC-Unique: WLnfiBC_P6-GgOrcLBJhBg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/6] qemu_saveimage: export virQEMUSaveFormat enum Date: Fri, 1 Sep 2023 10:32:13 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.8 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: 1693557164745100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_saveimage.c | 17 ----------------- src/qemu/qemu_saveimage.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 41310d6a9a..eca47171c2 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -37,23 +37,6 @@ =20 VIR_LOG_INIT("qemu.qemu_saveimage"); =20 -typedef enum { - QEMU_SAVE_FORMAT_RAW =3D 0, - QEMU_SAVE_FORMAT_GZIP =3D 1, - QEMU_SAVE_FORMAT_BZIP2 =3D 2, - /* - * Deprecated by xz and never used as part of a release - * QEMU_SAVE_FORMAT_LZMA - */ - QEMU_SAVE_FORMAT_XZ =3D 3, - QEMU_SAVE_FORMAT_LZOP =3D 4, - /* Note: add new members only at the end. - These values are used in the on-disk format. - Do not change or re-use numbers. */ - - QEMU_SAVE_FORMAT_LAST -} virQEMUSaveFormat; - VIR_ENUM_DECL(qemuSaveCompression); VIR_ENUM_IMPL(qemuSaveCompression, QEMU_SAVE_FORMAT_LAST, diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h index 30cf4b1ee0..6892e6764f 100644 --- a/src/qemu/qemu_saveimage.h +++ b/src/qemu/qemu_saveimage.h @@ -32,6 +32,23 @@ =20 G_STATIC_ASSERT(sizeof(QEMU_SAVE_MAGIC) =3D=3D sizeof(QEMU_SAVE_PARTIAL)); =20 +typedef enum { + QEMU_SAVE_FORMAT_RAW =3D 0, + QEMU_SAVE_FORMAT_GZIP =3D 1, + QEMU_SAVE_FORMAT_BZIP2 =3D 2, + /* + * Deprecated by xz and never used as part of a release + * QEMU_SAVE_FORMAT_LZMA + */ + QEMU_SAVE_FORMAT_XZ =3D 3, + QEMU_SAVE_FORMAT_LZOP =3D 4, + /* Note: add new members only at the end. + These values are used in the on-disk format. + Do not change or re-use numbers. */ + + QEMU_SAVE_FORMAT_LAST +} virQEMUSaveFormat; + typedef struct _virQEMUSaveHeader virQEMUSaveHeader; struct _virQEMUSaveHeader { char magic[sizeof(QEMU_SAVE_MAGIC)-1]; --=20 2.41.0 From nobody Fri May 17 02:41:33 2024 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; 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=1693557162; cv=none; d=zohomail.com; s=zohoarc; b=hCyvcK7uW3x28NAjDrjHBGw2FZU1VPiR0Q7gUVK/qwlH5fGz7ldKR0CKqH3r5CJr60OYuCmbQ0/GVLGqlsW/HO8EbNXztHX27JO2nUW5zyeJ475dXIuIaQAmFVLGnlm2hCXMaDs91k9b2BCyluYROVZr8ebhetWHZUrHSgq20rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557162; 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=3yTeS5aXmHwObH6ZDpw/GSi5wWaVokelhTD7W3Ub34o=; b=llpEIlmaOGL0B2T1xr2pHfKyYglblD9pXHcmLUVbjyXvcb21IM5sBKJGTZ6HXp+lha1H1+Y2fintTKyAKHUCJv5sT/DGUDZBto5N5I1M46p1NMpWLoJGarDokCPMkes/7UWXVUtZsxqvYgJc1Ph1u3L/z6dzjrnz38wxl2dD1Ns= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1693557162404798.0666004847278; Fri, 1 Sep 2023 01:32:42 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-537-MxNUqdXEO3qu5-6eVg2pJg-1; Fri, 01 Sep 2023 04:32:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90D791C07854; Fri, 1 Sep 2023 08:32:32 +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 7A9D32166B25; Fri, 1 Sep 2023 08:32:32 +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 0C54419452D2; Fri, 1 Sep 2023 08:32:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 24FBC19472AC for ; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 18413C15BC0; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF1DBC15BAE for ; Fri, 1 Sep 2023 08:32:24 +0000 (UTC) X-MC-Unique: MxNUqdXEO3qu5-6eVg2pJg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/6] qemu_saveimage: export qemuSaveImageGetCompressionCommand Date: Fri, 1 Sep 2023 10:32:14 +0200 Message-ID: <0c571daa7c2bf590fb40ec818cf9b39d70527b49.1693556950.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1693557164030100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_saveimage.c | 2 +- src/qemu/qemu_saveimage.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index eca47171c2..44ab263144 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -207,7 +207,7 @@ virQEMUSaveDataFinish(virQEMUSaveData *data, } =20 =20 -static virCommand * +virCommand * qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression) { virCommand *ret =3D NULL; diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h index 6892e6764f..510576baa2 100644 --- a/src/qemu/qemu_saveimage.h +++ b/src/qemu/qemu_saveimage.h @@ -105,6 +105,9 @@ qemuSaveImageGetCompressionProgram(const char *imageFor= mat, bool use_raw_on_fail) ATTRIBUTE_NONNULL(2); =20 +virCommand * +qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression); + int qemuSaveImageCreate(virQEMUDriver *driver, virDomainObj *vm, --=20 2.41.0 From nobody Fri May 17 02:41:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1693557161; cv=none; d=zohomail.com; s=zohoarc; b=IuDUXz9PLBSir3K9EISg/X6LX7eT63wtrIWMtox+HIRl+248l5dA9QYL0HqyGkuMWIpxGE7rHVuMbhdOzwQ6TBy234SfNz4OIA+oq5ChQ0oXW6Y3mN8uOqMKcW0UEei4bY27jDmHvdqN8Du5f6u8jENGAAGJYlTSUUPyXBxIU2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557161; 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=wIByhVDs4RDn2uRWUSGLFYxD/v4KvkVays32P3F1xM8=; b=ShvaMjkmzJqq/tC3/FoRjXMmJ3xJnpbpZ1OlCLPzPp2cwM+6V1AYb7tRdHBX0I9MQ7dSgPn0INnprV8RJF0lWRtOJ183GRO7cb3xpU7+45BGIIqRJCRuXGoPOa95Z/kuU7w/7Q1MsiSDZ3pXEUsTmBQDtyXEXDwwb3zMF3UguiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1693557161448722.9576494008519; Fri, 1 Sep 2023 01:32:41 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-426-oIpUe5-tPaWH825wiUouJg-1; Fri, 01 Sep 2023 04:32:37 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CDEF29DD99F; Fri, 1 Sep 2023 08:32:35 +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 674DE40C2063; Fri, 1 Sep 2023 08:32:35 +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 42CFE194729B; Fri, 1 Sep 2023 08:32:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BF4BB19472AC for ; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AE4DFC15BBA; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 515E9C15BAE for ; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693557160; 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=wIByhVDs4RDn2uRWUSGLFYxD/v4KvkVays32P3F1xM8=; b=aQWoqw0Tpnz3DK5XPG0pp89qEwXjVPVGMfozjPrHuK0L7EAEfItCmWNv6ZsW6P0LeN0E6G YQ12h4/2F4tdvqJu2drrgAboiWY5Mi/B6gNKHWB1le0T+ZcUF1mL/dYET+rleKbH0fkZuf GsazWh+My1KTG5M5xbZalTxtD0RuRFY= X-MC-Unique: oIpUe5-tPaWH825wiUouJg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/6] qemu_snapshot: correctly load the saved memory state file Date: Fri, 1 Sep 2023 10:32:15 +0200 Message-ID: <461af59e848069a18cd6ae0fcd9206ec83c405bd.1693556950.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.1 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: 1693557161965100007 Content-Type: text/plain; charset="utf-8"; x-default="true" Original code assumed that the memory state file is only migration stream but it has additional metadata stored by libvirt. To correctly load the memory state file we need to reuse code that is used when restoring domain from saved image. This duplicates some necessary parts of qemuSaveImageStartVM() because the external snapshot memory state is done by qemuSaveImageCreate(). Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 115 +++++++++++++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index ff85d56572..538da6570a 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2004,6 +2004,22 @@ qemuSnapshotRevertWriteMetadata(virDomainObj *vm, } =20 =20 +typedef struct _qemuSnapshotRevertMemoryData { + int fd; + char *path; + virQEMUSaveData *data; +} qemuSnapshotRevertMemoryData; + + +static void +qemuSnapshotClearRevertMemoryData(qemuSnapshotRevertMemoryData *memdata) +{ + VIR_FORCE_CLOSE(memdata->fd); + virQEMUSaveDataFree(memdata->data); +} +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(qemuSnapshotRevertMemoryData, qemuSnapsho= tClearRevertMemoryData); + + /** * qemuSnapshotRevertExternalPrepare: * @vm: domain object @@ -2011,15 +2027,13 @@ qemuSnapshotRevertWriteMetadata(virDomainObj *vm, * @snap: snapshot object we are reverting to * @config: live domain definition * @inactiveConfig: offline domain definition - * memsnapFD: pointer to store memory state file FD or NULL - * memsnapPath: pointer to store memory state file path or NULL + * @memdata: struct with data to load memory state * * Prepare new temporary snapshot definition @tmpsnapdef that will * be used while creating new overlay files after reverting to snapshot * @snap. In case we are reverting to snapshot with memory state it will - * open it and pass FD via @memsnapFD and path to the file via - * @memsnapPath, caller is responsible for freeing both @memsnapFD and - * memsnapPath. + * open it and store necessary data in @memdata. Caller is responsible + * to clear the data by using qemuSnapshotClearRevertMemoryData(). * * Returns 0 in success, -1 on error. */ @@ -2029,8 +2043,7 @@ qemuSnapshotRevertExternalPrepare(virDomainObj *vm, virDomainMomentObj *snap, virDomainDef *config, virDomainDef *inactiveConfig, - int *memsnapFD, - char **memsnapPath) + qemuSnapshotRevertMemoryData *memdata) { size_t i; bool active =3D virDomainObjIsActive(vm); @@ -2065,12 +2078,20 @@ qemuSnapshotRevertExternalPrepare(virDomainObj *vm, return -1; } =20 - if (memsnapFD && memsnapPath && snapdef->memorysnapshotfile) { + if (memdata && snapdef->memorysnapshotfile) { virQEMUDriver *driver =3D ((qemuDomainObjPrivate *) vm->privateDat= a)->driver; - g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driv= er); + g_autoptr(virDomainDef) savedef =3D NULL; =20 - *memsnapPath =3D snapdef->memorysnapshotfile; - *memsnapFD =3D qemuDomainOpenFile(cfg, NULL, *memsnapPath, O_RDONL= Y, NULL); + memdata->path =3D snapdef->memorysnapshotfile; + memdata->fd =3D qemuSaveImageOpen(driver, NULL, memdata->path, + &savedef, &memdata->data, + false, NULL, false, false); + + if (memdata->fd < 0) + return -1; + + if (!virDomainDefCheckABIStability(savedef, domdef, driver->xmlop= t)) + return -1; } =20 return 0; @@ -2254,13 +2275,16 @@ qemuSnapshotRevertActive(virDomainObj *vm, virObjectEvent *event =3D NULL; virObjectEvent *event2 =3D NULL; virDomainMomentObj *loadSnap =3D NULL; - VIR_AUTOCLOSE memsnapFD =3D -1; - char *memsnapPath =3D NULL; int detail; bool defined =3D false; qemuDomainSaveCookie *cookie =3D (qemuDomainSaveCookie *) snapdef->coo= kie; int rc; g_autoptr(virDomainSnapshotDef) tmpsnapdef =3D NULL; + g_auto(qemuSnapshotRevertMemoryData) memdata =3D { -1, NULL, NULL }; + g_autoptr(virCommand) cmd =3D NULL; + g_autofree char *errbuf =3D NULL; + VIR_AUTOCLOSE intermediatefd =3D -1; + int memrc =3D 0; =20 start_flags |=3D VIR_QEMU_PROCESS_START_PAUSED; =20 @@ -2284,7 +2308,7 @@ qemuSnapshotRevertActive(virDomainObj *vm, =20 if (qemuSnapshotRevertExternalPrepare(vm, tmpsnapdef, snap, *config, *inactiveConfig, - &memsnapFD, &memsnapPath) < = 0) { + &memdata) < 0) { return -1; } } else { @@ -2298,6 +2322,30 @@ qemuSnapshotRevertActive(virDomainObj *vm, =20 virDomainObjAssignDef(vm, config, true, NULL); =20 + if (virDomainSnapshotIsExternal(snap) && memdata.data) { + virQEMUSaveHeader *header =3D &memdata.data->header; + + if (header && (header->version =3D=3D 2) && + (header->compressed !=3D QEMU_SAVE_FORMAT_RAW)) { + if (!(cmd =3D qemuSaveImageGetCompressionCommand(header->compr= essed))) + return -1; + + intermediatefd =3D memdata.fd; + memdata.fd =3D -1; + + virCommandSetInputFD(cmd, intermediatefd); + virCommandSetOutputFD(cmd, &memdata.fd); + virCommandSetErrorBuffer(cmd, &errbuf); + virCommandDoAsyncIO(cmd); + + if (virCommandRunAsync(cmd, NULL) < 0) { + memdata.fd =3D intermediatefd; + intermediatefd =3D -1; + return -1; + } + } + } + /* No cookie means libvirt which saved the domain was too old to * mess up the CPU definitions. */ @@ -2307,17 +2355,48 @@ qemuSnapshotRevertActive(virDomainObj *vm, =20 rc =3D qemuProcessStart(snapshot->domain->conn, driver, vm, cookie ? cookie->cpu : NULL, - VIR_ASYNC_JOB_SNAPSHOT, NULL, memsnapFD, - memsnapPath, loadSnap, + VIR_ASYNC_JOB_SNAPSHOT, "stdio", + memdata.fd, memdata.path, loadSnap, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags); + + if (virDomainSnapshotIsExternal(snap) && memdata.data) { + if (intermediatefd !=3D -1) { + virErrorPtr orig_err =3D NULL; + + if (rc < 0) { + /* if there was an error setting up qemu, the intermediate + * process will wait forever to write to stdout, so we + * must manually kill it and ignore any error related to + * the process + */ + virErrorPreserveLast(&orig_err); + VIR_FORCE_CLOSE(intermediatefd); + VIR_FORCE_CLOSE(memdata.fd); + } + + memrc =3D virCommandWait(cmd, NULL); + VIR_DEBUG("Decompression binary stderr: %s", NULLSTR(errbuf)); + virErrorRestore(&orig_err); + } + if (VIR_CLOSE(memdata.fd) < 0) { + virReportSystemError(errno, _("cannot close file: %1$s"), memd= ata.path); + memrc =3D -1; + } + + /* qemuProcessStart doesn't unset the qemu error reporting infrast= ructure + * in case of migration (which is used in this case) so we need to= reset it + * so that the handle to virtlogd is not held open unnecessarily */ + qemuMonitorSetDomainLog(qemuDomainGetMonitor(vm), NULL, NULL, NULL= ); + } + virDomainAuditStart(vm, "from-snapshot", rc >=3D 0); detail =3D VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT; event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, detail); virObjectEventStateQueue(driver->domainEventState, event); - if (rc < 0) + if (rc < 0 || memrc < 0) return -1; =20 =20 @@ -2428,7 +2507,7 @@ qemuSnapshotRevertInactive(virDomainObj *vm, =20 if (qemuSnapshotRevertExternalPrepare(vm, tmpsnapdef, snap, NULL, *inactiveConfig, - NULL, NULL) < 0) { + NULL) < 0) { return -1; } =20 --=20 2.41.0 From nobody Fri May 17 02:41:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1693557164; cv=none; d=zohomail.com; s=zohoarc; b=OuVpa+cpjN5GPqpQhAMmfEJgZh4270NujosJUBsqAfOwmaTkLMIoYb033ChBGhgE/mi5+P9kxrQZrBNul8gILMBOXhrlkTLFgbDlodO3kmd5WMqK6lEeGYX7rrfwjKa7bmpfemELqCAd/Z1ZPv+ttnBNk7uO2wBkgdPoYdIT/KA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557164; 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=uwSPJbxPxDV84fa4Suxyu1kglScScmk40L2/t+LH0jo=; b=Yi9XdTEbnkjGyCtDpwE21q6iF2Vkwf1yf2zgIRx09NkFqP3Sm6i9yBEIfJg7GrJHwCKgi/M2W7/f2TOI5sF3KZ4revxtRRBt0ozrWzmYrXa1rCdPKFhPJduUtgD9tzeJoWINnukplqLDOPC+C81+pNQIR2M7wAhDxMji8tXlrpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1693557164583900.0165754929391; Fri, 1 Sep 2023 01:32:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-520-6600BpCLN6y5_IBHwO_Iqw-1; Fri, 01 Sep 2023 04:32:39 -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 C4A893C11C8F; Fri, 1 Sep 2023 08:32:36 +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 AF6611121331; Fri, 1 Sep 2023 08:32:36 +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 765C319451DE; Fri, 1 Sep 2023 08:32:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5470F19472AC for ; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4FA2BC15BBA; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id E75EAC15BAE for ; Fri, 1 Sep 2023 08:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693557163; 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=uwSPJbxPxDV84fa4Suxyu1kglScScmk40L2/t+LH0jo=; b=ioZT6UUFUfqqBSpTX5CBOR2GsTqorEAG+pEaiZ0DqLKU+9LhXvbD+9sSEFb//cpkpD7snK YKBvOWpZ7QI8l9wRacQyEcjRHWa3s9v5U1OWzU8setvqG1z1cCtVqvgM5rQfUAU8G6kQyw jqSJupDe3uu44cd7e7SOAusMVAaIQYk= X-MC-Unique: 6600BpCLN6y5_IBHwO_Iqw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 5/6] NEWS: document support for reverting external snapshots Date: Fri, 1 Sep 2023 10:32:16 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: 1693557166796100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- NEWS.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e40c8ac259..a3be76d6cc 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -28,6 +28,14 @@ v9.7.0 (unreleased) 2) pre-binding the variant driver using the ``--driver`` option of ``virsh nodedev-detach``. =20 + * QEMU: implement reverting external snapshots + + Reverting external snapshots is now possible using the existing API + ``virDomainSnapshotRevert()``. Management application can check host + capabilities for ```` element within the list of + guest features to see if the current libvirt supports both deleting + and reverting external snapshots. + * **Improvements** =20 * **Bug fixes** --=20 2.41.0 From nobody Fri May 17 02:41:33 2024 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=1693557159; cv=none; d=zohomail.com; s=zohoarc; b=OYjcxqAolgDHQtBvdZWdCILMZ0AGJqVZZDfOSeqwU7PjVmLyuw42L2TCf8sGIibwkyDepK7O5Z8t1izzN3ZuwatAHB41+u3tYVuvCrJ2DidbU9hiL9iAPASd+bI3Rw0tr5Mldfme2d2hxGlbeUnuwEOk4UjLYAFJu74a7sQTwQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693557159; 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=RrSOyiGVT51v8FfpdIk3XRUef+A6hOHh/ZlPP6qmXI0=; b=M/fBg+3ewF6fEnTBFsX1RSCYgiN9DK1lqSTOWLtxVweZdL9WT3BXONG08srCXy15KXYiSgI4Qz50OF8IgIHPrd8AuQW/HzyN8BuSfdcdU/q7JDtjJgi772PP7FXH0NH1dniVzZgfJpKg4YkiX4pthOq0zedsy2+jCPVSY/V2oJU= 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 1693557159325112.6866572818243; Fri, 1 Sep 2023 01:32:39 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-dltKx5DePKar9n2uN-uscw-1; Fri, 01 Sep 2023 04:32:33 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A18E429DD99A; Fri, 1 Sep 2023 08:32:31 +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 8DC9A6466B; Fri, 1 Sep 2023 08:32:31 +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 CF8B919472BB; Fri, 1 Sep 2023 08:32:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E9FBA19472BA for ; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E5374C15BBA; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.225.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88DA7C15BAE for ; Fri, 1 Sep 2023 08:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693557158; 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=RrSOyiGVT51v8FfpdIk3XRUef+A6hOHh/ZlPP6qmXI0=; b=WPyYeNPmyn9s7DkGcsnZ2Tzla2W4PJ2zBtRF2ZV8s1dyb96tqBR9MamR4g+Hdjo2yw61+g hKSHZqw+ULJob9MzK8lBIzn5Vvk2KudOJCU3nHtMkiRTRNLFnxtyd13aG69dBVDVb2Oa29 CxR/ahjET924APsKYRf5GHUSN+pdG2k= X-MC-Unique: dltKx5DePKar9n2uN-uscw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 6/6] Revert "capabilities: report full external snapshot support" Date: Fri, 1 Sep 2023 10:32:17 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.5 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: 1693557160107100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Reverting external snapshot for running VM doesn't work correctly so we should not report this capability until it is fixed. This reverts commit de71573bfec7f3acd22ec74794318de121716e21. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- docs/formatcaps.rst | 7 ------- src/conf/capabilities.c | 1 - src/conf/capabilities.h | 1 - src/conf/schemas/capability.rng | 5 ----- src/qemu/qemu_capabilities.c | 1 - tests/qemucaps2xmloutdata/caps.aarch64+hvf.xml | 1 - tests/qemucaps2xmloutdata/caps.aarch64.xml | 1 - tests/qemucaps2xmloutdata/caps.ppc.xml | 1 - tests/qemucaps2xmloutdata/caps.ppc64.xml | 1 - tests/qemucaps2xmloutdata/caps.riscv64.xml | 1 - tests/qemucaps2xmloutdata/caps.s390x.xml | 1 - tests/qemucaps2xmloutdata/caps.sparc.xml | 1 - tests/qemucaps2xmloutdata/caps.x86_64+hvf.xml | 1 - tests/qemucaps2xmloutdata/caps.x86_64.xml | 1 - 14 files changed, 24 deletions(-) diff --git a/docs/formatcaps.rst b/docs/formatcaps.rst index 95502c511f..bb8bc663d2 100644 --- a/docs/formatcaps.rst +++ b/docs/formatcaps.rst @@ -134,12 +134,6 @@ The ```` element will typically wrap up the fo= llowing elements: creating external disk snapshots is supported. If absent, creating e= xternal snapshots may still be supported, but it requires attempting the API= and checking for an error to find out for sure. :since:`Since 1.2.3` - ``externalSnapshot`` - If this element is present, the hypervisor supports deleting and - reverting external snapshots including memory state. Support for cre= ation - of external snapshots is reported via the ``disksnapshot`` feature f= lag. - Management applications can now switch from internal snapshots to ex= ternal - snapshots. :since:`Since 9.7.0` =20 Examples ~~~~~~~~ @@ -324,7 +318,6 @@ capabilities enabled in the chip and BIOS you will see: - =20 diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 34f04cb7d3..56768ce6e0 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -508,7 +508,6 @@ static const struct virCapsGuestFeatureInfo virCapsGues= tFeatureInfos[VIR_CAPS_GU [VIR_CAPS_GUEST_FEATURE_TYPE_DEVICEBOOT] =3D { "deviceboot", false }, [VIR_CAPS_GUEST_FEATURE_TYPE_DISKSNAPSHOT] =3D { "disksnapshot", true = }, [VIR_CAPS_GUEST_FEATURE_TYPE_HAP] =3D { "hap", true }, - [VIR_CAPS_GUEST_FEATURE_TYPE_EXTERNAL_SNAPSHOT] =3D { "externalSnapsho= t", false }, }; =20 =20 diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 9eaf6e2807..c78e3e52fa 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -40,7 +40,6 @@ typedef enum { VIR_CAPS_GUEST_FEATURE_TYPE_DEVICEBOOT, VIR_CAPS_GUEST_FEATURE_TYPE_DISKSNAPSHOT, VIR_CAPS_GUEST_FEATURE_TYPE_HAP, - VIR_CAPS_GUEST_FEATURE_TYPE_EXTERNAL_SNAPSHOT, =20 VIR_CAPS_GUEST_FEATURE_TYPE_LAST } virCapsGuestFeatureType; diff --git a/src/conf/schemas/capability.rng b/src/conf/schemas/capability.= rng index b1968df258..83b414961a 100644 --- a/src/conf/schemas/capability.rng +++ b/src/conf/schemas/capability.rng @@ -493,11 +493,6 @@ - - - - - diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 05cc11218a..40eacf0f4d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1121,7 +1121,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_DEVI= CEBOOT); virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEATURE= _TYPE_DISKSNAPSHOT, true, false); - virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_EXTE= RNAL_SNAPSHOT); =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG)) { virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, diff --git a/tests/qemucaps2xmloutdata/caps.aarch64+hvf.xml b/tests/qemucap= s2xmloutdata/caps.aarch64+hvf.xml index b9a5b5a1d6..b53a886b90 100644 --- a/tests/qemucaps2xmloutdata/caps.aarch64+hvf.xml +++ b/tests/qemucaps2xmloutdata/caps.aarch64+hvf.xml @@ -21,7 +21,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.aarch64.xml b/tests/qemucaps2xm= loutdata/caps.aarch64.xml index 61512ed740..5dca6d3102 100644 --- a/tests/qemucaps2xmloutdata/caps.aarch64.xml +++ b/tests/qemucaps2xmloutdata/caps.aarch64.xml @@ -21,7 +21,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.ppc.xml b/tests/qemucaps2xmlout= data/caps.ppc.xml index 86d6b85ae0..e7ba391795 100644 --- a/tests/qemucaps2xmloutdata/caps.ppc.xml +++ b/tests/qemucaps2xmloutdata/caps.ppc.xml @@ -19,7 +19,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.ppc64.xml b/tests/qemucaps2xmlo= utdata/caps.ppc64.xml index 90859f9594..85623f3980 100644 --- a/tests/qemucaps2xmloutdata/caps.ppc64.xml +++ b/tests/qemucaps2xmloutdata/caps.ppc64.xml @@ -20,7 +20,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.riscv64.xml b/tests/qemucaps2xm= loutdata/caps.riscv64.xml index c6fa950211..09b7eb7f2f 100644 --- a/tests/qemucaps2xmloutdata/caps.riscv64.xml +++ b/tests/qemucaps2xmloutdata/caps.riscv64.xml @@ -19,7 +19,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.s390x.xml b/tests/qemucaps2xmlo= utdata/caps.s390x.xml index 6379ab73e6..bb82a15040 100644 --- a/tests/qemucaps2xmloutdata/caps.s390x.xml +++ b/tests/qemucaps2xmloutdata/caps.s390x.xml @@ -20,7 +20,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.sparc.xml b/tests/qemucaps2xmlo= utdata/caps.sparc.xml index b5b158e430..9d977c4102 100644 --- a/tests/qemucaps2xmloutdata/caps.sparc.xml +++ b/tests/qemucaps2xmloutdata/caps.sparc.xml @@ -19,7 +19,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.x86_64+hvf.xml b/tests/qemucaps= 2xmloutdata/caps.x86_64+hvf.xml index f5e49ba4db..356819a6c6 100644 --- a/tests/qemucaps2xmloutdata/caps.x86_64+hvf.xml +++ b/tests/qemucaps2xmloutdata/caps.x86_64+hvf.xml @@ -22,7 +22,6 @@ - =20 diff --git a/tests/qemucaps2xmloutdata/caps.x86_64.xml b/tests/qemucaps2xml= outdata/caps.x86_64.xml index 8dd1439a80..35359780c4 100644 --- a/tests/qemucaps2xmloutdata/caps.x86_64.xml +++ b/tests/qemucaps2xmloutdata/caps.x86_64.xml @@ -22,7 +22,6 @@ - =20 --=20 2.41.0