From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241124; cv=none; d=zohomail.com; s=zohoarc; b=Bl5+1mxpKtxhG20wrQK2w+uNFCyVCAKjTBgjiLIV/wmz+icwgFSInvnobRQ2mH9G5oYcXIRYz2Ff01bi80aTZaIwVU6g5aa7p0Et2XS4AmpcVuMa3xuLJT1Sv5cz5nefqaFvIjqG2VAUVKoSnPS/TaJHbIfwN5AvBbONhRolLHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241124; 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=3UbcxLCIktu3nP7B6ZXwiBxeJNU62eQvt3MJKnh5uYc=; b=S5/zHdcPUX1DAZMj134anvI+o/Jtf/uBv6wEDyzLJEul+SReQ9yMWuRPQdnXuaL+ETHO/XUzuvgHCWDQLd42uNCdoZH6+FojpHLMk9qIYtXpSVOXRBNJ75c5TfxAunvssoLvZ1wlnInNuuHYsguaiC4jPYyI0fTqN8KrJCFcLbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241124670873.5611785419532; Mon, 15 Jun 2020 10:12:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-vYNsLbNZOAaqVWOGrfYTgA-1; Mon, 15 Jun 2020 13:11:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2478363FA; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0E9560C47; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7311195AA3; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAOvv004610 for ; Mon, 15 Jun 2020 13:10:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3BC21001901; Mon, 15 Jun 2020 17:10:24 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D7B2100164D for ; Mon, 15 Jun 2020 17:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241123; 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=3UbcxLCIktu3nP7B6ZXwiBxeJNU62eQvt3MJKnh5uYc=; b=UxlLqxgvyMXgorrHMC+4UfWaPWNteWGp9Nk/dpHaWRb6Q+CcqDzDm7JStfZKHBZ/7cZhCb zxAbhlyJmR7viA8Zl4rtgV5GuXfc7A0yrNgaME3FCz1S8fG/mgeyb4FCAIXOfP9toKudth 2SZKawzYZ9kdowDTmtqsnC1vJtLcqWo= X-MC-Unique: vYNsLbNZOAaqVWOGrfYTgA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/32] qemu: backup: Split up code traversing checkpoint list looking for bitmaps Date: Mon, 15 Jun 2020 19:09:48 +0200 Message-Id: <585af78e983d6d78b567c5801c54c288952464c0.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The algorithm is getting quite complex. Split out the lookup of range of backing chain storage sources and bitmaps contained in them which correspond to one checkpoint. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_backup.c | 111 ++++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index b317b841cd..69df6c14c6 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -173,72 +173,83 @@ qemuBackupDiskDataCleanup(virDomainObjPtr vm, } +static int +qemuBackupGetBitmapMergeRange(virStorageSourcePtr from, + const char *bitmapname, + virJSONValuePtr *actions, + virStorageSourcePtr *to, + const char *diskdst, + virHashTablePtr blockNamedNodeData) +{ + g_autoptr(virJSONValue) ret =3D virJSONValueNewArray(); + virStorageSourcePtr tmpsrc =3D NULL; + virStorageSourcePtr n; + bool foundbitmap =3D false; + + for (n =3D from; virStorageSourceIsBacking(n); n =3D n->backingStore) { + qemuBlockNamedNodeDataBitmapPtr bitmap =3D NULL; + + if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedN= odeData, + n, + bitmapname))) + break; + + foundbitmap =3D true; + + if (bitmap->inconsistent) { + virReportError(VIR_ERR_INVALID_ARG, + _("bitmap '%s' for image '%s%u' is inconsistent= "), + bitmap->name, diskdst, n->id); + return -1; + } + + if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(ret, + n->nodeformat, + bitmapname) <= 0) + return -1; + + tmpsrc =3D n; + } + + if (!foundbitmap) { + virReportError(VIR_ERR_INVALID_ARG, + _("failed to find bitmap '%s' in image '%s%u'"), + bitmapname, diskdst, from->id); + return -1; + } + + *actions =3D g_steal_pointer(&ret); + *to =3D tmpsrc; + + return 0; +} + + virJSONValuePtr qemuBackupDiskPrepareOneBitmapsChain(virDomainMomentDefPtr *incremental, virStorageSourcePtr backingChain, virHashTablePtr blockNamedNodeData, const char *diskdst) { - qemuBlockNamedNodeDataBitmapPtr bitmap; g_autoptr(virJSONValue) ret =3D NULL; size_t incridx =3D 0; + virStorageSourcePtr n =3D backingChain; ret =3D virJSONValueNewArray(); - if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeD= ata, - backingChain, - incremental[0]->n= ame))) { - virReportError(VIR_ERR_INVALID_ARG, - _("failed to find bitmap '%s' in image '%s%u'"), - incremental[0]->name, diskdst, backingChain->id); - return NULL; - } + for (incridx =3D 0; incremental[incridx]; incridx++) { + g_autoptr(virJSONValue) tmp =3D virJSONValueNewArray(); + virStorageSourcePtr tmpsrc =3D NULL; - while (bitmap) { - if (bitmap->inconsistent) { - virReportError(VIR_ERR_INVALID_ARG, - _("bitmap '%s' for image '%s%u' is inconsistent= "), - bitmap->name, diskdst, backingChain->id); + if (qemuBackupGetBitmapMergeRange(n, incremental[incridx]->name, + &tmp, &tmpsrc, diskdst, + blockNamedNodeData) < 0) return NULL; - } - if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(ret, - backingChain-= >nodeformat, - bitmap->name)= < 0) + if (virJSONValueArrayConcat(ret, tmp) < 0) return NULL; - if (backingChain->backingStore && - (bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedNo= deData, - backingChain->= backingStore, - incremental[in= cridx]->name))) { - backingChain =3D backingChain->backingStore; - continue; - } - - if (incremental[incridx + 1]) { - if ((bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNam= edNodeData, - backingCha= in, - incrementa= l[incridx + 1]->name))) { - incridx++; - continue; - } - - if (backingChain->backingStore && - (bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNam= edNodeData, - backingCha= in->backingStore, - incrementa= l[incridx + 1]->name))) { - incridx++; - backingChain =3D backingChain->backingStore; - continue; - } - - virReportError(VIR_ERR_INVALID_ARG, - _("failed to find bitmap '%s' in image '%s%u'"), - incremental[incridx]->name, diskdst, backingCha= in->id); - return NULL; - } else { - break; - } + n =3D tmpsrc; } return g_steal_pointer(&ret); --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241339; cv=none; d=zohomail.com; s=zohoarc; b=LdkzxBPPyBtnFiUilswkLBPwp2yVPdbI0F0TuXzoxqW3MD2zGKFz7lytX+C0RFMw3IxyuT2YHpML8Wn5SAqSaxJyj43UYR507R/+k5LxytJTZszI/o2n4JESGHbe/BXhixxAiLZBR6vLFGyie9i9ZHxkr/4vyPQn67ed4jCkai0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241339; 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=BfImQM4iQm8NlG8E/W1wushM2Wop4fnJ79hPJLvhLGk=; b=iVB+xJeV3BiRiq4yXRabTyZAOBmV6k8eX9Oh/iibnXPzJPmXC7BXOR5W79DVu+J1/9U/ArDVwuioTBFivE5QqrTpc4nDuJUHz4BmsMdXqYhq7WLGsy94XSlx+Hfwim8yXwUjqmrkWW/5sJd8WlvNyyG5FpvoijPs8wQZHh8XnAg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241339016672.0283352426102; Mon, 15 Jun 2020 10:15:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-0qs7MXopNzaA-mC4SCQT1A-1; Mon, 15 Jun 2020 13:10:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA29C10059B5; Mon, 15 Jun 2020 17:10:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD9DD5D9CC; Mon, 15 Jun 2020 17:10:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 539AF833C6; Mon, 15 Jun 2020 17:10:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAPrZ004628 for ; Mon, 15 Jun 2020 13:10:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9194A100238D; Mon, 15 Jun 2020 17:10:25 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0822E1001901 for ; Mon, 15 Jun 2020 17:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241337; 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=BfImQM4iQm8NlG8E/W1wushM2Wop4fnJ79hPJLvhLGk=; b=iZ2lP3roH3oY83KPd2yv6PwiSouzKter2MzJ0EzZzgQAelebm+8UrcqevUKZCH58i+BumW e5kR1/rbMFw2QvTTrXySUDvMDVpkfuFloQt+zsbNd9UKtpEhTzgB1lur+8C006lAiRh1M+ Ar5mROoEekgUXLTZPhzsMl+z8UzEy6U= X-MC-Unique: 0qs7MXopNzaA-mC4SCQT1A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/32] qemu: backup: Fix backup of disk skipped in an intermediate checkpoint Date: Mon, 15 Jun 2020 19:09:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If a disk is not captured by one of the intermediate checkpoints the code would fail, but we can easily calculate the bitmaps to merge correctly by skipping over checkpoints which don't describe the disk. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 24 ++++++++++++++++++++++++ tests/qemublocktest.c | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 69df6c14c6..686ed57e82 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -240,6 +240,30 @@ qemuBackupDiskPrepareOneBitmapsChain(virDomainMomentDe= fPtr *incremental, for (incridx =3D 0; incremental[incridx]; incridx++) { g_autoptr(virJSONValue) tmp =3D virJSONValueNewArray(); virStorageSourcePtr tmpsrc =3D NULL; + virDomainCheckpointDefPtr chkdef =3D (virDomainCheckpointDefPtr) i= ncremental[incridx]; + bool checkpoint_has_disk =3D false; + size_t i; + + for (i =3D 0; i < chkdef->ndisks; i++) { + if (STRNEQ_NULLABLE(diskdst, chkdef->disks[i].name)) + continue; + + if (chkdef->disks[i].type =3D=3D VIR_DOMAIN_CHECKPOINT_TYPE_BI= TMAP) + checkpoint_has_disk =3D true; + + break; + } + + if (!checkpoint_has_disk) { + if (!incremental[incridx + 1]) { + virReportError(VIR_ERR_INVALID_ARG, + _("disk '%s' not found in checkpoint '%s'"), + diskdst, incremental[incridx]->name); + return NULL; + } + + continue; + } if (qemuBackupGetBitmapMergeRange(n, incremental[incridx]->name, &tmp, &tmpsrc, diskdst, diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 0cdedb9ad4..f00d2ff129 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -727,6 +727,12 @@ testQemuBackupGetIncrementalMoment(const char *name) if (!(checkpoint =3D virDomainCheckpointDefNew())) abort(); + checkpoint->disks =3D g_new0(virDomainCheckpointDiskDef, 1); + checkpoint->ndisks =3D 1; + + checkpoint->disks[0].name =3D g_strdup("testdisk"); + checkpoint->disks[0].type =3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP; + checkpoint->parent.name =3D g_strdup(name); return (virDomainMomentDefPtr) checkpoint; --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241086; cv=none; d=zohomail.com; s=zohoarc; b=h/1fXxhmHkTkyjzVp1h55knPaBwVY2lcHTgd4YjIIGpmaHhbF9Ubu9Ad7dtNCCf6rwiUK5aoDFfaT7w3uqnyPuliNq541xKrC2VYgwEi333OoCzW4jTv5bLSXKTUoh7g7B+3kiRzj4wwMzqMXwf+nVzA90CA0y9dz2prk5jyRr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241086; 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=2hiXhSamIUpzvnioIS2K4xGQLPFrYl4kULOxytU2lIo=; b=fP60OA98daOZGZb9sNRyGS72VLXX5Y+GoWTSNVkrfAskUVyNgr0nj3faEMkbZg3FdW/rgmgoXpbh9uaEphO8a3juXD0acvw3ufxnWCkcYe+Uasr6N+mRnHCKXaWbPzHSJQYRCgcA1SmyNVTA0RnGDbHlaa3MZKAkPWB+A84AUSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1592241086382526.3735660007088; Mon, 15 Jun 2020 10:11:26 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157-Qp_2oB7hNVSF-5Ehzi3AgA-1; Mon, 15 Jun 2020 13:11:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F004D873406; Mon, 15 Jun 2020 17:11:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D16B25C240; Mon, 15 Jun 2020 17:11:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A395A95AA9; Mon, 15 Jun 2020 17:11:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAQch004639 for ; Mon, 15 Jun 2020 13:10:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 83D161001901; Mon, 15 Jun 2020 17:10:26 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF8DD100164D for ; Mon, 15 Jun 2020 17:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241085; 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=2hiXhSamIUpzvnioIS2K4xGQLPFrYl4kULOxytU2lIo=; b=bRphiS1BnJZZb5Upa8Jn38wNvDLEJ0A7nmYKsWaei0ONMU80qvWzPVWIugNrKe7mghSSiS StwIFRdyWd98uD6SXDDfA70idpYu4wzgTa3tVEK/+GZDls1uMxXJ7OlV6eG8Ck/aG2jxdp Qiwco05sJEe+Ct2qkt2cYhiSEjQP3YM= X-MC-Unique: Qp_2oB7hNVSF-5Ehzi3AgA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/32] conf: backup: Store incremental backup checkpoint name per-disk Date: Mon, 15 Jun 2020 19:09:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In preparation to allow heterogenous backups store the 'incremental' field per-disk and fill it by default from the per-backup field. Having this will be important once we'll want to allow incremental backup working while hotplugging a new disk. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/conf/backup_conf.c | 8 ++++++++ src/conf/backup_conf.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index c0c6f25d10..92106d8aaa 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -72,6 +72,7 @@ virDomainBackupDefFree(virDomainBackupDefPtr def) virDomainBackupDiskDefPtr disk =3D def->disks + i; g_free(disk->name); + g_free(disk->incremental); g_free(disk->exportname); g_free(disk->exportbitmap); virObjectUnref(disk->store); @@ -505,5 +506,12 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def, } } + for (i =3D 0; i < def->ndisks; i++) { + virDomainBackupDiskDefPtr backupdisk =3D &def->disks[i]; + + if (def->incremental && !backupdisk->incremental) + backupdisk->incremental =3D g_strdup(def->incremental); + } + return 0; } diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index b5685317c5..172eb1cf1c 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -51,6 +51,7 @@ typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr; struct _virDomainBackupDiskDef { char *name; /* name matching the (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241051757636.0561961509308; Mon, 15 Jun 2020 10:10:51 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-BzpyDl6JMw2lWtjMKAJCNw-1; Mon, 15 Jun 2020 13:10:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31C6210059D0; Mon, 15 Jun 2020 17:10:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0674F7CAA8; Mon, 15 Jun 2020 17:10:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B73111809561; Mon, 15 Jun 2020 17:10:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHARDU004659 for ; Mon, 15 Jun 2020 13:10:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70269100164D; Mon, 15 Jun 2020 17:10:27 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD0341001901 for ; Mon, 15 Jun 2020 17:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241050; 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=V8wKSia20I0wSaDWIpAi9ghJo3cxHzVz3v6/z6HIbUs=; b=HntLyG3arWzvCGalcNoK8rjjqdQM9zbvyy1U/Fu4u1qrCxXxH1Gow8AMSM8iy2/cKXAQrC dEjmfI9v/5fvs5RNuCfwaB2xuefi4Go1e+4GZz3frL+ekhkJr6fQkfQUKGXVQdw3Pspl9Y UAVdzDrHb5HI0ivzhQvpKCJ4HFfII8M= X-MC-Unique: BzpyDl6JMw2lWtjMKAJCNw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/32] qemu: backup: Move fetching of checkpoint list for incremental backup Date: Mon, 15 Jun 2020 19:09:51 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fetch the checkpoint list for every disk specifically based on the new per-disk 'incremental' field. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_backup.c | 108 ++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 686ed57e82..495da86ff0 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -173,6 +173,50 @@ qemuBackupDiskDataCleanup(virDomainObjPtr vm, } +/** + * qemuBackupBeginCollectIncrementalCheckpoints: + * @vm: domain object + * @incrFrom: name of checkpoint representing starting point of incrementa= l backup + * + * Returns a NULL terminated list of pointers to checkpoint definitions in + * chronological order starting from the 'current' checkpoint until reachi= ng + * @incrFrom. + */ +static virDomainMomentDefPtr * +qemuBackupBeginCollectIncrementalCheckpoints(virDomainObjPtr vm, + const char *incrFrom) +{ + virDomainMomentObjPtr n =3D virDomainCheckpointGetCurrent(vm->checkpoi= nts); + g_autofree virDomainMomentDefPtr *incr =3D NULL; + size_t nincr =3D 0; + + while (n) { + virDomainMomentDefPtr def =3D n->def; + + if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) + return NULL; + + if (STREQ(def->name, incrFrom)) { + def =3D NULL; + if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) + return NULL; + + return g_steal_pointer(&incr); + } + + if (!n->def->parent_name) + break; + + n =3D virDomainCheckpointFindByName(vm->checkpoints, n->def->paren= t_name); + } + + virReportError(VIR_ERR_OPERATION_INVALID, + _("could not locate checkpoint '%s' for incremental bac= kup"), + incrFrom); + return NULL; +} + + static int qemuBackupGetBitmapMergeRange(virStorageSourcePtr from, const char *bitmapname, @@ -334,11 +378,11 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, struct qemuBackupDiskData *dd, virJSONValuePtr actions, bool pull, - virDomainMomentDefPtr *incremental, virHashTablePtr blockNamedNodeData, virQEMUDriverConfigPtr cfg) { qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autofree virDomainMomentDefPtr *incremental =3D NULL; /* set data structure */ dd->backupdisk =3D backupdisk; @@ -363,7 +407,7 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, * pull mode: * both: original disk */ - if (pull || (incremental && dd->store->format >=3D VIR_STORAGE_FILE_BA= CKING)) { + if (pull || (dd->backupdisk->incremental && dd->store->format >=3D VIR= _STORAGE_FILE_BACKING)) { dd->backingStore =3D dd->domdisk->src; } else { dd->backingStore =3D dd->terminator =3D virStorageSourceNew(); @@ -375,7 +419,10 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, if (qemuDomainPrepareStorageSourceBlockdev(NULL, dd->store, priv, cfg)= < 0) return -1; - if (incremental) { + if (dd->backupdisk->incremental) { + if (!(incremental =3D qemuBackupBeginCollectIncrementalCheckpoints= (vm, dd->backupdisk->incremental))) + return -1; + if (dd->backupdisk->exportbitmap) dd->incrementalBitmap =3D g_strdup(dd->backupdisk->exportbitma= p); else @@ -444,7 +491,6 @@ qemuBackupDiskPrepareDataOnePull(virJSONValuePtr action= s, static ssize_t qemuBackupDiskPrepareData(virDomainObjPtr vm, virDomainBackupDefPtr def, - virDomainMomentDefPtr *incremental, virHashTablePtr blockNamedNodeData, virJSONValuePtr actions, virQEMUDriverConfigPtr cfg, @@ -467,8 +513,7 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm, ndisks++; if (qemuBackupDiskPrepareDataOne(vm, backupdisk, dd, actions, pull, - incremental, blockNamedNodeData, - cfg) < 0) + blockNamedNodeData, cfg) < 0) goto error; if (pull) { @@ -625,50 +670,6 @@ qemuBackupBeginPullExportDisks(virDomainObjPtr vm, } -/** - * qemuBackupBeginCollectIncrementalCheckpoints: - * @vm: domain object - * @incrFrom: name of checkpoint representing starting point of incrementa= l backup - * - * Returns a NULL terminated list of pointers to checkpoint definitions in - * chronological order starting from the 'current' checkpoint until reachi= ng - * @incrFrom. - */ -static virDomainMomentDefPtr * -qemuBackupBeginCollectIncrementalCheckpoints(virDomainObjPtr vm, - const char *incrFrom) -{ - virDomainMomentObjPtr n =3D virDomainCheckpointGetCurrent(vm->checkpoi= nts); - g_autofree virDomainMomentDefPtr *incr =3D NULL; - size_t nincr =3D 0; - - while (n) { - virDomainMomentDefPtr def =3D n->def; - - if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) - return NULL; - - if (STREQ(def->name, incrFrom)) { - def =3D NULL; - if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) - return NULL; - - return g_steal_pointer(&incr); - } - - if (!n->def->parent_name) - break; - - n =3D virDomainCheckpointFindByName(vm->checkpoints, n->def->paren= t_name); - } - - virReportError(VIR_ERR_OPERATION_INVALID, - _("could not locate checkpoint '%s' for incremental bac= kup"), - incrFrom); - return NULL; -} - - void qemuBackupJobTerminate(virDomainObjPtr vm, qemuDomainJobStatus jobstatus) @@ -802,7 +803,6 @@ qemuBackupBegin(virDomainObjPtr vm, bool pull =3D false; virDomainMomentObjPtr chk =3D NULL; g_autoptr(virDomainCheckpointDef) chkdef =3D NULL; - g_autofree virDomainMomentDefPtr *incremental =3D NULL; g_autoptr(virJSONValue) actions =3D NULL; struct qemuBackupDiskData *dd =3D NULL; ssize_t ndd =3D 0; @@ -870,10 +870,6 @@ qemuBackupBegin(virDomainObjPtr vm, if (virDomainBackupAlignDisks(def, vm->def, suffix) < 0) goto endjob; - if (def->incremental && - !(incremental =3D qemuBackupBeginCollectIncrementalCheckpoints(vm,= def->incremental))) - goto endjob; - actions =3D virJSONValueNewArray(); /* The 'chk' checkpoint must be rolled back if the transaction command @@ -887,7 +883,7 @@ qemuBackupBegin(virDomainObjPtr vm, if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEMU_ASYNC_= JOB_BACKUP))) goto endjob; - if ((ndd =3D qemuBackupDiskPrepareData(vm, def, incremental, blockName= dNodeData, + if ((ndd =3D qemuBackupDiskPrepareData(vm, def, blockNamedNodeData, actions, cfg, &dd)) <=3D 0) { if (ndd =3D=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241088; cv=none; d=zohomail.com; s=zohoarc; b=A5gcB/kodWj95APA+83pFodMpLDsWcxste/18BcYSefuXWZXxTuz4OPJy7Y6OMzu3pT8bTG/cn7gGmF/TdU8bmiHwDf94Fgw9Yfr3aE64q2Dv0REJHn6h0UfbbANIfdStwAjGoWtc1Tx3mgII6SjSaDFeQMa61QIfG7qPCGeIPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241088; 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=m7xHITKypdvtTPs6v3LOOWpxt8egrXUTxQbdnTYfyag=; b=M+adS/OA+jH3qrE+g0k0khdOTzU/uloZOx55ojPqTcPhvgJ5kSlfkPrnvOb50VYqEP78/YwT7/z58in8lOuZTkonDS3Bs8Fajb/kBk5870lhWoKNczScAfrBO6s5RJMUcC6Tc4VQIX9NR7KTBxT8JfHOiMLJoF5zPtfRPhXmAe4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241088867879.1800881324317; Mon, 15 Jun 2020 10:11:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-AGaqyF5nN5mpMiEceR7bsw-1; Mon, 15 Jun 2020 13:11:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E71C873410; Mon, 15 Jun 2020 17:11:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 031E361983; Mon, 15 Jun 2020 17:11:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C4375180530C; Mon, 15 Jun 2020 17:11:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHASwJ004667 for ; Mon, 15 Jun 2020 13:10:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6FE991002394; Mon, 15 Jun 2020 17:10:28 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0AE9100164D for ; Mon, 15 Jun 2020 17:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241087; 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=m7xHITKypdvtTPs6v3LOOWpxt8egrXUTxQbdnTYfyag=; b=E7rFGcWz+PLLm3uimY++WQc2DrLNS+2grPr0gyw0jVquhe9pV8QMAJTkQsByaq2wbb9eT5 GjBMXVonXRNfQj4Uj0QjQ241Czca1qup8GNFCshuTxIhqkdAIuhAETYxReQlWRZ/udweJR 9mVO3jceOWJZLlKbCEtkiHfcuPbNeRU= X-MC-Unique: AGaqyF5nN5mpMiEceR7bsw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/32] qemublocktest: Add 'empty' test case for bitmaps Date: Mon, 15 Jun 2020 19:09:52 +0200 Message-Id: <77f93a09e9203a6946fe0557ca4e1144dba65175.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add test data for an image without bitmaps. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 4 ++ tests/qemublocktestdata/bitmap/empty.json | 70 +++++++++++++++++++++++ tests/qemublocktestdata/bitmap/empty.out | 1 + 3 files changed, 75 insertions(+) create mode 100644 tests/qemublocktestdata/bitmap/empty.json create mode 100644 tests/qemublocktestdata/bitmap/empty.out diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index f00d2ff129..8d613d7cac 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1292,6 +1292,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BITMAP_DETECT("empty"); + TEST_BITMAP_DETECT("basic"); TEST_BITMAP_DETECT("synthetic"); TEST_BITMAP_DETECT("snapshots"); @@ -1360,6 +1362,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BITMAP_VALIDATE("empty", "a", false); + TEST_BITMAP_VALIDATE("basic", "a", true); TEST_BITMAP_VALIDATE("basic", "b", true); TEST_BITMAP_VALIDATE("basic", "c", true); diff --git a/tests/qemublocktestdata/bitmap/empty.json b/tests/qemublocktes= tdata/bitmap/empty.json new file mode 100644 index 0000000000..ec43b25f0d --- /dev/null +++ b/tests/qemublocktestdata/bitmap/empty.json @@ -0,0 +1,70 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/tmp/pull4.qcow2", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/pull4.qcow2", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/tmp/pull4.qcow2", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/pull4.qcow2", + "encryption_key_missing": false + } +] diff --git a/tests/qemublocktestdata/bitmap/empty.out b/tests/qemublocktest= data/bitmap/empty.out new file mode 100644 index 0000000000..3787cbd354 --- /dev/null +++ b/tests/qemublocktestdata/bitmap/empty.out @@ -0,0 +1 @@ +libvirt-1-format: --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241130; cv=none; d=zohomail.com; s=zohoarc; b=PFHL2u5zRj5165KmoZ745SaBF2J8sctfl6MrrraEcRwJqjJagvECxxDhwpkd4VLr8zPr9iQtJ9YCjzdSFQitH03zUxkc3Z1uEaP34EKpFeB/wQ1wMb6aPihpYKDTB+YQWuG5I6EUfHXgKaalbEFgV2n4J49rfKGH/65hIBkhxYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241130; 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=ffsGb92HEpv7V7JsmFdeyCMGFNmI6FyslGhew6BYvpA=; b=mGeJ+ivvM5+MCA7zL3slGcDKMATkotFkdSE5FKKBcC3QFJirX81HzzOoxynBoK26YUMgoPnWbpIJGbTT/VNIxuns7X5oAcY68JQ5KDRm7RMfYxQXhJZrTGB2QA0+HegjSfCdDP1533tVMBbwukKhZ/JANFLA2MJMW0GDqDwKbrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 159224113039714.484596441060944; Mon, 15 Jun 2020 10:12:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-4Ez3Kz86PoavLeHdR3Q-5Q-1; Mon, 15 Jun 2020 13:11:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1D098018AC; Mon, 15 Jun 2020 17:11:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D52760C84; Mon, 15 Jun 2020 17:11:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6F6A495AAC; Mon, 15 Jun 2020 17:11:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHATpb004678 for ; Mon, 15 Jun 2020 13:10:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5D7E2100238D; Mon, 15 Jun 2020 17:10:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id C533E100238C for ; Mon, 15 Jun 2020 17:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241129; 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=ffsGb92HEpv7V7JsmFdeyCMGFNmI6FyslGhew6BYvpA=; b=g8nPkWzfs10df59IMPZHRye/3cRcwOsxtxueOdssQ1ilLyMlv4QAtkH0feVYgM0TXTQEie AkOScSHrqhwhe7EelYYVyk069GPVQLe06LqGipG9sd9hSG2REPMot+xAuwd8iAPDdPbww+ lQ2mF6t98HfktWszjLq66MFU/tX+4Jo= X-MC-Unique: 4Ez3Kz86PoavLeHdR3Q-5Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/32] qemublocktest: Add 'empty' case for incremental backup test Date: Mon, 15 Jun 2020 19:09:53 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the new test data when calculating incremental backup operations. As incremental backup fails with no bitmap the test code is modified to allow testing this case too. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 19 ++++++++++--------- .../backupmerge/empty-out.json | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 tests/qemublocktestdata/backupmerge/empty-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8d613d7cac..9e54c254e8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -793,17 +793,16 @@ testQemuBackupIncrementalBitmapCalculate(const void *= opaque) incremental =3D testQemuBackupGetIncremental(data->incremental); - if (!(mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incrementa= l, - data->chain, - nodedata, - "testdisk"))= ) { - VIR_TEST_VERBOSE("failed to calculate merged bitmaps"); - return -1; + if ((mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incremental, + data->chain, + nodedata, + "testdisk")))= { + if (!(actual =3D virJSONValueToString(mergebitmaps, true))) + return -1; + } else { + actual =3D g_strdup("NULL\n"); } - if (!(actual =3D virJSONValueToString(mergebitmaps, true))) - return -1; - return virTestCompareToFile(actual, expectpath); } @@ -1312,6 +1311,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); + TEST_BACKUP_BITMAP_CALCULATE("basic-flat", bitmapSourceChain, "current= ", "basic"); TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, = "d", "basic"); TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "ba= sic"); diff --git a/tests/qemublocktestdata/backupmerge/empty-out.json b/tests/qem= ublocktestdata/backupmerge/empty-out.json new file mode 100644 index 0000000000..7951defec1 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/empty-out.json @@ -0,0 +1 @@ +NULL --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241049; cv=none; d=zohomail.com; s=zohoarc; b=HK550drhS/QIKDLX5IBAFVaC0ms3LH0sVy1x68jLLNHkOTnTrHQ08W1COF2m38ijq/JWl8YgR3xE7CbBbEDd+2LY5fnC6wXEYcoyqkQruKjhhMrV0FepMjUk/anBXLoPG9V33JcDbAp29qMnajR7qR2rdVd0GNNtykAe5T3HEW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241049; 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=v3lMdMbCdJhxOerd4adLUI3Zh5ySaS7Ktm3XgrphbQA=; b=bl7Xq6+7i0LcQ4nwJKG99HgRijBMrCOWge5Ox6tcyJQXs4HruH5hPQoFSGdZmlrmsEni5+hu+0MV49zIv32ih7Rhs1BX4busGk40DSL+bGgVWATtqjsqR8WWL4G1/vESlu/5DUM8GvtV8lbgb6j6z3HGnOxVu9nKmcvWSzzNIZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241049267953.7071159611608; Mon, 15 Jun 2020 10:10:49 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-lf7C5t19M5yKHgLnPeSkfw-1; Mon, 15 Jun 2020 13:10:45 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1EB48735C2; Mon, 15 Jun 2020 17:10:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8546D19C79; Mon, 15 Jun 2020 17:10:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4CD7A833CF; Mon, 15 Jun 2020 17:10:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAUI9004697 for ; Mon, 15 Jun 2020 13:10:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4E20A10023A6; Mon, 15 Jun 2020 17:10:30 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id B52D6100164D for ; Mon, 15 Jun 2020 17:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241048; 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=v3lMdMbCdJhxOerd4adLUI3Zh5ySaS7Ktm3XgrphbQA=; b=Ye9S9q516TxfF6TVRk5NNrplGkHEPPxVXPb+Gm55F8j92zwrUKLj7loWRpOVKG47rX/1Nb 1LpyE/8VzNRNzD0xSkmeU+JNYOTKVHullpgih4XsUjuvJ9p8WMX6QYWq0HqvgZi9pUhUOz uDdfog+QGR7rXxzUKh/AvC+FnhtrsPo= X-MC-Unique: lf7C5t19M5yKHgLnPeSkfw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/32] qemublocktest: Add 'empty' case for checkpoint deletion Date: Mon, 15 Jun 2020 19:09:54 +0200 Message-Id: <8606ddbda69b77a0083db11ac757dddac6a16a03.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the new test data for checkpoint deletion testing. This test also requires modification of the internals to allow checking for test failure. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 13 +++++++------ .../checkpointdelete/empty-out.json | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 tests/qemublocktestdata/checkpointdelete/empty-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 9e54c254e8..1821c227d5 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -851,14 +851,13 @@ testQemuCheckpointDeleteMerge(const void *opaque) data->parentbitmap, actions, "testdisk", - &reopenimages) < 0) { - VIR_TEST_VERBOSE("failed to generate checkpoint delete transaction= \n"); - return -1; + &reopenimages) >=3D 0) { + if (virJSONValueToBuffer(actions, &buf, true) < 0) + return -1; + } else { + virBufferAddLit(&buf, "NULL\n"); } - if (virJSONValueToBuffer(actions, &buf, true) < 0) - return -1; - if (reopenimages) { virBufferAddLit(&buf, "reopen nodes:\n"); @@ -1333,6 +1332,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_CHECKPOINT_DELETE_MERGE("empty", "a", NULL, "empty"); + TEST_CHECKPOINT_DELETE_MERGE("basic-noparent", "a", NULL, "basic"); TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate1", "b", "a", "basic"); TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate2", "c", "b", "basic"); diff --git a/tests/qemublocktestdata/checkpointdelete/empty-out.json b/test= s/qemublocktestdata/checkpointdelete/empty-out.json new file mode 100644 index 0000000000..7951defec1 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/empty-out.json @@ -0,0 +1 @@ +NULL --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241094; cv=none; d=zohomail.com; s=zohoarc; b=LODu+7RBRtHDgQ2dfN3q1p4tOAWNsG6ndCklVuUnN1jYW/fSaDtGSwXrS1tRzymRBDXr3tDop5DWhFDV1DTyWgP9hYSm7341kttGV/xU0RN35Z5tBiD4NgEdBJl5eN1+cJW9YUpLsxRy59gHf2zBBAp6CH3Ud3VhRn9evYuuylI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241094; 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=VsabxMSvaBtR7/7KGszcJj70fLUG/He/MB5VbIVx/wY=; b=INzGFdqZfFYefmt9uTCp6nyvFFyM5l3ik4U0rYdLmtfoy0hhDCz0ElNQ44fqWFimHaxWBZ/RpEPHpd6pEQS+xzRt5AZySSV9YhBSgZiFqHrEV0jasveh3aKp8KNwg0LfYSIzOabrrkLILvzZ4DZhi5h5QRZZkGlvjBuu2S5Sokw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159224109406114.149292230639162; Mon, 15 Jun 2020 10:11:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-nlO-0ig5OcOmsub4zF-qZA-1; Mon, 15 Jun 2020 13:11:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F3315184D153; Mon, 15 Jun 2020 17:11:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D212C19C79; Mon, 15 Jun 2020 17:11:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A25C4180043A; Mon, 15 Jun 2020 17:11:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAV7i004709 for ; Mon, 15 Jun 2020 13:10:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 533A010246E2; Mon, 15 Jun 2020 17:10:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5041101E1C1 for ; Mon, 15 Jun 2020 17:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241092; 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=VsabxMSvaBtR7/7KGszcJj70fLUG/He/MB5VbIVx/wY=; b=aKRFsFNmD2AsO4SG4FjGXHp/KI5zCqmPLDLzN27b9GUpCn3raIFKp3cZ1vUSHPCbD1YyJO hPjqFbdep8rx+4sry3Zx+ZntQyrfR/yPKdTEVRHlQNhIqRfZAIdpM6EvLvHFUSKizOb0h0 0eJxZS7Ad4OUGH+3vEw+ul8nnOgqTAI= X-MC-Unique: nlO-0ig5OcOmsub4zF-qZA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/32] qemublocktest: Add 'empty' case for blockcopy bitmap handling test Date: Mon, 15 Jun 2020 19:09:55 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 3 +++ tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json | 0 tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json | 0 3 files changed, 3 insertions(+) create mode 100644 tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.= json create mode 100644 tests/qemublocktestdata/bitmapblockcopy/empty-shallow-o= ut.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 1821c227d5..2ddfab72eb 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1408,6 +1408,9 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BITMAP_BLOCKCOPY("empty-shallow", true, "empty"); + TEST_BITMAP_BLOCKCOPY("empty-deep", false, "empty"); + TEST_BITMAP_BLOCKCOPY("basic-shallow", true, "basic"); TEST_BITMAP_BLOCKCOPY("basic-deep", false, "basic"); diff --git a/tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json b/= tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json= b/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json new file mode 100644 index 0000000000..e69de29bb2 --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241058; cv=none; d=zohomail.com; s=zohoarc; b=b0KP47mftOklt+ce4Hurs3U3mn4BbR6mPOafPK0q2BOEvXvbwDft3A2VUsDbj/kuOYG6wen1h3+n+OwrQO4mNICiesg2dKrgKrCIRFuwG4X4/ZR7h1pUVAlq35NSD1gxsWRsxmAIj7aOfHZYPn+PaLpITy5D+SeBvCSig+MUBuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241058; 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=8mIgjU86mWdcj/gnZiBWpFXDvYvaeOlzH5eu5yYcGDo=; b=JvuachrOaFdKfvwPYZySQ0Ux86nQOWKmBdmNsjer0H5gD5w4ROvsmuXhvwQlofymPImHcvrbyJPgexs3rrTc0Xie5Wshdx4nmtnv76O4qzZXP8Zwj3tbkMZWubwyilzZfUbc4tf6cJEZ46qQ6irDtjXaW7SAsQ/ceVgydo9lMlk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241057992414.5042226141321; Mon, 15 Jun 2020 10:10:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-kcx5n8MkOiaxBCw31Jw0Ng-1; Mon, 15 Jun 2020 13:10:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E57BFE92B; Mon, 15 Jun 2020 17:10:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B61805D9D5; Mon, 15 Jun 2020 17:10:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 86AA6833D1; Mon, 15 Jun 2020 17:10:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAaOM004757 for ; Mon, 15 Jun 2020 13:10:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BD141024710; Mon, 15 Jun 2020 17:10:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE462101E1C1 for ; Mon, 15 Jun 2020 17:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241056; 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=8mIgjU86mWdcj/gnZiBWpFXDvYvaeOlzH5eu5yYcGDo=; b=L16Y85lYZSaSrPUZ4KlME63Cw1GG7WmZHB9IhyWul1PJoftabRp7VyvdTH+m0dtCBMppip DG+RnRoPyYCXTP2dc+Fb62l+UpXbP1aurLt1X7ukNTEHmUYeBEZlq3UsYVkLKNnk8SY0r0 d9OOnVJoDmoHCymy2ySWeylSo7frDn0= X-MC-Unique: kcx5n8MkOiaxBCw31Jw0Ng-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/32] qemublocktest: Add 'empty' case for checkpoint bitmap handling Date: Mon, 15 Jun 2020 19:09:56 +0200 Message-Id: <3a5829c499c802c5f1fa4b6b777764665ef381a4.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 2 ++ tests/qemublocktestdata/bitmapblockcommit/empty | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/qemublocktestdata/bitmapblockcommit/empty diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 2ddfab72eb..d66e169fd8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1430,6 +1430,8 @@ mymain(void) ret =3D -1; \ } while (0) + TEST_BITMAP_BLOCKCOMMIT("empty", 1, 2, "empty"); + TEST_BITMAP_BLOCKCOMMIT("basic-1-2", 1, 2, "basic"); TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic"); TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic"); diff --git a/tests/qemublocktestdata/bitmapblockcommit/empty b/tests/qemubl= ocktestdata/bitmapblockcommit/empty new file mode 100644 index 0000000000..bfc58f994e --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/empty @@ -0,0 +1,2 @@ +pre job bitmap disable: +merge bitmpas: --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241059; cv=none; d=zohomail.com; s=zohoarc; b=LNDh5Gg3HEV4KYfiCaCxV7eDW8nz7DrKVIjTDk/tJv8tJe3Iz4s/2OvUgMKICj6C9ZKgqjFoy31c3vjBT3WVw5YII0/1QpWYttrtKQjxIDkkEfJS6rI8MUSWuD7Z4etDTiUY71ZQWPkWCz6UJhFHGl33v18Y5MIglBFq4yR0rXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241059; 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=a3tGMFRdhJjKEu6CvkGfCV/5MtZ+5MNYNtdHmQRoqQI=; b=Ji8RcCKiXyWQhvQwmO+30wFnb9WO3x/Vir0Z/hA5bNWQ5TQ6dxuavgsbCQPtIjGZBe0IWxEhA58tgRpjfGLQHNopvM/IDOCSkPchgNv9SWdp/Wc6/PHAnNvJHjrERkmQyt2jYcC2dTvzJRbqOL4V/0HVDpW9Bv+NuexHmVgUGNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1592241059647113.60042765916705; Mon, 15 Jun 2020 10:10:59 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-8er5FaDtPMOwVJ7EN8vSRA-1; Mon, 15 Jun 2020 13:10:49 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 276BFE930; Mon, 15 Jun 2020 17:10:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED21E1024716; Mon, 15 Jun 2020 17:10:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BD162833D3; Mon, 15 Jun 2020 17:10:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAgbQ004772 for ; Mon, 15 Jun 2020 13:10:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 734F9100239F; Mon, 15 Jun 2020 17:10:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58C19100238C for ; Mon, 15 Jun 2020 17:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241058; 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=a3tGMFRdhJjKEu6CvkGfCV/5MtZ+5MNYNtdHmQRoqQI=; b=Mw4sADq3ohPh/wsQ4dT45BBFpFdYCKo1Hwh6nGLhgbLlegfFXP90ANlI+t+teQZCXpGSTI zV/SA44ttJxrD42iyWvRVK20KpnUjOq7I/QOw8m9siVL/1hE0kFqBWL/m0EJTXiDrhwqpp MFzZEergswWO5slDPKk9H3E7NNeVfSE= X-MC-Unique: 8er5FaDtPMOwVJ7EN8vSRA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/32] qemublocktest: Disable testcases for all bitmap handling Date: Mon, 15 Jun 2020 19:09:57 +0200 Message-Id: <1143f229f857ee8e7e7eeba762853d04d71481c2.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Upcoming patches are going to rewrite and semantically modify how bitmaps are handled during blockjobs. This is possible as incremental backup is not yet fully enabled. As the changes are going to be incompatible with any current test data remove all test cases for bitmap handling during checkpoint deletion, incremental backups, block commit, block copy, and bitmap validation operations. The tests will be gradually added back later after the code and test-data is refactored. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 94 ------------- .../backupmerge/basic-deep-out.json | 22 --- .../backupmerge/basic-flat-out.json | 6 - .../backupmerge/basic-intermediate-out.json | 10 -- .../backupmerge/snapshot-deep-out.json | 38 ----- .../backupmerge/snapshot-flat-out.json | 6 - .../snapshot-intermediate-out.json | 14 -- .../bitmapblockcommit/basic-1-2 | 119 ---------------- .../bitmapblockcommit/basic-1-3 | 119 ---------------- .../bitmapblockcommit/basic-2-3 | 2 - .../bitmapblockcommit/snapshots-1-2 | 49 ------- .../bitmapblockcommit/snapshots-1-3 | 76 ---------- .../bitmapblockcommit/snapshots-1-4 | 126 ----------------- .../bitmapblockcommit/snapshots-1-5 | 130 ----------------- .../bitmapblockcommit/snapshots-2-3 | 49 ------- .../bitmapblockcommit/snapshots-2-4 | 99 ------------- .../bitmapblockcommit/snapshots-2-5 | 103 -------------- .../bitmapblockcommit/snapshots-3-4 | 72 ---------- .../bitmapblockcommit/snapshots-3-5 | 76 ---------- .../bitmapblockcommit/snapshots-4-5 | 33 ----- .../snapshots-synthetic-broken-1-2 | 57 -------- .../snapshots-synthetic-broken-1-3 | 112 --------------- .../snapshots-synthetic-broken-1-4 | 119 ---------------- .../snapshots-synthetic-broken-1-5 | 119 ---------------- .../snapshots-synthetic-broken-2-3 | 89 ------------ .../snapshots-synthetic-broken-2-4 | 96 ------------- .../snapshots-synthetic-broken-2-5 | 96 ------------- .../snapshots-synthetic-broken-3-4 | 27 ---- .../snapshots-synthetic-broken-3-5 | 27 ---- .../snapshots-synthetic-broken-4-5 | 20 --- .../bitmapblockcopy/basic-deep-out.json | 117 --------------- .../bitmapblockcopy/basic-shallow-out.json | 117 --------------- .../bitmapblockcopy/snapshots-deep-out.json | 133 ------------------ .../snapshots-shallow-out.json | 48 ------- .../checkpointdelete/basic-current-out.json | 29 ---- .../basic-intermediate1-out.json | 22 --- .../basic-intermediate2-out.json | 22 --- .../basic-intermediate3-out.json | 22 --- .../checkpointdelete/basic-noparent-out.json | 9 -- .../snapshots-current-out.json | 29 ---- .../snapshots-intermediate1-out.json | 24 ---- .../snapshots-intermediate2-out.json | 62 -------- .../snapshots-intermediate3-out.json | 61 -------- .../snapshots-noparent-out.json | 27 ---- ...hots-synthetic-checkpoint-current-out.json | 29 ---- ...ynthetic-checkpoint-intermediate1-out.json | 31 ---- ...ynthetic-checkpoint-intermediate2-out.json | 34 ----- ...ynthetic-checkpoint-intermediate3-out.json | 61 -------- ...ots-synthetic-checkpoint-noparent-out.json | 27 ---- 49 files changed, 2909 deletions(-) delete mode 100644 tests/qemublocktestdata/backupmerge/basic-deep-out.json delete mode 100644 tests/qemublocktestdata/backupmerge/basic-flat-out.json delete mode 100644 tests/qemublocktestdata/backupmerge/basic-intermediate-= out.json delete mode 100644 tests/qemublocktestdata/backupmerge/snapshot-deep-out.j= son delete mode 100644 tests/qemublocktestdata/backupmerge/snapshot-flat-out.j= son delete mode 100644 tests/qemublocktestdata/backupmerge/snapshot-intermedia= te-out.json delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-2 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-2-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-1-2 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-1-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-1-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-1-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-2-3 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-2-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-2-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-3-4 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-3-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-syn= thetic-broken-4-5 delete mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.= json delete mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-shallow-o= ut.json delete mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-= out.json delete mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-shall= ow-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/basic-current-= out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate1-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate2-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate3-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent= -out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-curr= ent-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate1-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate2-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate3-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-nopa= rent-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synt= hetic-checkpoint-current-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synt= hetic-checkpoint-intermediate1-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synt= hetic-checkpoint-intermediate2-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synt= hetic-checkpoint-intermediate3-out.json delete mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synt= hetic-checkpoint-noparent-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index d66e169fd8..d2f105486e 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1312,14 +1312,6 @@ mymain(void) TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); - TEST_BACKUP_BITMAP_CALCULATE("basic-flat", bitmapSourceChain, "current= ", "basic"); - TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, = "d", "basic"); - TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "ba= sic"); - - TEST_BACKUP_BITMAP_CALCULATE("snapshot-flat", bitmapSourceChain, "curr= ent", "snapshots"); - TEST_BACKUP_BITMAP_CALCULATE("snapshot-intermediate", bitmapSourceChai= n, "d", "snapshots"); - TEST_BACKUP_BITMAP_CALCULATE("snapshot-deep", bitmapSourceChain, "a", = "snapshots"); - #define TEST_CHECKPOINT_DELETE_MERGE(testname, delbmp, parbmp, named) \ do { \ checkpointdeletedata.name =3D testname; \ @@ -1334,24 +1326,6 @@ mymain(void) TEST_CHECKPOINT_DELETE_MERGE("empty", "a", NULL, "empty"); - TEST_CHECKPOINT_DELETE_MERGE("basic-noparent", "a", NULL, "basic"); - TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate1", "b", "a", "basic"); - TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate2", "c", "b", "basic"); - TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate3", "d", "c", "basic"); - TEST_CHECKPOINT_DELETE_MERGE("basic-current", "current", "d", "basic"); - - TEST_CHECKPOINT_DELETE_MERGE("snapshots-noparent", "a", NULL, "snapsho= ts"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-intermediate1", "b", "a", "sna= pshots"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-intermediate2", "c", "b", "sna= pshots"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-intermediate3", "d", "c", "sna= pshots"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-current", "current", "d", "sna= pshots"); - - TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-noparent"= , "a", NULL, "snapshots-synthetic-checkpoint"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermedi= ate1", "b", "a", "snapshots-synthetic-checkpoint"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermedi= ate2", "c", "b", "snapshots-synthetic-checkpoint"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermedi= ate3", "d", "c", "snapshots-synthetic-checkpoint"); - TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-current",= "current", "d", "snapshots-synthetic-checkpoint"); - #define TEST_BITMAP_VALIDATE(testname, bitmap, rc) \ do { \ blockbitmapvalidatedata.name =3D testname; \ @@ -1366,36 +1340,6 @@ mymain(void) TEST_BITMAP_VALIDATE("empty", "a", false); - TEST_BITMAP_VALIDATE("basic", "a", true); - TEST_BITMAP_VALIDATE("basic", "b", true); - TEST_BITMAP_VALIDATE("basic", "c", true); - TEST_BITMAP_VALIDATE("basic", "d", true); - TEST_BITMAP_VALIDATE("basic", "current", true); - - TEST_BITMAP_VALIDATE("snapshots", "a", true); - TEST_BITMAP_VALIDATE("snapshots", "b", true); - TEST_BITMAP_VALIDATE("snapshots", "c", true); - TEST_BITMAP_VALIDATE("snapshots", "d", true); - TEST_BITMAP_VALIDATE("snapshots", "current", true); - - TEST_BITMAP_VALIDATE("synthetic", "a", false); - TEST_BITMAP_VALIDATE("synthetic", "b", true); - TEST_BITMAP_VALIDATE("synthetic", "c", true); - TEST_BITMAP_VALIDATE("synthetic", "d", true); - TEST_BITMAP_VALIDATE("synthetic", "current", true); - - TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "a", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "b", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "c", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "d", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "current", true= ); - - TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "a", false); - TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "b", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "c", true); - TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "d", false); - TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "current", true); - #define TEST_BITMAP_BLOCKCOPY(testname, shllw, ndf) \ do { \ blockbitmapblockcopydata.name =3D testname; \ @@ -1411,12 +1355,6 @@ mymain(void) TEST_BITMAP_BLOCKCOPY("empty-shallow", true, "empty"); TEST_BITMAP_BLOCKCOPY("empty-deep", false, "empty"); - TEST_BITMAP_BLOCKCOPY("basic-shallow", true, "basic"); - TEST_BITMAP_BLOCKCOPY("basic-deep", false, "basic"); - - TEST_BITMAP_BLOCKCOPY("snapshots-shallow", true, "snapshots"); - TEST_BITMAP_BLOCKCOPY("snapshots-deep", false, "snapshots"); - #define TEST_BITMAP_BLOCKCOMMIT(testname, topimg, baseimg, ndf) \ do {\ @@ -1432,38 +1370,6 @@ mymain(void) TEST_BITMAP_BLOCKCOMMIT("empty", 1, 2, "empty"); - TEST_BITMAP_BLOCKCOMMIT("basic-1-2", 1, 2, "basic"); - TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic"); - TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-1-2", 1, 2, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-1-3", 1, 3, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-1-4", 1, 4, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-1-5", 1, 5, "snapshots"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-2-3", 2, 3, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-2-4", 2, 4, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-2-5", 2, 5, "snapshots"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-3-4", 3, 4, "snapshots"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-3-5", 3, 5, "snapshots"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-4-5", 4, 5, "snapshots"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-2", 1, 2, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-3", 1, 3, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-4", 1, 4, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-5", 1, 5, "snaps= hots-synthetic-broken"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-3", 2, 3, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-4", 2, 4, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-5", 2, 5, "snaps= hots-synthetic-broken"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-3-4", 3, 4, "snaps= hots-synthetic-broken"); - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-3-5", 3, 5, "snaps= hots-synthetic-broken"); - - TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-4-5", 4, 5, "snaps= hots-synthetic-broken"); - cleanup: qemuTestDriverFree(&driver); VIR_FREE(capslatest_x86_64); diff --git a/tests/qemublocktestdata/backupmerge/basic-deep-out.json b/test= s/qemublocktestdata/backupmerge/basic-deep-out.json deleted file mode 100644 index 28c3d16259..0000000000 --- a/tests/qemublocktestdata/backupmerge/basic-deep-out.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - }, - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-1-format", - "name": "c" - }, - { - "node": "libvirt-1-format", - "name": "b" - }, - { - "node": "libvirt-1-format", - "name": "a" - } -] diff --git a/tests/qemublocktestdata/backupmerge/basic-flat-out.json b/test= s/qemublocktestdata/backupmerge/basic-flat-out.json deleted file mode 100644 index b89252e284..0000000000 --- a/tests/qemublocktestdata/backupmerge/basic-flat-out.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - } -] diff --git a/tests/qemublocktestdata/backupmerge/basic-intermediate-out.jso= n b/tests/qemublocktestdata/backupmerge/basic-intermediate-out.json deleted file mode 100644 index 0dffcafd5f..0000000000 --- a/tests/qemublocktestdata/backupmerge/basic-intermediate-out.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - }, - { - "node": "libvirt-1-format", - "name": "d" - } -] diff --git a/tests/qemublocktestdata/backupmerge/snapshot-deep-out.json b/t= ests/qemublocktestdata/backupmerge/snapshot-deep-out.json deleted file mode 100644 index 526fc8d55b..0000000000 --- a/tests/qemublocktestdata/backupmerge/snapshot-deep-out.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - }, - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "b" - }, - { - "node": "libvirt-3-format", - "name": "a" - }, - { - "node": "libvirt-4-format", - "name": "a" - }, - { - "node": "libvirt-5-format", - "name": "a" - } -] diff --git a/tests/qemublocktestdata/backupmerge/snapshot-flat-out.json b/t= ests/qemublocktestdata/backupmerge/snapshot-flat-out.json deleted file mode 100644 index b89252e284..0000000000 --- a/tests/qemublocktestdata/backupmerge/snapshot-flat-out.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - } -] diff --git a/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.= json b/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json deleted file mode 100644 index 537d776ec6..0000000000 --- a/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "node": "libvirt-1-format", - "name": "current" - }, - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-1-2 deleted file mode 100644 index 8eeb4c3a11..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 +++ /dev/null @@ -1,119 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "a", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-1-3 deleted file mode 100644 index 71b48e31a5..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 +++ /dev/null @@ -1,119 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "a", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-2-3 deleted file mode 100644 index bfc58f994e..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 +++ /dev/null @@ -1,2 +0,0 @@ -pre job bitmap disable: -merge bitmpas: diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-2 deleted file mode 100644 index 0015b9ceb3..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 +++ /dev/null @@ -1,49 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-2-format", - "name": "d" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-3 deleted file mode 100644 index 5691b408aa..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 +++ /dev/null @@ -1,76 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-3-format", - "name": "c" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-4 deleted file mode 100644 index 454001531a..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 +++ /dev/null @@ -1,126 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-4-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-5 deleted file mode 100644 index 2fd43d7917..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 +++ /dev/null @@ -1,130 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - }, - { - "node": "libvirt-4-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-3 deleted file mode 100644 index d719a90bd7..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 +++ /dev/null @@ -1,49 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-3-format", - "name": "c" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "d", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-4 deleted file mode 100644 index 9e37962344..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 +++ /dev/null @@ -1,99 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-4-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "d", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-5 deleted file mode 100644 index d6b20a5d05..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 +++ /dev/null @@ -1,103 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - }, - { - "node": "libvirt-4-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "d", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-3-4 deleted file mode 100644 index b96e8910d7..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 +++ /dev/null @@ -1,72 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-4-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "c", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-3-5 deleted file mode 100644 index 9570c34c40..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 +++ /dev/null @@ -1,76 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - }, - { - "node": "libvirt-4-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "c", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-4-5 deleted file mode 100644 index 7e1020d96e..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 +++ /dev/null @@ -1,33 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-4-format", - "name": "a" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-2 deleted file mode 100644 index 463120d442..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 1-2 +++ /dev/null @@ -1,57 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-2-format", - "name": "oa" - } - }, - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-2-format", - "name": "ob" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-2-format", - "name": "oa" - } - }, - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-2-format", - "name": "ob" - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-3 deleted file mode 100644 index fec6f95dd1..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 1-3 +++ /dev/null @@ -1,112 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-4 deleted file mode 100644 index 697230f67b..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 1-4 +++ /dev/null @@ -1,119 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-1-5 deleted file mode 100644 index 6bf1f0da64..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 1-5 +++ /dev/null @@ -1,119 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-3 deleted file mode 100644 index f202bb94b1..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 2-3 +++ /dev/null @@ -1,89 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-3-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-4 deleted file mode 100644 index 864cc9041b..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 2-4 +++ /dev/null @@ -1,96 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-2-5 deleted file mode 100644 index 4c5d8dbe80..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 2-5 +++ /dev/null @@ -1,96 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "oa", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "oa", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "oa" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "ob", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "ob", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "ob" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-3-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-3-4 deleted file mode 100644 index 367a930a74..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 3-4 +++ /dev/null @@ -1,27 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-4-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-4-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-3-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-3-5 deleted file mode 100644 index 0062ec140c..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 3-5 +++ /dev/null @@ -1,27 +0,0 @@ -pre job bitmap disable: -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-5-format", - "name": "b", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-5-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-4-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-= broken-4-5 deleted file mode 100644 index b1f10a8a24..0000000000 --- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-= 4-5 +++ /dev/null @@ -1,20 +0,0 @@ -pre job bitmap disable: -[ - { - "type": "block-dirty-bitmap-disable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -merge bitmpas: -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json b/= tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json deleted file mode 100644 index 4ed2b97e95..0000000000 --- a/tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "a", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json= b/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json deleted file mode 100644 index 4ed2b97e95..0000000000 --- a/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "a", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.jso= n b/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json deleted file mode 100644 index 5456553d78..0000000000 --- a/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json +++ /dev/null @@ -1,133 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "a", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "a" - }, - { - "node": "libvirt-4-format", - "name": "a" - }, - { - "node": "libvirt-5-format", - "name": "a" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - }, - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - }, - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.= json b/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json deleted file mode 100644 index ddd47f7ee1..0000000000 --- a/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json +++ /dev/null @@ -1,48 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "current", - "persistent": true, - "disabled": false, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "current", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "mirror-format-node", - "name": "d", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "mirror-format-node", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-current-out.jso= n b/tests/qemublocktestdata/checkpointdelete/basic-current-out.json deleted file mode 100644 index 1b607567e8..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/basic-current-out.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "current" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.= json deleted file mode 100644 index eccb7ed15f..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "b" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.= json deleted file mode 100644 index de40e4b5b0..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "c" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.= json deleted file mode 100644 index b5d85f43f0..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.js= on b/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json deleted file mode 100644 index e87382fdb4..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "a" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-current-out= .json b/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json deleted file mode 100644 index 1b607567e8..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "current" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e1-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te1-out.json deleted file mode 100644 index c9bda3a17a..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.= json +++ /dev/null @@ -1,24 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - } -] -reopen nodes: -libvirt-3-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e2-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te2-out.json deleted file mode 100644 index 8a0e3f2cff..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.= json +++ /dev/null @@ -1,62 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-2-format", - "name": "c" - } - }, - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-3-format", - "name": "c" - } - } -] -reopen nodes: -libvirt-3-format -libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e3-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te3-out.json deleted file mode 100644 index 211bc40baf..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.= json +++ /dev/null @@ -1,61 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-1-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - }, - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-2-format", - "name": "c" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-2-format", - "name": "d" - } - } -] -reopen nodes: -libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-ou= t.json b/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.js= on deleted file mode 100644 index f750f44da2..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-3-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-4-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -reopen nodes: -libvirt-5-format -libvirt-4-format -libvirt-3-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-c= heckpoint-current-out.json b/tests/qemublocktestdata/checkpointdelete/snaps= hots-synthetic-checkpoint-current-out.json deleted file mode 100644 index 1b607567e8..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoi= nt-current-out.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "d", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "current" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "current" - } - } -] diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-c= heckpoint-intermediate1-out.json b/tests/qemublocktestdata/checkpointdelete= /snapshots-synthetic-checkpoint-intermediate1-out.json deleted file mode 100644 index d7e6d18637..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoi= nt-intermediate1-out.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-3-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-3-format", - "target": "a", - "bitmaps": [ - { - "node": "libvirt-3-format", - "name": "b" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-3-format", - "name": "b" - } - } -] -reopen nodes: -libvirt-3-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-c= heckpoint-intermediate2-out.json b/tests/qemublocktestdata/checkpointdelete= /snapshots-synthetic-checkpoint-intermediate2-out.json deleted file mode 100644 index cfbff010c2..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoi= nt-intermediate2-out.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-2-format", - "name": "b", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "b", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "c" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-2-format", - "name": "c" - } - } -] -reopen nodes: -libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-c= heckpoint-intermediate3-out.json b/tests/qemublocktestdata/checkpointdelete= /snapshots-synthetic-checkpoint-intermediate3-out.json deleted file mode 100644 index 211bc40baf..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoi= nt-intermediate3-out.json +++ /dev/null @@ -1,61 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-add", - "data": { - "node": "libvirt-1-format", - "name": "c", - "persistent": true, - "disabled": true, - "granularity": 65536 - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-1-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-1-format", - "name": "d" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-1-format", - "name": "d" - } - }, - { - "type": "block-dirty-bitmap-enable", - "data": { - "node": "libvirt-2-format", - "name": "c" - } - }, - { - "type": "block-dirty-bitmap-merge", - "data": { - "node": "libvirt-2-format", - "target": "c", - "bitmaps": [ - { - "node": "libvirt-2-format", - "name": "d" - } - ] - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-2-format", - "name": "d" - } - } -] -reopen nodes: -libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-c= heckpoint-noparent-out.json b/tests/qemublocktestdata/checkpointdelete/snap= shots-synthetic-checkpoint-noparent-out.json deleted file mode 100644 index f750f44da2..0000000000 --- a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoi= nt-noparent-out.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-3-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-4-format", - "name": "a" - } - }, - { - "type": "block-dirty-bitmap-remove", - "data": { - "node": "libvirt-5-format", - "name": "a" - } - } -] -reopen nodes: -libvirt-5-format -libvirt-4-format -libvirt-3-format --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241131; cv=none; d=zohomail.com; s=zohoarc; b=YXU3Gr+KVWqciR/RHCWX87VrhBW4aDGMpvUGAiO9qjwJB2OpxDqW/fT1PF0sLmlgJMx/4QVLI6KzmEJR1op9z+mcH+K5Xgi0aBmaDSe0w0xDuy1jpOnq+VfQcRdvfPj0Ec6/ajyISQKRSK5mmIiGRcot299/oe8uazEDGcWvZBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241131; 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=bdwLSppv7YHtE90+YBNsMrjqIqLcJ7OBpmwW5gckalo=; b=k/n2jG8Hw0kuIViOwr9gsE7hAT2FmnV6ukadM7StujIXrQ2RS9EA62Vxswh/1tCKq1WLbMdRQRRac3uXdUewWQfvucYdlPxaBSiv/xYq87UpQljrPMIuDZo6+7DbtS/q8Is/Vw9n5ezse70M/f5s/HSm2YG/PKVDQnznGRO5TXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1592241131720991.0333371205683; Mon, 15 Jun 2020 10:12:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-Vu5NbXI9PHOAEgMXoVujpw-1; Mon, 15 Jun 2020 13:11:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3840803310; Mon, 15 Jun 2020 17:11:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86CA97FD07; Mon, 15 Jun 2020 17:11:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 581F31800456; Mon, 15 Jun 2020 17:11:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAhmK004778 for ; Mon, 15 Jun 2020 13:10:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D0A9100164D; Mon, 15 Jun 2020 17:10:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC2D0100238C for ; Mon, 15 Jun 2020 17:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241130; 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=bdwLSppv7YHtE90+YBNsMrjqIqLcJ7OBpmwW5gckalo=; b=NBOKyihqbEeENBl+XVPvR7SaW+WL+ntT6yN4RpYKy+VfU5MGYmzGKNmKosCbytGZOlqtWk PBw4UidAMjpNhI2QQ45C5FYmk54Iw1mIHpEYksK8Vo1Y61jweh2palrJQ/Da/ox3J4vy+9 0RsXZwvzAA4gbDH1KuUHWogJl9D8qVc= X-MC-Unique: Vu5NbXI9PHOAEgMXoVujpw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/32] qemublocktest: Delete 'synthetic' bitmap test cases Date: Mon, 15 Jun 2020 19:09:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" They will be replaced by a different set which will test scenarios relevant for the new semantics. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 3 - .../bitmap/snapshots-synthetic-broken.json | 837 ------------------ .../bitmap/snapshots-synthetic-broken.out | 14 - .../snapshots-synthetic-checkpoint.json | 827 ----------------- .../bitmap/snapshots-synthetic-checkpoint.out | 13 - tests/qemublocktestdata/bitmap/synthetic.json | 118 --- tests/qemublocktestdata/bitmap/synthetic.out | 6 - 7 files changed, 1818 deletions(-) delete mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-brok= en.json delete mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-brok= en.out delete mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-chec= kpoint.json delete mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-chec= kpoint.out delete mode 100644 tests/qemublocktestdata/bitmap/synthetic.json delete mode 100644 tests/qemublocktestdata/bitmap/synthetic.out diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index d2f105486e..28cbaeba38 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1293,10 +1293,7 @@ mymain(void) TEST_BITMAP_DETECT("empty"); TEST_BITMAP_DETECT("basic"); - TEST_BITMAP_DETECT("synthetic"); TEST_BITMAP_DETECT("snapshots"); - TEST_BITMAP_DETECT("snapshots-synthetic-checkpoint"); - TEST_BITMAP_DETECT("snapshots-synthetic-broken"); #define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \ do { \ diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json= b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json deleted file mode 100644 index 8cf14d4baa..0000000000 --- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json +++ /dev/null @@ -1,837 +0,0 @@ -[ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911550", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "in-use", - "auto" - ], - "name": "current", - "granularity": 65536 - }, - { - "flags": [ - "in-use" - ], - "name": "d", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911540", - "backing-filename": "/tmp/pull4.1575911540", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-format", - "backing_file_depth": 4, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911540", - "dirty-bitmaps": [ - { - "name": "d", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "current", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911550", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-2-format", - "backing_file_depth": 3, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911527", - "dirty-bitmaps": [ - { - "name": "c", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "oa", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - }, - { - "name": "ob", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - }, - { - "name": "d", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "inconsistent": true, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911540", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-2-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-3-format", - "backing_file_depth": 2, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911522", - "dirty-bitmaps": [ - { - "name": "a", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "b", - "recording": true, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 459264, - "filename": "/tmp/pull4.1575911527", - "format": "file", - "actual-size": 217088, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-3-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-4-format", - "backing_file_depth": 1, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.qcow2", - "dirty-bitmaps": [ - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.1575911522", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-4-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-5-format", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "dirty-bitmaps": [ - { - "name": "a", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.qcow2", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-5-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - } -] diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out = b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out deleted file mode 100644 index ad24a580f1..0000000000 --- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out +++ /dev/null @@ -1,14 +0,0 @@ -libvirt-1-format: - d: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-2-format: - c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - oa: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - ob: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - d: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0 -libvirt-3-format: - a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-4-format: -libvirt-5-format: - a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.= json b/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.json deleted file mode 100644 index 25cc150d67..0000000000 --- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.json +++ /dev/null @@ -1,827 +0,0 @@ -[ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911550", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "in-use", - "auto" - ], - "name": "current", - "granularity": 65536 - }, - { - "flags": [ - "in-use" - ], - "name": "d", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911540", - "backing-filename": "/tmp/pull4.1575911540", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-format", - "backing_file_depth": 4, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911540", - "dirty-bitmaps": [ - { - "name": "d", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "current", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911550", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-2-format", - "backing_file_depth": 3, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911527", - "dirty-bitmaps": [ - { - "name": "c", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "d", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911540", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-2-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-3-format", - "backing_file_depth": 2, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911522", - "dirty-bitmaps": [ - { - "name": "a", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "b", - "recording": true, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 459264, - "filename": "/tmp/pull4.1575911527", - "format": "file", - "actual-size": 217088, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-3-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-4-format", - "backing_file_depth": 1, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.qcow2", - "dirty-bitmaps": [ - { - "name": "a", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.1575911522", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-4-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-5-format", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "dirty-bitmaps": [ - { - "name": "a", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.qcow2", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-5-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - } -] diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.= out b/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.out deleted file mode 100644 index 0270657001..0000000000 --- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-checkpoint.out +++ /dev/null @@ -1,13 +0,0 @@ -libvirt-1-format: - d: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-2-format: - c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-3-format: - a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-4-format: - a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 -libvirt-5-format: - a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 diff --git a/tests/qemublocktestdata/bitmap/synthetic.json b/tests/qemubloc= ktestdata/bitmap/synthetic.json deleted file mode 100644 index 56882bd615..0000000000 --- a/tests/qemublocktestdata/bitmap/synthetic.json +++ /dev/null @@ -1,118 +0,0 @@ -[ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-format", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "dirty-bitmaps": [ - { - "name": "current", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - }, - { - "name": "d", - "recording": false, - "persistent": false, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "c", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 1234, - "count": 0 - }, - { - "name": "b", - "recording": false, - "persistent": true, - "busy": true, - "status": "disabled", - "granularity": 65536, - "count": 21314 - }, - { - "name": "a", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "inconsistent": true, - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/tmp/pull4.qcow2", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - } -] diff --git a/tests/qemublocktestdata/bitmap/synthetic.out b/tests/qemublock= testdata/bitmap/synthetic.out deleted file mode 100644 index e8041c5b77..0000000000 --- a/tests/qemublocktestdata/bitmap/synthetic.out +++ /dev/null @@ -1,6 +0,0 @@ -libvirt-1-format: - current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - d: record:0 busy:0 persist:0 inconsist:0 gran:65536 dirty:0 - c: record:0 busy:0 persist:1 inconsist:0 gran:1234 dirty:0 - b: record:0 busy:1 persist:1 inconsist:0 gran:65536 dirty:21314 - a: record:0 busy:0 persist:1 inconsist:1 gran:65536 dirty:0 --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241058; cv=none; d=zohomail.com; s=zohoarc; b=khURq6PeQlGM1S53Zx0g1iNg7EMb4HPTs7/Iz8LSypZRn3kIoU/nuNm93ZD9OA5JSgk7Klo6jb9LlDMSl7AQxPptRab/Gd3rf1Ui7SNMbtXGW81W4wqflszZC/2Q/wn/APvmJ2xcb43xKngWhEIIY+OQvdFFt/fVYy6mPNkK8LI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241058; 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=CYtmGtvjagsfSkt1GC2qPlQkRTOBY0nTjrEO/VEwcw4=; b=Cxs6rekPGHH4IseaUF79hWGJEEfZcz1trFGI2b4D7aBv4f5RkB+Ncyv0hpr54FjKO2bQ60WHdwMwbFx7gXKooDvSVMimEN9g9xc2TfPKnqV3qfDiaEV1EXMopgCea7jwtAnjWUY8YmlzsjHNRYAQYj92BfQ4/mrcTVhlDza4VWI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241058413920.6842692580866; Mon, 15 Jun 2020 10:10:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-246-HUt5BuNTOTaarq6JVOzmAg-1; Mon, 15 Jun 2020 13:10:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B62C835BAA; Mon, 15 Jun 2020 17:10:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CCD27F4F9; Mon, 15 Jun 2020 17:10:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F3848833D6; Mon, 15 Jun 2020 17:10:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAiMs004788 for ; Mon, 15 Jun 2020 13:10:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E6E710246E1; Mon, 15 Jun 2020 17:10:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC5B31024715 for ; Mon, 15 Jun 2020 17:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241057; 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=CYtmGtvjagsfSkt1GC2qPlQkRTOBY0nTjrEO/VEwcw4=; b=JFDpbPbTzkaDCHS1o4TIQHZHq13B62NVCIIMuydiRM3TGZDQZRa4wlhhA/PsAJDp47at1O 7fb3MLdy5MPl3fIJxOat0FhLNrGhw2cCPD7+2lGCe3CT80CQySUg9s3Q0ZhQcLxBdYa317 ddyh7iIXy/wWVtIX8VV3CUXy86LSVbE= X-MC-Unique: HUt5BuNTOTaarq6JVOzmAg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/32] qemublocktest: Extract printing of nodename list Date: Mon, 15 Jun 2020 19:09:59 +0200 Message-Id: <416c56ac0ec775749fda904d995348ce18a7ee06.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There will be multiple places where we'll need to print nodenames from a GSList of virStorageSource for testing purposes. Extract the code into a function. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 28cbaeba38..0ed9b99bc4 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -647,6 +647,23 @@ testQemuDetectBitmaps(const void *opaque) } +static void +testQemuBitmapListPrint(const char *title, + GSList *next, + virBufferPtr buf) +{ + if (!next) + return; + + virBufferAsprintf(buf, "%s\n", title); + + for (; next; next =3D next->next) { + virStorageSourcePtr src =3D next->data; + virBufferAsprintf(buf, "%s\n", src->nodeformat); + } +} + + static virStorageSourcePtr testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx) { @@ -829,7 +846,6 @@ testQemuCheckpointDeleteMerge(const void *opaque) g_autoptr(virHashTable) nodedata =3D NULL; g_autoptr(GSList) reopenimages =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - GSList *tmp; expectpath =3D g_strdup_printf("%s/%s%s-out.json", abs_srcdir, checkpointDeletePrefix, data->name); @@ -858,14 +874,7 @@ testQemuCheckpointDeleteMerge(const void *opaque) virBufferAddLit(&buf, "NULL\n"); } - if (reopenimages) { - virBufferAddLit(&buf, "reopen nodes:\n"); - - for (tmp =3D reopenimages; tmp; tmp =3D tmp->next) { - virStorageSourcePtr src =3D tmp->data; - virBufferAsprintf(&buf, "%s\n", src->nodeformat); - } - } + testQemuBitmapListPrint("reopen nodes:", reopenimages, &buf); actual =3D virBufferContentAndReset(&buf); --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241441; cv=none; d=zohomail.com; s=zohoarc; b=h1+eQGnOOv8aOfezKGkoMP/lFu2docWQ+pCX7OZIU/j2dkJg8FgZVR0jAtgNRgCJ3tJ2tle8VPtgUu49GTUZsmY0rtC4fIr/9NnCeYPYQqFZUZ8p6uVijrrZqA4Ubl3lXYkWtHJtwbRQ0J6QdQV7Mf0LmlxJ4VgbLDElrG9YgpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241441; 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=QwG1g8u8fyn0w9EVXeJ2aABqlNqxNTwqP/f5EocZZ3s=; b=Yi5Jl/riCZ/5IfHaj383b3oUZ133iVhxuTga0Tz1USIA5YDAJG6Spjj5tJ/W6wHN1hbp/dDCKxZxOC1Qi+Qp78u/hAj24z3Gc2OKl+LrEdSfnjnCf24S/3siIrmqNxLOf/KxZ1026GBYy9oOLoy4ef842CC5L+O+n/7VxETsSk0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1592241441729104.99217763589411; Mon, 15 Jun 2020 10:17:21 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-289-Krv-biOJMsWxqDjF1tsDsg-1; Mon, 15 Jun 2020 13:11:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07878803333; Mon, 15 Jun 2020 17:11:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE63E5C1D2; Mon, 15 Jun 2020 17:11:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AFFF2180599D; Mon, 15 Jun 2020 17:11:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAjkL004796 for ; Mon, 15 Jun 2020 13:10:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6BCD6100238C; Mon, 15 Jun 2020 17:10:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id D889E100164D for ; Mon, 15 Jun 2020 17:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241440; 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=QwG1g8u8fyn0w9EVXeJ2aABqlNqxNTwqP/f5EocZZ3s=; b=hEhUaIHKX2VNeQgJkYaQ2T+aIDBLM+NjGf+j+efY4hkjbcO45dIeML18d+9GSamU3Qb8sk Wq0jFRWuTPA7GrQfyJWMjpIGRmDwsT/1WA7ojG0XhzwwlotvQ6rltjF60msLDtQQbiffNG bdvA+TfkFZo0ESoBMQzrogixWcqIM0Y= X-MC-Unique: Krv-biOJMsWxqDjF1tsDsg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/32] qemu: checkpoint: Don't chain bitmaps for checkpoints Date: Mon, 15 Jun 2020 19:10:00 +0200 Message-Id: <4c38be44316dc0482a561e5e1b34ac1f84f19de7.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Chaining bitmaps for checkpoints (disabling the active one and creating a new) severely overcomplicated all operations in regards to bitmaps. Specifically it requires us re-matching the on-disk state to the internal metadata and in case of merging during block jobs it makes it almost impossible to cover all corner cases. Since the checkpoints and incremental backups were not yet enabled, let's change the design to keep one bitmap per checkpoint. In case of layered snapshots this will be filled in by using dirty-bitmap-populate. Finally the main reason for this unnecessary complexity was the fear that qemu's performance could degrade. In the end I think that addressing the performance issue will be better done in qemu (e.g by keeping an internal bitmap updated with changes and merging it periodically back to the real bitmaps. QEMU writes out changes to disk at shutdown so consistency is not a problem). Removing the relationships between bitmaps frees us from complex handling and also makes all the surrounding code more robust as one broken bitmap doesn't necessarily invalidate whole chains of backups. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index b71b4a7d14..9b4f3ad396 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -456,7 +456,6 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, static int qemuCheckpointAddActions(virDomainObjPtr vm, virJSONValuePtr actions, - virDomainMomentObjPtr old_current, virDomainCheckpointDefPtr def) { size_t i; @@ -464,7 +463,6 @@ qemuCheckpointAddActions(virDomainObjPtr vm, for (i =3D 0; i < def->ndisks; i++) { virDomainCheckpointDiskDef *chkdisk =3D &def->disks[i]; virDomainDiskDefPtr domdisk =3D virDomainDiskByTarget(vm->def, chk= disk->name); - virDomainCheckpointDiskDef *parentchkdisk =3D NULL; /* checkpoint definition validator mandates that the corresponding * domdisk should exist */ @@ -475,23 +473,6 @@ qemuCheckpointAddActions(virDomainObjPtr vm, if (qemuMonitorTransactionBitmapAdd(actions, domdisk->src->nodefor= mat, chkdisk->bitmap, true, false, = 0) < 0) return -1; - - /* We only want one active bitmap for a disk along the - * checkpoint chain, then later differential backups will - * merge the bitmaps (only one active) between the bounding - * checkpoint and the leaf checkpoint. If the same disks are - * involved in each checkpoint, this search terminates in one - * iteration; but it is also possible to have to search - * further than the immediate parent to find another - * checkpoint with a bitmap on the same disk. */ - if ((parentchkdisk =3D qemuCheckpointFindActiveDiskInParent(vm, ol= d_current, - chkdisk-= >name))) { - - if (qemuMonitorTransactionBitmapDisable(actions, - domdisk->src->nodeform= at, - parentchkdisk->bitmap)= < 0) - return -1; - } } return 0; } @@ -540,7 +521,7 @@ qemuCheckpointCreateCommon(virQEMUDriverPtr driver, tmpactions =3D virJSONValueNewArray(); - if (qemuCheckpointAddActions(vm, tmpactions, parent, *def) < 0) + if (qemuCheckpointAddActions(vm, tmpactions, *def) < 0) return -1; if (!(*chk =3D virDomainCheckpointAssignDef(vm->checkpoints, *def))) --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241132; cv=none; d=zohomail.com; s=zohoarc; b=Gov2xforvjTfy69QUuZb/P1U1ptdiwaMe1IzbfRd/2n6wMyLMxUijvb6+1QIB4gp9u07X4qp/M31msHZF/QyP6d4vXW1PhI2I1E+A2GtOR1iWm5MxzvWKkg1gUxCZu4M3Pb3plM1hp2NFVXmmF8+8iO98I1txkFLvBEkwdlufH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241132; 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=oKSOHo0MbdB2k/jXsX4yVt9qaO4zOLe9vGMT779x2gY=; b=AGiLx5IJ44Z+SPABqn9HhhPdS06lE6/0CWA0rkyFK5XMTx7Fa26pzdJTqOZLFJHa2Pj88dHzeLGKVgbt4pUBXuUELxweKQi0KL8vtk0V2lLPccYpCw35EGgNkLX/Sdt88Nop7m8l0O/ff8jBCCIZpbP7KeGKHFfWnrcupC+4e1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241132680571.0370923778573; Mon, 15 Jun 2020 10:12:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-l7gY4l9DMRqszQR1tWIL7A-1; Mon, 15 Jun 2020 13:11:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD2CE803333; Mon, 15 Jun 2020 17:10:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B7429CFCA; Mon, 15 Jun 2020 17:10:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC0EE833D8; Mon, 15 Jun 2020 17:10:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAktW004812 for ; Mon, 15 Jun 2020 13:10:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 584C2100164D; Mon, 15 Jun 2020 17:10:46 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id C33F1100238C for ; Mon, 15 Jun 2020 17:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241131; 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=oKSOHo0MbdB2k/jXsX4yVt9qaO4zOLe9vGMT779x2gY=; b=M3x8YTaJZAwxhga0Y6uS/M0Uyfxq3IFiSNdM+PvtAHy4yGhPss/NhksyFfZ3c+lvipFKXD Bvp2hgZ+h4oHLfPygRFWxvLHOBFoz1HefvvkTXk/GjhY24NZanIVMQWN8/FF92MkE6UXMx qdIwvEtkmZUZmT0h5zXEYSmo4XBFRMY= X-MC-Unique: l7gY4l9DMRqszQR1tWIL7A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/32] qemublocktest: Replace 'basic' bitmap detection test case data Date: Mon, 15 Jun 2020 19:10:01 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use test data which conforms to the new semantics which changed in the previous patch. The test data was created by the same set of commands as originally in commit 9aac9d5bdab039a50de2d8c627b3a1f1578ed471 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktestdata/bitmap/basic.json | 229 +++++++++++----------- tests/qemublocktestdata/bitmap/basic.out | 8 +- 2 files changed, 119 insertions(+), 118 deletions(-) diff --git a/tests/qemublocktestdata/bitmap/basic.json b/tests/qemublocktes= tdata/bitmap/basic.json index 9d418b1a37..718106bf99 100644 --- a/tests/qemublocktestdata/bitmap/basic.json +++ b/tests/qemublocktestdata/bitmap/basic.json @@ -1,117 +1,118 @@ [ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-format", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "dirty-bitmaps": [ - { - "name": "current", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 - }, - { - "name": "d", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "c", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "b", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - }, - { - "name": "a", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 - } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.qcow2", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "dirty-flag": false }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/tmp/pull4.qcow2", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - } + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "dirty-bitmaps": [ + { + "name": "current", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "d", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "c", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "b", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/tmp/bitmaps.qcow2", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + } ] diff --git a/tests/qemublocktestdata/bitmap/basic.out b/tests/qemublocktest= data/bitmap/basic.out index 539f7d9bad..5c4c35b3f0 100644 --- a/tests/qemublocktestdata/bitmap/basic.out +++ b/tests/qemublocktestdata/bitmap/basic.out @@ -1,6 +1,6 @@ libvirt-1-format: current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - d: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - b: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241110; cv=none; d=zohomail.com; s=zohoarc; b=UY4OAyqDE91+N076wOpuuFJJ6zOYuOYLLBIJg8Y5CWud8ly8zW66hRij8CmjP9L3RN3eUav+qKkzFnsUVZ8FliK06q3kQOnLsYtYCq8Na/GBL8FVgpCncQx9tNg4UlGT3aFZ2fn2bbLw6uP1zk8wlF4Mka3Ief5u4GI8iLO6lmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241110; 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=ZJK8PsMxKm+o93ajsGeiN6EmDzMevSsk8wQZEMmFuE8=; b=FrNlhBYugsUWyJ22rcDSuJxW4qo3gg4h3n/cAn6BjuP6sK4xRWKR7QMLOnbNFf21RYZ1DlN2oHNDlfoHO+aWPNxXLrRhlFmURCGeVIPiMqmcsfNyeZo7bwNUpEVigVP9rNx/sohRNQpkCjxGJrHIO1OeE/k0n2XT8aucTLs58Cg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241110754749.3519241712155; Mon, 15 Jun 2020 10:11:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-uNseIwgAOpyx6g8a_Ml0Jw-1; Mon, 15 Jun 2020 13:11:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D513113830C; Mon, 15 Jun 2020 17:11:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E89D7CAD9; Mon, 15 Jun 2020 17:11:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F387995AB1; Mon, 15 Jun 2020 17:11:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAlCM004822 for ; Mon, 15 Jun 2020 13:10:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 473D8100238C; Mon, 15 Jun 2020 17:10:47 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id B386D1001901 for ; Mon, 15 Jun 2020 17:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241109; 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=ZJK8PsMxKm+o93ajsGeiN6EmDzMevSsk8wQZEMmFuE8=; b=QgKbJV5csnZYHCzgeCi6QZvyyoO5oVZevH05XAlTl90gDzoo4KcRraQEk2AJpwasfVDIEG gDFkuJKF1K7iQjRYoGly9+k9n0LUR56OMNXHvBBb5vjQ8BLWZrvTpex0CbGbBfW/Uy8Gmt rtvY8sfRSwGffzuVulb87rkuu1EUWUI= X-MC-Unique: uNseIwgAOpyx6g8a_Ml0Jw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 15/32] qemublocktest: Replace 'snapshots' bitmap detection test case data Date: Mon, 15 Jun 2020 19:10:02 +0200 Message-Id: <702d20296ed83eef3d2b047976993493376f0410.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use test data which conforms to the new semantics which changed in the previous patch. The test data was created by the same set of commands as originally in commit 0b27b655b1bac480186ce80457113cd5dc34e6a1 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktestdata/bitmap/snapshots.json | 1382 +++++++---------- tests/qemublocktestdata/bitmap/snapshots.out | 13 +- 2 files changed, 588 insertions(+), 807 deletions(-) diff --git a/tests/qemublocktestdata/bitmap/snapshots.json b/tests/qemubloc= ktestdata/bitmap/snapshots.json index 87e77ad408..2a20aea812 100644 --- a/tests/qemublocktestdata/bitmap/snapshots.json +++ b/tests/qemublocktestdata/bitmap/snapshots.json @@ -1,836 +1,612 @@ [ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 104857600, + "filename": "/tmp/bitmaps.1591792950", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 225280, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "in-use", + "auto" + ], + "name": "current", + "granularity": 65536 + }, + { + "flags": [ + "in-use", + "auto" + ], + "name": "c", + "granularity": 65536 }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911550", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "in-use", - "auto" - ], - "name": "current", - "granularity": 65536 - }, - { - "flags": [ - "in-use" - ], - "name": "d", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } + { + "flags": [ + "in-use", + "auto" + ], + "name": "b", + "granularity": 65536 }, - "full-backing-filename": "/tmp/pull4.1575911540", - "backing-filename": "/tmp/pull4.1575911540", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-format", - "backing_file_depth": 4, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911540", - "dirty-bitmaps": [ { - "name": "d", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 + "flags": [ + "in-use", + "auto" + ], + "name": "a", + "granularity": 65536 }, { - "name": "current", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 + "flags": [ + "in-use", + "auto" + ], + "name": "d", + "granularity": 65536 } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1591792938", + "backing-filename": "/tmp/bitmaps.1591792938", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1591792938", + "dirty-bitmaps": [ + { + "name": "d", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "b", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "c", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "current", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1591792950", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 590336, + "filename": "/tmp/bitmaps.1591792950", + "format": "file", + "actual-size": 225280, + "dirty-flag": false }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911550", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-1-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911550", - "encryption_key_missing": false + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false + "file": "/tmp/bitmaps.1591792950", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 104857600, + "filename": "/tmp/bitmaps.1591792938", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 221184, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "auto" + ], + "name": "d", + "granularity": 65536 }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911540", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 212992, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "d", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "c", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } + { + "flags": [ + "auto" + ], + "name": "a", + "granularity": 65536 }, - "full-backing-filename": "/tmp/pull4.1575911527", - "backing-filename": "/tmp/pull4.1575911527", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-2-format", - "backing_file_depth": 3, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911527", - "dirty-bitmaps": [ { - "name": "c", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "b", + "granularity": 65536 }, { - "name": "d", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "c", + "granularity": 65536 } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1591792930", + "backing-filename": "/tmp/bitmaps.1591792930", + "dirty-flag": false }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 393728, - "filename": "/tmp/pull4.1575911540", - "format": "file", - "actual-size": 212992, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-2-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911540", - "encryption_key_missing": false + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-2-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1591792930", + "dirty-bitmaps": [ + { + "name": "c", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "b", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "d", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911527", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 217088, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "c", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "b", - "granularity": 65536 - }, - { - "flags": [ - - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.1575911522", - "backing-filename": "/tmp/pull4.1575911522", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-3-format", - "backing_file_depth": 2, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.1575911522", - "dirty-bitmaps": [ + "file": "/tmp/bitmaps.1591792938", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 524800, + "filename": "/tmp/bitmaps.1591792938", + "format": "file", + "actual-size": 221184, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-2-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1591792938", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 104857600, + "filename": "/tmp/bitmaps.1591792930", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 217088, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ { - "name": "a", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "c", + "granularity": 65536 }, { - "name": "b", - "recording": false, - "persistent": true, - "busy": false, - "status": "disabled", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "b", + "granularity": 65536 }, { - "name": "c", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "a", + "granularity": 65536 } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1591792925", + "backing-filename": "/tmp/bitmaps.1591792925", + "dirty-flag": false }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 459264, - "filename": "/tmp/pull4.1575911527", - "format": "file", - "actual-size": 217088, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-3-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911527", - "encryption_key_missing": false + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-3-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1591792925", + "dirty-bitmaps": [ + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "b", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "c", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 10485760, - "filename": "/tmp/pull4.1575911522", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/tmp/pull4.qcow2", - "backing-filename": "/tmp/pull4.qcow2", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-4-format", - "backing_file_depth": 1, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/tmp/pull4.qcow2", - "dirty-bitmaps": [ + "file": "/tmp/bitmaps.1591792930", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 459264, + "filename": "/tmp/bitmaps.1591792930", + "format": "file", + "actual-size": 217088, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-3-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1591792930", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 104857600, + "filename": "/tmp/bitmaps.1591792925", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 208896, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ { - "name": "a", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "a", + "granularity": 65536 } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.qcow2", + "backing-filename": "/tmp/bitmaps.qcow2", + "dirty-flag": false }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.1575911522", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-4-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.1575911522", - "encryption_key_missing": false + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-4-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.qcow2", + "dirty-bitmaps": [ + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 10485760, - "filename": "/tmp/pull4.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 208896, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "bitmaps": [ - { - "flags": [ - "auto" - ], - "name": "a", - "granularity": 65536 - } - ], - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "libvirt-5-format", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "dirty-bitmaps": [ + "file": "/tmp/bitmaps.1591792925", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 328192, + "filename": "/tmp/bitmaps.1591792925", + "format": "file", + "actual-size": 208896, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-4-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1591792925", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 104857600, + "filename": "/tmp/bitmaps.qcow2", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 208896, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ { - "name": "a", - "recording": true, - "persistent": true, - "busy": false, - "status": "active", - "granularity": 65536, - "count": 0 + "flags": [ + "auto" + ], + "name": "a", + "granularity": 65536 } - ], - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-5-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "dirty-bitmaps": [ + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 328192, + "filename": "/tmp/bitmaps.qcow2", + "format": "file", + "actual-size": 208896, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-5-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 328192, - "filename": "/tmp/pull4.qcow2", - "format": "file", - "actual-size": 208896, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "libvirt-5-storage", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/tmp/pull4.qcow2", - "encryption_key_missing": false - } + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + } ] diff --git a/tests/qemublocktestdata/bitmap/snapshots.out b/tests/qemublock= testdata/bitmap/snapshots.out index 5dafe946cf..24ca27e4d8 100644 --- a/tests/qemublocktestdata/bitmap/snapshots.out +++ b/tests/qemublocktestdata/bitmap/snapshots.out @@ -1,12 +1,17 @@ libvirt-1-format: - d: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 libvirt-2-format: - c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 libvirt-3-format: - a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 - b: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 libvirt-4-format: a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241200; cv=none; d=zohomail.com; s=zohoarc; b=KikP1huTOdL0ae+eSbWqRF/Qo5cuRC8/I4Fe7lvX1lPLuMFNNHjl2+GqLFw9Dc0hznVp1wh1PUMuVk70JfCv0iOwhphgMS5giUMYmZALMsQMr5ws7x/S6GXusxAtRrXiiqDvAARSFJ7+xiPncQGz1FcdoauI4Es0YG77B9RYWDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241200; 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=4UTHapttB787XvUNKJr+Qr9BxtPJaiRQlLpesMzVGt0=; b=VcJwkvW+0HwELwrSAWZbER0anUAW/FlGEfJ5Vr0xYM3kbadwSNFyvUfRCIayyvM9Xfmfu+0j0npwLoNMmgX9B65rnsU1MCX1eVio1UC8/1FZtnFSh9gzvSzFESP5OTHyOn4GRAmgeXA1vMh4pQujYUKxtAqh1uTcpHPp2QugTzE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241200057283.96571385793834; Mon, 15 Jun 2020 10:13:20 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-4XKPVPKNNEOxlrq7I-WALw-1; Mon, 15 Jun 2020 13:11:39 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CAED8184D151; Mon, 15 Jun 2020 17:11:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE6627FE9C; Mon, 15 Jun 2020 17:11:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 833FD95AB6; Mon, 15 Jun 2020 17:11:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAmVR004827 for ; Mon, 15 Jun 2020 13:10:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B83E100164D; Mon, 15 Jun 2020 17:10:48 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5D031001901 for ; Mon, 15 Jun 2020 17:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241198; 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=4UTHapttB787XvUNKJr+Qr9BxtPJaiRQlLpesMzVGt0=; b=Fs5CY6WEjwDZ8VH4bkOHpPqfcKrIFIv6NeFSMq1X0vwC9JFn+lpnGIPS7Y+VZJexlRccui qgigx0ItTrtbd/DjPwoTs5EUkISc0B+QoSQiK015z1aaNLSeBIkiqGJqrT4ZzwxgqflpUq KgUGiBHD0gWiAIkmbWwO14TlWSU+Jmk= X-MC-Unique: 4XKPVPKNNEOxlrq7I-WALw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/32] qemuBlockBitmapChainIsValid: Adjust to new semantics of bitmaps Date: Mon, 15 Jun 2020 19:10:03 +0200 Message-Id: <8c6887ef1e6aa20e2e4cf7a461d50f374ff74816.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reject duplicates and other problematic bitmaps according to the new semantics of bitmap use in libvirt. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 6f9c7071c9..83e3df9601 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2850,41 +2850,49 @@ qemuBlockGetNamedNodeData(virDomainObjPtr vm, /** * qemuBlockBitmapChainIsValid: * - * Validates that the backing chain of @src contains proper consistent bit= map - * data for a chain of bitmaps named @bitmapname. + * Validates that the backing chain of @src contains bitmaps which libvirt= will + * consider as properly corresponding to a checkpoint named @bitmapname. * - * A valid chain: - * 1) bitmaps of same name are in a consecutive subset of images without g= ap - * 2) don't have any inconsistent bitmaps + * The bitmaps need to: + * 1) start from the top image @src + * 2) must be present in consecutive layers + * 3) all must be active, persistent and not incosistent */ bool qemuBlockBitmapChainIsValid(virStorageSourcePtr src, const char *bitmapname, virHashTablePtr blockNamedNodeData) { - qemuBlockNamedNodeDataBitmapPtr bitmap; virStorageSourcePtr n; - bool chain_started =3D false; + bool found =3D false; bool chain_ended =3D false; - for (n =3D src; n; n =3D n->backingStore) { - if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedN= odeData, n, bitmapname))) { - if (chain_started) - chain_ended =3D true; + for (n =3D src; virStorageSourceIsBacking(n); n =3D n->backingStore) { + qemuBlockNamedNodeDataBitmapPtr bitmap; + + if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedN= odeData, + n, bitmapname= ))) { + /* rule 1, must start from top */ + if (!found) + return false; + + chain_ended =3D true; continue; } + /* rule 2, no-gaps */ if (chain_ended) return false; - chain_started =3D true; - - if (bitmap->inconsistent) + /* rule 3 */ + if (bitmap->inconsistent || !bitmap->persistent || !bitmap->record= ing) return false; + + found =3D true; } - return chain_started; + return found; } --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241105; cv=none; d=zohomail.com; s=zohoarc; b=Dnzmd5gzVSd9ikUKWQj287IjQxape+PeudyomMVXXHbmUCxN1P/jiH9ibW12PD3ILqd5km4+tlLT0VOeX2i1HeCGImG23nqyvaf1J5ztM0kQ9kaLWMdaWNL67rrXU7UldHs5jkUIFrr5a/YVLsqXUeY6eh/UVxpRVCTqpTB2JnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241105; 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=AkA4NAhaVVZecVpeVsHPyXOZ5hbj/5Fd7z6kGiBMRZE=; b=eZ1hjlF9N7Nt5HuaJYIYY6vhtJs+kkjoVpuDiY7fTRNy9jcCqvJGO3zCs33El5ERT0YBe6SNJ9jOZm26Xlbot4bZUfVHm+4N2uGnq/IfI+XOgsdylRn5nMPWqtTlD4Bo1T2jE0lmMuvy1ClRcXsBLFrMDZ/RdwVL2FlrRpHKAn0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241105260319.9308412817809; Mon, 15 Jun 2020 10:11:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-vXKwXtr1Pz6S8jUf4mUqGw-1; Mon, 15 Jun 2020 13:11:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F3DD11138317; Mon, 15 Jun 2020 17:11:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3E6460C05; Mon, 15 Jun 2020 17:11:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A503C1805311; Mon, 15 Jun 2020 17:11:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAnV6004839 for ; Mon, 15 Jun 2020 13:10:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FCC3100238C; Mon, 15 Jun 2020 17:10:49 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CE48100164D for ; Mon, 15 Jun 2020 17:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241104; 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=AkA4NAhaVVZecVpeVsHPyXOZ5hbj/5Fd7z6kGiBMRZE=; b=N6AexIvpqSR9XctG/ElX1EhxxQ1H1lLzQAPKOSJEPReBla/Z9zoEfjtAUcSy5IIM0mYiwc 7W11YEZqEljQzDacxis3ub1+qJ+qbz7OWuSYDPihl7ze8LphsWcfWy6P88q9C1f5E873Bn 0zk8+ksCNSrkbEe/VtNaxxUZwLJwheY= X-MC-Unique: vXKwXtr1Pz6S8jUf4mUqGw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/32] qemublocktest: Re-add bitmap validation for 'basic' and 'snapshots' cases Date: Mon, 15 Jun 2020 19:10:04 +0200 Message-Id: <4e24c91d8745c5ea12b67cf85610b79592454fd9.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that we've updated both the test data and the validator to new semantics we can start testing again. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 0ed9b99bc4..6d1bf3f250 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1346,6 +1346,18 @@ mymain(void) TEST_BITMAP_VALIDATE("empty", "a", false); + TEST_BITMAP_VALIDATE("basic", "a", true); + TEST_BITMAP_VALIDATE("basic", "b", true); + TEST_BITMAP_VALIDATE("basic", "c", true); + TEST_BITMAP_VALIDATE("basic", "d", true); + TEST_BITMAP_VALIDATE("basic", "current", true); + + TEST_BITMAP_VALIDATE("snapshots", "a", true); + TEST_BITMAP_VALIDATE("snapshots", "b", true); + TEST_BITMAP_VALIDATE("snapshots", "c", true); + TEST_BITMAP_VALIDATE("snapshots", "d", true); + TEST_BITMAP_VALIDATE("snapshots", "current", true); + #define TEST_BITMAP_BLOCKCOPY(testname, shllw, ndf) \ do { \ blockbitmapblockcopydata.name =3D testname; \ --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241137; cv=none; d=zohomail.com; s=zohoarc; b=fineNATEiJ8YSswPvCvjgIvFm6TDQLQ1iUHQI5gijCKVMj+myZN6gGFxjK02fndRNlSA2lc9mGT9sL8OLW+oNE67Mq9EN7SzjEU/AogqeXk7DRXs/+GRpYDK2LHhmYQKL2nYRMfCPXWspxO1K23tTxBz48npRayhKHd/FcLytRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241137; 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=S5GBnmgReYxCYN6o3w0gu5xg/PcFdKR9zhGaRcRexb4=; b=OueKGgxy8nfHiHOYH5FHZj7w/pGTNBrFD9nj8n+MwUqSQ8K6fhpD4N29PEhqUBx6pW8ZAnJ8p6k3JCtRdKGFvNBDHleS63332DDO+zzZ37muqXlwMFiyRzGcf8p8baEQA/Mrbu8H63oB8AcsqlyKaUcRxRkSldzW1z4kJh5/4TI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241137190606.1618263464022; Mon, 15 Jun 2020 10:12:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-175cLHAvNMCIgyAr-vdx8g-1; Mon, 15 Jun 2020 13:11:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D87F5AED4; Mon, 15 Jun 2020 17:11:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E9397CAD9; Mon, 15 Jun 2020 17:11:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E5BDA95AB9; Mon, 15 Jun 2020 17:11:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAovU004854 for ; Mon, 15 Jun 2020 13:10:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EBF0100238D; Mon, 15 Jun 2020 17:10:50 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AA0A100238C for ; Mon, 15 Jun 2020 17:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241135; 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=S5GBnmgReYxCYN6o3w0gu5xg/PcFdKR9zhGaRcRexb4=; b=WjOp0tjje5B6VtgUm8sFUOsf2Do9ws64B99yYiIflDIBbvm0SDkeaaXCW6JY6ubrqiRdRj iYgQAXEKlgdVMSqyTXh799T+Ix+pufQFKVNwodjLEFyztBRTeg2yuDoR+SLdIYtErve4WV 80uvpTBdmF3Cc1y1ZCObK/Umq0Re1PI= X-MC-Unique: 175cLHAvNMCIgyAr-vdx8g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 18/32] qemublocktest: Add new 'synthetic' bitmap detection and validation test case Date: Mon, 15 Jun 2020 19:10:05 +0200 Message-Id: <5a64c29271d31927c84cafc07c13c3496af1ccb5.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Based on the 'snapshots' example with manual tweaks to introduce inactive, transient, inconsistent and duplicate bitmaps in various parts of the chain to excercise detection and new validation code. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 11 + tests/qemublocktestdata/bitmap/synthetic.json | 506 ++++++++++++++++++ tests/qemublocktestdata/bitmap/synthetic.out | 15 + 3 files changed, 532 insertions(+) create mode 100644 tests/qemublocktestdata/bitmap/synthetic.json create mode 100644 tests/qemublocktestdata/bitmap/synthetic.out diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 6d1bf3f250..47e9f0f363 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1303,6 +1303,7 @@ mymain(void) TEST_BITMAP_DETECT("basic"); TEST_BITMAP_DETECT("snapshots"); + TEST_BITMAP_DETECT("synthetic"); #define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \ do { \ @@ -1358,6 +1359,16 @@ mymain(void) TEST_BITMAP_VALIDATE("snapshots", "d", true); TEST_BITMAP_VALIDATE("snapshots", "current", true); + TEST_BITMAP_VALIDATE("synthetic", "a", false); + TEST_BITMAP_VALIDATE("synthetic", "b", false); + TEST_BITMAP_VALIDATE("synthetic", "c", false); + TEST_BITMAP_VALIDATE("synthetic", "d", false); + TEST_BITMAP_VALIDATE("synthetic", "current", false); + TEST_BITMAP_VALIDATE("synthetic", "top-ok", true); + TEST_BITMAP_VALIDATE("synthetic", "top-inactive", false); + TEST_BITMAP_VALIDATE("synthetic", "top-transient", false); + TEST_BITMAP_VALIDATE("synthetic", "top-inactive-transient", false); + #define TEST_BITMAP_BLOCKCOPY(testname, shllw, ndf) \ do { \ blockbitmapblockcopydata.name =3D testname; \ diff --git a/tests/qemublocktestdata/bitmap/synthetic.json b/tests/qemubloc= ktestdata/bitmap/synthetic.json new file mode 100644 index 0000000000..3712c8e5fc --- /dev/null +++ b/tests/qemublocktestdata/bitmap/synthetic.json @@ -0,0 +1,506 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.1590749073", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 208896, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "in-use", + "auto" + ], + "name": "current", + "granularity": 65536 + } + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1590749012", + "backing-filename": "/tmp/bitmaps.1590749012", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1590749012", + "dirty-bitmaps": [ + { + "name": "current", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "inconsistent": true, + "granularity": 65536, + "count": 0 + }, + { + "name": "top-ok", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "top-inactive", + "recording": false, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "top-transient", + "recording": true, + "persistent": false, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "top-transient-inactive", + "recording": false, + "persistent": false, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590749073", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 328192, + "filename": "/tmp/bitmaps.1590749073", + "format": "file", + "actual-size": 208896, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-1-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590749073", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.1590749012", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 208896, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "auto" + ], + "name": "d", + "granularity": 65536 + } + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1590748995", + "backing-filename": "/tmp/bitmaps.1590748995", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-2-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1590748995", + "dirty-bitmaps": [ + { + "name": "d", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590749012", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 328192, + "filename": "/tmp/bitmaps.1590749012", + "format": "file", + "actual-size": 208896, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-2-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590749012", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.1590748995", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 212992, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "auto" + ], + "name": "c", + "granularity": 65536 + }, + { + "flags": [ + "auto" + ], + "name": "b", + "granularity": 65536 + } + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.1590748992", + "backing-filename": "/tmp/bitmaps.1590748992", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-3-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.1590748992", + "dirty-bitmaps": [ + { + "name": "b", + "recording": true, + "persistent": false, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "c", + "recording": false, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + }, + { + "name": "d", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590748995", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 393728, + "filename": "/tmp/bitmaps.1590748995", + "format": "file", + "actual-size": 212992, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-3-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590748995", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.1590748992", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/tmp/bitmaps.qcow2", + "backing-filename": "/tmp/bitmaps.qcow2", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-4-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/tmp/bitmaps.qcow2", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590748992", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/tmp/bitmaps.1590748992", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-4-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.1590748992", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/tmp/bitmaps.qcow2", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 208896, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "compression-type": "zlib", + "lazy-refcounts": false, + "bitmaps": [ + { + "flags": [ + "auto" + ], + "name": "a", + "granularity": 65536 + } + ], + "refcount-bits": 16, + "corrupt": false + } + }, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "libvirt-5-format", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "dirty-bitmaps": [ + { + "name": "a", + "recording": true, + "persistent": true, + "busy": false, + "status": "active", + "granularity": 65536, + "count": 0 + } + ], + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 328192, + "filename": "/tmp/bitmaps.qcow2", + "format": "file", + "actual-size": 208896, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "libvirt-5-storage", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/bitmaps.qcow2", + "encryption_key_missing": false + } +] diff --git a/tests/qemublocktestdata/bitmap/synthetic.out b/tests/qemublock= testdata/bitmap/synthetic.out new file mode 100644 index 0000000000..cde7228e01 --- /dev/null +++ b/tests/qemublocktestdata/bitmap/synthetic.out @@ -0,0 +1,15 @@ +libvirt-1-format: + current: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0 + top-ok: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + top-inactive: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + top-transient: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0 + top-transient-inactive: record:0 busy:0 persist:0 inconsist:0 gran:65536 = dirty:0 +libvirt-2-format: + d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-3-format: + b: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0 + c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 + d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-4-format: +libvirt-5-format: + a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241177; cv=none; d=zohomail.com; s=zohoarc; b=VOhzUGYPNG40NT2CCV4JdB+J9VIGYRW1JLOgJIUXIlZCFtRkDv/7SKV7Hw11MHIdl3YRRYF2eue9861rvKySu6NIjkwWe8J58Fqnr5GUALZdHOpQlYVgOxLClEQSrJ3RZM0zF1UcREBrdF++LZhEFAcwEFZI3zg8cai7fVrRblY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241177; 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=AzeFDzsfSVr6PUb1PRaQTexmrSwVjE1EL7kP5UsydZM=; b=dZ9MYYBXf++KGhc7wGtXyNUs3A3PSQfF4fCmWT1hUaW/ypO8VaQyI+YQ53fhN96UqUg9hFw7h40FmDIiR4qJ3c4BwqecB13mdbE+ZW9DA/pEnkU9oeDQ26mRpePidAYml2aKCrme/yMFjTe5nfNXV8eO/4oi+Q24b/iyCqNgB78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241177696754.05148318416; Mon, 15 Jun 2020 10:12:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-TgdhQ8zBPayd8av0uHLmPg-1; Mon, 15 Jun 2020 13:11:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9681B80B71F; Mon, 15 Jun 2020 17:10:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A8F97890F; Mon, 15 Jun 2020 17:10:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2EE86180954D; Mon, 15 Jun 2020 17:10:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHApTO004861 for ; Mon, 15 Jun 2020 13:10:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 08A60100238D; Mon, 15 Jun 2020 17:10:51 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 771AC100238C for ; Mon, 15 Jun 2020 17:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241176; 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=AzeFDzsfSVr6PUb1PRaQTexmrSwVjE1EL7kP5UsydZM=; b=DgJW4GO1wjjtbjh+3F0ZNUB1eOQszeNEvXPZZQhuwNFXrAEdqjD4JcPuFWT8ILGQDtWDa5 L9CJTgi0qGyenTl3JURXpYxZ7GC5faXGpffODix2t4r/HzkPwWRdVgwtcYckaZadoRy3sh 7T3ueAE9/+fDktlGz+Xu3Hojdcia+AY= X-MC-Unique: TgdhQ8zBPayd8av0uHLmPg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/32] qemu: checkpoint: Don't merge checkpoints during deletion Date: Mon, 15 Jun 2020 19:10:06 +0200 Message-Id: <515e349d989244a4914b7da1850abdd9ad5b5708.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that we've switched to the simple handling, the first thing that can be massively simplified is checkpoint deletion. We now need to only go through the backing chain and find the appropriately named bitmaps and delete them, no complex lookups or merging. Note that compared to other functions this deletes the bitmap in all layers compared to others where we expect only exactly 1 bitmap of a name in the backing chain to prevent potential problems. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 153 ++++++------------------------------- src/qemu/qemu_checkpoint.h | 1 - tests/qemublocktest.c | 7 +- 3 files changed, 25 insertions(+), 136 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 9b4f3ad396..c24d97443c 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -105,140 +105,41 @@ qemuCheckpointWriteMetadata(virDomainObjPtr vm, } -/** - * qemuCheckpointFindActiveDiskInParent: - * @vm: domain object - * @from: starting moment object - * @diskname: name (target) of the disk to find - * - * Find the first checkpoint starting from @from continuing through parents - * of the checkpoint which describes disk @diskname. Return the pointer to= the - * definition of the disk. - */ -static virDomainCheckpointDiskDef * -qemuCheckpointFindActiveDiskInParent(virDomainObjPtr vm, - virDomainMomentObjPtr from, - const char *diskname) -{ - virDomainMomentObjPtr parent =3D from; - virDomainCheckpointDefPtr parentdef =3D NULL; - size_t i; - - while (parent) { - parentdef =3D virDomainCheckpointObjGetDef(parent); - - for (i =3D 0; i < parentdef->ndisks; i++) { - virDomainCheckpointDiskDef *chkdisk =3D &parentdef->disks[i]; - - if (STRNEQ(chkdisk->name, diskname)) - continue; - - /* currently inspected checkpoint doesn't describe the disk, - * continue into parent checkpoint */ - if (chkdisk->type !=3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) - break; - - return chkdisk; - } - - parent =3D virDomainCheckpointFindByName(vm->checkpoints, - parentdef->parent.parent_na= me); - } - - return NULL; -} - - int qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, virHashTablePtr blockNamedNodeData, const char *delbitmap, - const char *parentbitmap, virJSONValuePtr actions, const char *diskdst, GSList **reopenimages) { - virStorageSourcePtr n =3D src; + virStorageSourcePtr n; + bool found =3D false; /* find the backing chain entry with bitmap named '@delbitmap' */ - while (n) { - qemuBlockNamedNodeDataBitmapPtr tmp; - - if ((tmp =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeD= ata, - n, delbitmap))) { - break; - } - - n =3D n->backingStore; - } - - if (!n) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("bitmap '%s' not found in backing chain of '%s'"), - delbitmap, diskdst); - return -1; - } - - while (n) { - qemuBlockNamedNodeDataBitmapPtr srcbitmap; - - if (!(srcbitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNam= edNodeData, - n, delbitm= ap))) - break; - - /* For the actual checkpoint deletion we will merge any bitmap int= o the - * bitmap of the parent checkpoint (@parentbitmap) or for any image - * where the parent checkpoint bitmap is not present we must rename - * the bitmap of the deleted checkpoint into the bitmap of the par= ent - * checkpoint as qemu can't currently take the allocation map and = turn - * it into a bitmap and thus we wouldn't be able to do a backup. */ - if (parentbitmap) { - qemuBlockNamedNodeDataBitmapPtr dstbitmap; - g_autoptr(virJSONValue) arr =3D NULL; - - dstbitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamed= NodeData, - n, parentbit= map); - - if (dstbitmap) { - if (srcbitmap->recording && !dstbitmap->recording) { - if (qemuMonitorTransactionBitmapEnable(actions, - n->nodeformat, - dstbitmap->name= ) < 0) - return -1; - } - - } else { - if (qemuMonitorTransactionBitmapAdd(actions, - n->nodeformat, - parentbitmap, - true, - !srcbitmap->recording, - srcbitmap->granularity= ) < 0) - return -1; - } + for (n =3D src; virStorageSourceIsBacking(n); n =3D n->backingStore) { + qemuBlockNamedNodeDataBitmapPtr bitmapdata; - arr =3D virJSONValueNewArray(); - - if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(arr, - n->nodefo= rmat, - srcbitmap= ->name) < 0) - return -1; + if (!(bitmapdata =3D qemuBlockNamedNodeDataGetBitmapByName(blockNa= medNodeData, + n, delbit= map))) + continue; - if (qemuMonitorTransactionBitmapMerge(actions, - n->nodeformat, - parentbitmap, &arr) < 0) - return -1; - } + found =3D true; if (qemuMonitorTransactionBitmapRemove(actions, n->nodeformat, - srcbitmap->name) < 0) + bitmapdata->name) < 0) return -1; if (n !=3D src) *reopenimages =3D g_slist_prepend(*reopenimages, n); + } - n =3D n->backingStore; + if (!found) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("bitmap '%s' not found in backing chain of '%s'"), + delbitmap, diskdst); + return -1; } return 0; @@ -247,8 +148,7 @@ qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr sr= c, static int qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, - virDomainCheckpointDefPtr chkdef, - virDomainMomentObjPtr parent) + virDomainCheckpointDefPtr chkdef) { qemuDomainObjPrivatePtr priv =3D vm->privateData; virQEMUDriverPtr driver =3D priv->driver; @@ -268,8 +168,6 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, for (i =3D 0; i < chkdef->ndisks; i++) { virDomainCheckpointDiskDef *chkdisk =3D &chkdef->disks[i]; virDomainDiskDefPtr domdisk =3D virDomainDiskByTarget(vm->def, chk= disk->name); - virDomainCheckpointDiskDef *parentchkdisk =3D NULL; - const char *parentbitmap =3D NULL; /* domdisk can be missing e.g. when it was unplugged */ if (!domdisk) @@ -278,15 +176,8 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, if (chkdisk->type !=3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; - /* If any ancestor checkpoint has a bitmap for the same - * disk, then this bitmap must be merged to the - * ancestor. */ - if ((parentchkdisk =3D qemuCheckpointFindActiveDiskInParent(vm, pa= rent, - chkdisk-= >name))) - parentbitmap =3D parentchkdisk->bitmap; - if (qemuCheckpointDiscardDiskBitmaps(domdisk->src, blockNamedNodeD= ata, - chkdisk->bitmap, parentbitmap, + chkdisk->bitmap, actions, domdisk->dst, &reopenimages) < 0) return -1; @@ -334,7 +225,6 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver, bool update_parent, bool metadata_only) { - virDomainMomentObjPtr parent =3D NULL; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); g_autofree char *chkFile =3D NULL; bool chkcurrent =3D chk =3D=3D virDomainCheckpointGetCurrent(vm->check= points); @@ -350,14 +240,17 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver, if (!metadata_only) { virDomainCheckpointDefPtr chkdef =3D virDomainCheckpointObjGetDef(= chk); - parent =3D virDomainCheckpointFindByName(vm->checkpoints, - chk->def->parent_name); - if (qemuCheckpointDiscardBitmaps(vm, chkdef, parent) < 0) + if (qemuCheckpointDiscardBitmaps(vm, chkdef) < 0) return -1; } if (chkcurrent) { + virDomainMomentObjPtr parent =3D NULL; + virDomainCheckpointSetCurrent(vm->checkpoints, NULL); + parent =3D virDomainCheckpointFindByName(vm->checkpoints, + chk->def->parent_name); + if (update_parent && parent) { virDomainCheckpointSetCurrent(vm->checkpoints, parent); if (qemuCheckpointWriteMetadata(vm, parent, diff --git a/src/qemu/qemu_checkpoint.h b/src/qemu/qemu_checkpoint.h index cf1e9e46cb..0d267a188c 100644 --- a/src/qemu/qemu_checkpoint.h +++ b/src/qemu/qemu_checkpoint.h @@ -76,7 +76,6 @@ int qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, virHashTablePtr blockNamedNodeData, const char *delbitmap, - const char *parentbitmap, virJSONValuePtr actions, const char *diskdst, GSList **reopenimages); diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 47e9f0f363..336ff4b3ef 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -830,7 +830,6 @@ struct testQemuCheckpointDeleteMergeData { const char *name; virStorageSourcePtr chain; const char *deletebitmap; - const char *parentbitmap; const char *nodedatafile; }; @@ -864,7 +863,6 @@ testQemuCheckpointDeleteMerge(const void *opaque) if (qemuCheckpointDiscardDiskBitmaps(data->chain, nodedata, data->deletebitmap, - data->parentbitmap, actions, "testdisk", &reopenimages) >=3D 0) { @@ -1319,19 +1317,18 @@ mymain(void) TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); -#define TEST_CHECKPOINT_DELETE_MERGE(testname, delbmp, parbmp, named) \ +#define TEST_CHECKPOINT_DELETE_MERGE(testname, delbmp, named) \ do { \ checkpointdeletedata.name =3D testname; \ checkpointdeletedata.chain =3D bitmapSourceChain; \ checkpointdeletedata.deletebitmap =3D delbmp; \ - checkpointdeletedata.parentbitmap =3D parbmp; \ checkpointdeletedata.nodedatafile =3D named; \ if (virTestRun("checkpoint delete " testname, \ testQemuCheckpointDeleteMerge, &checkpointdeletedat= a) < 0) \ ret =3D -1; \ } while (0) - TEST_CHECKPOINT_DELETE_MERGE("empty", "a", NULL, "empty"); + TEST_CHECKPOINT_DELETE_MERGE("empty", "a", "empty"); #define TEST_BITMAP_VALIDATE(testname, bitmap, rc) \ do { \ --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241127; cv=none; d=zohomail.com; s=zohoarc; b=a6d9679nR5nHuU0ufnoqMp+rlEQWCEqp+AgdROh+uB9G3zRbKHlbcqkdi976pfd5/WHBt5lzG8urXi1QQQTFpjJEVmoc5zMvs5c/lJdCcWprr6fnjOJiJXsIrhJxZeA6F7ZetnepUHhJC9zFsAX/CQNzGodUpoTptjtN23kYsf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241127; 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=HuvbxIUSujpaxFeS/fh5WXlithoVJGw7Pm22ZEidh3o=; b=fraP1qWSUnzRUa+xExBg6AeLJfYkuCi5wTtxqLs6RKt6LhHVAl0FxismcAwFcQ2CZi7woxKzbcX5cnbwnra67n6vVTbibk46FO6VdGmIjfgwZqqqkyz3yyeciK4J7bRGHk/+7z1hgpDJVIk7A4a+pqtl6i0rK2RFhHFxzHFsK3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15922411273721006.8377679804042; Mon, 15 Jun 2020 10:12:07 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-s_-ZUBqdNOuk5uKUetQcMA-1; Mon, 15 Jun 2020 13:11:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F08F10059B6; Mon, 15 Jun 2020 17:10:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C768B500B2; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 808D4180043B; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHApaD004875 for ; Mon, 15 Jun 2020 13:10:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id E327E1001901; Mon, 15 Jun 2020 17:10:51 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F93D100164D for ; Mon, 15 Jun 2020 17:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241126; 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=HuvbxIUSujpaxFeS/fh5WXlithoVJGw7Pm22ZEidh3o=; b=Bj556OWPivulbg9q8VQFfDLTWUrABNSkVAXz73SO3yDFYTCpbEMl3QfNrEUtDZCVGjc0RL tr5O6Z4VbRMJPby8CR4wpPiS4LhM/EqlGyuo89iNBLqyJDFjodTILlo40/KVgzwstIVHI+ z9/RVyWhqsgqteGUiLe++9LJBM94gF0= X-MC-Unique: s_-ZUBqdNOuk5uKUetQcMA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/32] qemublocktest: Rename TEST_CHECKPOINT_DELETE_MERGE to TEST_CHECKPOINT_DELETE Date: Mon, 15 Jun 2020 19:10:07 +0200 Message-Id: <00c85480566a87e6c734db3c1b30f9ff01ac1466.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Also rename the helper struct and function. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 336ff4b3ef..82297d0a8b 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -826,7 +826,7 @@ testQemuBackupIncrementalBitmapCalculate(const void *op= aque) static const char *checkpointDeletePrefix =3D "qemublocktestdata/checkpoin= tdelete/"; -struct testQemuCheckpointDeleteMergeData { +struct testQemuCheckpointDeleteData { const char *name; virStorageSourcePtr chain; const char *deletebitmap; @@ -835,9 +835,9 @@ struct testQemuCheckpointDeleteMergeData { static int -testQemuCheckpointDeleteMerge(const void *opaque) +testQemuCheckpointDelete(const void *opaque) { - const struct testQemuCheckpointDeleteMergeData *data =3D opaque; + const struct testQemuCheckpointDeleteData *data =3D opaque; g_autofree char *actual =3D NULL; g_autofree char *expectpath =3D NULL; g_autoptr(virJSONValue) actions =3D NULL; @@ -1037,7 +1037,7 @@ mymain(void) struct testJSONtoJSONData jsontojsondata; struct testQemuImageCreateData imagecreatedata; struct testQemuBackupIncrementalBitmapCalculateData backupbitmapcalcda= ta; - struct testQemuCheckpointDeleteMergeData checkpointdeletedata; + struct testQemuCheckpointDeleteData checkpointdeletedata; struct testQemuBlockBitmapValidateData blockbitmapvalidatedata; struct testQemuBlockBitmapBlockcopyData blockbitmapblockcopydata; struct testQemuBlockBitmapBlockcommitData blockbitmapblockcommitdata; @@ -1317,18 +1317,18 @@ mymain(void) TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); -#define TEST_CHECKPOINT_DELETE_MERGE(testname, delbmp, named) \ +#define TEST_CHECKPOINT_DELETE(testname, delbmp, named) \ do { \ checkpointdeletedata.name =3D testname; \ checkpointdeletedata.chain =3D bitmapSourceChain; \ checkpointdeletedata.deletebitmap =3D delbmp; \ checkpointdeletedata.nodedatafile =3D named; \ if (virTestRun("checkpoint delete " testname, \ - testQemuCheckpointDeleteMerge, &checkpointdeletedat= a) < 0) \ + testQemuCheckpointDelete, &checkpointdeletedata) < = 0) \ ret =3D -1; \ } while (0) - TEST_CHECKPOINT_DELETE_MERGE("empty", "a", "empty"); + TEST_CHECKPOINT_DELETE("empty", "a", "empty"); #define TEST_BITMAP_VALIDATE(testname, bitmap, rc) \ do { \ --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1592241069; cv=none; d=zohomail.com; s=zohoarc; b=XIFaHFtelQolMj50iZ22kV5NrX/ZidJS/IyI65+txmCxaOhiG9pKQd8BRE82GlTPGoh2wn/TA2NpE47z4WPb2lETo3a5nJ1YhOIAnkd/o44s1FkSVDB1WVqmtuTn7NziEo18cKQY/52aV1CiYno6gx7XuDGzaQRVvUgNEhn7hLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241069; 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=3bsB9VGkmz92oikUzO8+oArvOKhedOO0mqNVwR/h6XY=; b=TCXxal78QlgNONzJ6Amf2g9/8KpB9B0A1X7FOYU0ZW/YdWdxwiHYYqkgV0tAyeoQgGvxlLNOSBddK3JXOpYOfjOicOk213FlO9EJtQxJL+byT31vYJJV8C/J1+DveBhLXBfENtfhodsoHG54C+bCSsc+jicGpw6l1zGwsUozuoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592241069568728.1746659991563; Mon, 15 Jun 2020 10:11:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-Oxz0-kQ9Maa7wY79ykwAdw-1; Mon, 15 Jun 2020 13:11:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B43D1138326; Mon, 15 Jun 2020 17:10:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16F361001901; Mon, 15 Jun 2020 17:10:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D465B833DB; Mon, 15 Jun 2020 17:10:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAq8p004891 for ; Mon, 15 Jun 2020 13:10:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0C32100164D; Mon, 15 Jun 2020 17:10:52 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4827A1001901 for ; Mon, 15 Jun 2020 17:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241068; 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=3bsB9VGkmz92oikUzO8+oArvOKhedOO0mqNVwR/h6XY=; b=XUOvO4Z38tk63nhNXqr9pTVj/tnYhNmdaAQknNvJxAKV5LjO7+SIlrnJX2B5Ep4C1+Lbp+ xszWSRobSLsVk/RD51lHvbg9zt2jWtr7YrPFVDMJLpcdwW4RhCnarduhpRNx8QsJ/FvA/P reKGY/ODkKrpYKnE5PIjeex9Y0nLgzA= X-MC-Unique: Oxz0-kQ9Maa7wY79ykwAdw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/32] qemublocktest: Re-introduce testing of checkpoint deletion Date: Mon, 15 Jun 2020 19:10:08 +0200 Message-Id: <8bfbed293447cea36eee6ab74c7c75cdf9d6dd12.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Exercise the now arguably simpler checkpoint deletion code on the 'basic', 'snapshots', and 'synthetic' test data sets. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 18 ++++++++ .../checkpointdelete/basic-current-out.json | 9 ++++ .../basic-intermediate1-out.json | 9 ++++ .../basic-intermediate2-out.json | 9 ++++ .../basic-intermediate3-out.json | 9 ++++ .../checkpointdelete/basic-noparent-out.json | 9 ++++ .../snapshots-current-out.json | 9 ++++ .../snapshots-intermediate1-out.json | 26 ++++++++++++ .../snapshots-intermediate2-out.json | 26 ++++++++++++ .../snapshots-intermediate3-out.json | 18 ++++++++ .../snapshots-noparent-out.json | 42 +++++++++++++++++++ .../synthetic-current-out.json | 9 ++++ .../synthetic-intermediate1-out.json | 11 +++++ .../synthetic-intermediate2-out.json | 11 +++++ .../synthetic-intermediate3-out.json | 19 +++++++++ .../synthetic-noparent-out.json | 11 +++++ 16 files changed, 245 insertions(+) create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-current-= out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate1-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate2-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermed= iate3-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent= -out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-curr= ent-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate1-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate2-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-inte= rmediate3-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-nopa= rent-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-curr= ent-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-inte= rmediate1-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-inte= rmediate2-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-inte= rmediate3-out.json create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-nopa= rent-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 82297d0a8b..9e142a8851 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1330,6 +1330,24 @@ mymain(void) TEST_CHECKPOINT_DELETE("empty", "a", "empty"); + TEST_CHECKPOINT_DELETE("basic-noparent", "a", "basic"); + TEST_CHECKPOINT_DELETE("basic-intermediate1", "b", "basic"); + TEST_CHECKPOINT_DELETE("basic-intermediate2", "c", "basic"); + TEST_CHECKPOINT_DELETE("basic-intermediate3", "d", "basic"); + TEST_CHECKPOINT_DELETE("basic-current", "current", "basic"); + + TEST_CHECKPOINT_DELETE("snapshots-noparent", "a", "snapshots"); + TEST_CHECKPOINT_DELETE("snapshots-intermediate1", "b", "snapshots"); + TEST_CHECKPOINT_DELETE("snapshots-intermediate2", "c", "snapshots"); + TEST_CHECKPOINT_DELETE("snapshots-intermediate3", "d", "snapshots"); + TEST_CHECKPOINT_DELETE("snapshots-current", "current", "snapshots"); + + TEST_CHECKPOINT_DELETE("synthetic-noparent", "a", "synthetic"); + TEST_CHECKPOINT_DELETE("synthetic-intermediate1", "b", "synthetic"); + TEST_CHECKPOINT_DELETE("synthetic-intermediate2", "c", "synthetic"); + TEST_CHECKPOINT_DELETE("synthetic-intermediate3", "d", "synthetic"); + TEST_CHECKPOINT_DELETE("synthetic-current", "current", "synthetic"); + #define TEST_BITMAP_VALIDATE(testname, bitmap, rc) \ do { \ blockbitmapvalidatedata.name =3D testname; \ diff --git a/tests/qemublocktestdata/checkpointdelete/basic-current-out.jso= n b/tests/qemublocktestdata/checkpointdelete/basic-current-out.json new file mode 100644 index 0000000000..6ed1b63b66 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/basic-current-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "current" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.= json new file mode 100644 index 0000000000..e1dd4920cd --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "b" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.= json new file mode 100644 index 0000000000..5638532d35 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "c" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-o= ut.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.= json new file mode 100644 index 0000000000..8c56b0e689 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "d" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.js= on b/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json new file mode 100644 index 0000000000..e87382fdb4 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "a" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-current-out= .json b/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json new file mode 100644 index 0000000000..6ed1b63b66 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "current" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e1-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te1-out.json new file mode 100644 index 0000000000..1cde09131e --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.= json @@ -0,0 +1,26 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "b" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "b" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "b" + } + } +] +reopen nodes: +libvirt-3-format +libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e2-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te2-out.json new file mode 100644 index 0000000000..6fcd7ee0d1 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.= json @@ -0,0 +1,26 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "c" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "c" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "c" + } + } +] +reopen nodes: +libvirt-3-format +libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediat= e3-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermedia= te3-out.json new file mode 100644 index 0000000000..2977dc3042 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.= json @@ -0,0 +1,18 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "d" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "d" + } + } +] +reopen nodes: +libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-ou= t.json b/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.js= on new file mode 100644 index 0000000000..e4a6a413a3 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json @@ -0,0 +1,42 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "a" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "a" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "a" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-4-format", + "name": "a" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-5-format", + "name": "a" + } + } +] +reopen nodes: +libvirt-5-format +libvirt-4-format +libvirt-3-format +libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-current-out= .json b/tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json new file mode 100644 index 0000000000..6ed1b63b66 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-1-format", + "name": "current" + } + } +] diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediat= e1-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermedia= te1-out.json new file mode 100644 index 0000000000..6eb9716aaa --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate1-out.= json @@ -0,0 +1,11 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "b" + } + } +] +reopen nodes: +libvirt-3-format diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediat= e2-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermedia= te2-out.json new file mode 100644 index 0000000000..92b849cfc9 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate2-out.= json @@ -0,0 +1,11 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "c" + } + } +] +reopen nodes: +libvirt-3-format diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediat= e3-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermedia= te3-out.json new file mode 100644 index 0000000000..466df52007 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate3-out.= json @@ -0,0 +1,19 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "d" + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "d" + } + } +] +reopen nodes: +libvirt-3-format +libvirt-2-format diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-ou= t.json b/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.js= on new file mode 100644 index 0000000000..0479815f36 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.json @@ -0,0 +1,11 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-5-format", + "name": "a" + } + } +] +reopen nodes: +libvirt-5-format --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241079; cv=none; d=zohomail.com; s=zohoarc; b=Q9d2Vqg9GgC89pxRwMfP2tl7s1Ze592/tH7Pyw18KdA/Wld81WGd/UzLqoKrzyH0oaG9mLel//rtS6I22aC1JaBoJZMOO+h52lFtJz7soi16Y9LVHQmtC4Xh7+K4+gfY66dFvp/oemx1/a4ndw5r04ESSvQXXo9adrgEULvd93I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241079; 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=/2tEbsgoZKyhkql32exhSa3fBEOluNdA3DQIEA3o+/s=; b=PnUFDJ9A5dwHDlkWiXV9EGUIJPtI1SyMQk3D4i77LRlXXLZ0RAGpFi1cy6CEOYJKFM3lD55/0UG7GqgWCD1NtHToRx51InHzL7ilmVhdRFRXCaR4G+/Ye0tyKIFYtzKj0+kmD8aGWM6d6hECaex10s98QEo+17BabGWKuGt2LmY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241079687349.00018033682124; Mon, 15 Jun 2020 10:11:19 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-483-4_s2baPeP-2vsSu45RPXoQ-1; Mon, 15 Jun 2020 13:11:08 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2386F1138320; Mon, 15 Jun 2020 17:11:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03C105D9D5; Mon, 15 Jun 2020 17:11:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C828FB349D; Mon, 15 Jun 2020 17:11:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHArCW004897 for ; Mon, 15 Jun 2020 13:10:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id BE7A5100164D; Mon, 15 Jun 2020 17:10:53 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37D43100238C for ; Mon, 15 Jun 2020 17:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241078; 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=/2tEbsgoZKyhkql32exhSa3fBEOluNdA3DQIEA3o+/s=; b=HAZAVzKBqwINzYuCZFzbteXwbB9d4HjJfz+laf8A7fxsD3+0EhebHhzJKGTycoE4azwZZg zcvglwCFNczNbDi/udmFMFBLdvw74e2u9fqCX75dLcAKaCvobvcGPfKElzsyeFu9mRXFRN i9mnvL5m3AQBM6Q6iQq3tYGoIdAXpyc= X-MC-Unique: 4_s2baPeP-2vsSu45RPXoQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/32] qemu: block: Add universal helper for merging dirty bitmaps for all scenarios Date: Mon, 15 Jun 2020 19:10:09 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add a function which allows to merge bitmaps according to the new semantics and will allow to replace all the specific ad-hoc functions currently in use for 'backup', 'block commit', 'block copy' and will also be usable in the future for 'block pull' and non-shared storage migration. The semantics are a bit quirky for the 'backup' case but these quirks are documented and will prevent us from having two slightly different algorithms. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 172 ++++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_block.h | 10 +++ 2 files changed, 182 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 83e3df9601..86f8410ce7 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2847,6 +2847,178 @@ qemuBlockGetNamedNodeData(virDomainObjPtr vm, } +/** + * qemuBlockGetBitmapMergeActionsGetBitmaps: + * + * Collect a list of bitmaps which need to be handled in + * qemuBlockGetBitmapMergeActions. The list contains only valid bitmaps in= the + * sub-chain which is being processed. + * + * Note that the returned GSList contains bitmap names string pointers bor= rowed + * from @blockNamedNodeData so they must not be freed. + */ +static GSList * +qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc, + const char *bitmapname, + virHashTablePtr blockNamedNodeDat= a) +{ + g_autoptr(GSList) ret =3D NULL; + qemuBlockNamedNodeDataPtr entry; + size_t i; + + /* for now it doesn't make sense to consider bitmaps which are not pre= sent + * in @topsrc as we can't recreate a bitmap for a layer if it's missin= g */ + + if (!(entry =3D virHashLookup(blockNamedNodeData, topsrc->nodeformat))) + return NULL; + + for (i =3D 0; i < entry->nbitmaps; i++) { + qemuBlockNamedNodeDataBitmapPtr bitmap =3D entry->bitmaps[i]; + + if (bitmapname && + STRNEQ(bitmapname, bitmap->name)) + continue; + + if (!qemuBlockBitmapChainIsValid(topsrc, bitmap->name, blockNamedN= odeData)) + continue; + + ret =3D g_slist_prepend(ret, bitmap->name); + } + + return g_steal_pointer(&ret); +} + + +/** + * qemuBlockGetBitmapMergeActions: + * @topsrc: top of the chain to merge bitmaps in + * @basesrc: bottom of the chain to merge bitmaps in (NULL for full chain) + * @target: destination storage source of the merge (may be part of origin= al chain) + * @bitmapname: name of bitmap to perform the merge (NULL for all bitmaps) + * @dstbitmapname: name of destination bitmap of the merge (see below for = caveats) + * @writebitmapsrc: storage source corresponding to the node containing th= e write temporary bitmap + * @actions: returns actions for a 'transaction' QMP command for executing= the merge + * @blockNamedNodeData: hash table filled with qemuBlockNamedNodeData + * + * Calculate handling of dirty block bitmaps between @topsrc and @basesrc.= If + * @basesrc is NULL the end of the chain is considered. @target is the des= tination + * storage source definition of the merge and may or may not be part of the + * merged chain. + * + * Specifically the merging algorithm ensures that each considered bitmap = is + * merged with the appropriate bitmaps so that it properly describes + * the state of dirty blocks when looked at from @topsrc based on the depth + * of the backing chain where the bitmap is placed. + * + * If @bitmapname is non-NULL only bitmaps with that name are handled, oth= erwise + * all bitmaps are considered. + * + * If @dstbitmap is non-NULL everything is merged into a bitmap with that = name, + * otherwise each bitmap is merged into a bitmap with the same name into @= target. + * Additionally if @dstbitmap is non-NULL the target bitmap is created as = 'inactive' + * and 'transient' as a special case for the backup operation. + * + * If @writebitmapsrc is non-NULL, the 'libvirt-tmp-activewrite' bitmap fr= om + * given node is merged along with others. This bitmap corresponds to the = writes + * which occured between an active layer job finished and the rest of the = bitmap + * merging. + * + * If the bitmap is not valid somehow (see qemuBlockBitmapChainIsValid) gi= ven + * bitmap is silently skipped, so callers must ensure that given bitmap is= valid + * if they care about it. + * + * The resulting 'transacion' QMP command actions are filled in and return= ed via + * @actions. + * + * Note that @actions may be NULL if no merging is required. + */ +int +qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, + virStorageSourcePtr basesrc, + virStorageSourcePtr target, + const char *bitmapname, + const char *dstbitmapname, + virStorageSourcePtr writebitmapsrc, + virJSONValuePtr *actions, + virHashTablePtr blockNamedNodeData) +{ + g_autoptr(virJSONValue) act =3D virJSONValueNewArray(); + virStorageSourcePtr n; + + g_autoptr(GSList) bitmaps =3D NULL; + GSList *next; + + if (!(bitmaps =3D qemuBlockGetBitmapMergeActionsGetBitmaps(topsrc, bit= mapname, + blockNamedNod= eData))) + return 0; + + for (next =3D bitmaps; next; next =3D next->next) { + const char *curbitmap =3D next->data; + const char *mergebitmapname =3D dstbitmapname; + bool mergebitmappersistent =3D false; + bool mergebitmapdisabled =3D true; + g_autoptr(virJSONValue) merge =3D virJSONValueNewArray(); + unsigned long long granularity =3D 0; + qemuBlockNamedNodeDataBitmapPtr bitmap; + + /* explicitly named destinations mean that we want a temporary + * disabled bitmap only, so undo the default for non-explicit case= s */ + if (!mergebitmapname) { + mergebitmapname =3D curbitmap; + mergebitmappersistent =3D true; + mergebitmapdisabled =3D false; + } + + for (n =3D topsrc; virStorageSourceIsBacking(n) && n !=3D basesrc;= n =3D n->backingStore) { + if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNa= medNodeData, + n, curbit= map))) + continue; + + if (granularity =3D=3D 0) + granularity =3D bitmap->granularity; + + if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(merge, + n->nodefo= rmat, + bitmap->n= ame) < 0) + return -1; + } + + if (dstbitmapname || + !(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedN= odeData, + target, curbi= tmap))) { + + if (qemuMonitorTransactionBitmapAdd(act, + target->nodeformat, + mergebitmapname, + mergebitmappersistent, + mergebitmapdisabled, + granularity) < 0) + return -1; + } + + if (writebitmapsrc && + qemuMonitorTransactionBitmapMergeSourceAddBitmap(merge, + writebitmapsr= c->nodeformat, + "libvirt-tmp-= activewrite") < 0) + return -1; + + if (qemuMonitorTransactionBitmapMerge(act, target->nodeformat, + mergebitmapname, &merge) < 0) + return -1; + } + + if (writebitmapsrc && + qemuMonitorTransactionBitmapRemove(act, writebitmapsrc->nodeformat, + "libvirt-tmp-activewrite") < 0) + return -1; + + if (virJSONValueArraySize(act) > 0) + *actions =3D g_steal_pointer(&act); + + return 0; +} + + /** * qemuBlockBitmapChainIsValid: * diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 2ad2ce1a1f..0f5b4cfaa9 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -221,6 +221,16 @@ virHashTablePtr qemuBlockGetNamedNodeData(virDomainObjPtr vm, qemuDomainAsyncJob asyncJob); +int +qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, + virStorageSourcePtr basesrc, + virStorageSourcePtr target, + const char *bitmapname, + const char *dstbitmapname, + virStorageSourcePtr writebitmapsrc, + virJSONValuePtr *actions, + virHashTablePtr blockNamedNodeData); + bool qemuBlockBitmapChainIsValid(virStorageSourcePtr src, const char *bitmapname, --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241066; cv=none; d=zohomail.com; s=zohoarc; b=G5nh4qK/tJuHMKnMnPdRz06E8hLwCEzodifpB6WcsUwISK9Xqq55ImteDAR9k6Wvg6O+1uwG4uDhEaOUMKsKjWt8g1/8/QCkCduY6bbDh7JtLoVJIdJCaqVLlkIF4zeOblzCIiGa0vKmtMVNpSdm3teLX4J4zgjItU6DXVTm/vI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241066; 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=GB0774F8iPtjHmhI5oNT6mJYgpHpXE65Om0d2jJU2Ao=; b=hOMYQgTqdtgY51J2+v7cyiT+sSCiCy/VMGhTYRyWeV2TLZPT4nkzk4mz/AQ7qfGe4ba3lstkQdWF2ZuvQNg4K3kDw7Couq0dHTfrPsV97TMJi077nsPTkOdS7rK+6oMq1b34SpUMYTOSFAkqsdNk+EyTjV+YhvSBD7qb/PXNYlU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241066480951.0023913560264; Mon, 15 Jun 2020 10:11:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-B0mTpyVqPYO_XXMD2eDM1w-1; Mon, 15 Jun 2020 13:11:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11E90872FEE; Mon, 15 Jun 2020 17:10:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E923A768AE; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC554833CF; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAs25004912 for ; Mon, 15 Jun 2020 13:10:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id A8018100238C; Mon, 15 Jun 2020 17:10:54 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 212671001901 for ; Mon, 15 Jun 2020 17:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241065; 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=GB0774F8iPtjHmhI5oNT6mJYgpHpXE65Om0d2jJU2Ao=; b=H9rFiT4T+N6r/YUZdI0LB3vWzMaMRBoJaKfDB6Ga9kjHca46D0DkfIPra5P6AAe6bApMna 995uRI9nAyBXhJebcEJKDkvag6c5XmZuGbvo+iJJF+arNOP72cnkSw9etKx0nl6bkmKcBV CYngmhPnYI2GVxeabtETZP0J73zrrvs= X-MC-Unique: B0mTpyVqPYO_XXMD2eDM1w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 23/32] qemu: backup: Rewrite backup bitmap handling to the new bitmap semantics Date: Mon, 15 Jun 2020 19:10:10 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reuse qemuBlockGetBitmapMergeActions which allows to remove the ad-hoc iplementatio of bitmap merging for backup. The new approach is simpler and also more robust in case some of the bitmaps break as they remove the dependancy on the whole chain of bitmaps working. The new approach also allows backups if a snapshot is created outside of libvirt. Additionally the code is greatly simplified. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_backup.c | 220 +++--------------- src/qemu/qemu_backup.h | 12 +- tests/qemublocktest.c | 86 ++----- .../backupmerge/empty-out.json | 4 +- 4 files changed, 63 insertions(+), 259 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 495da86ff0..7c337846dc 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -173,199 +173,58 @@ qemuBackupDiskDataCleanup(virDomainObjPtr vm, } -/** - * qemuBackupBeginCollectIncrementalCheckpoints: - * @vm: domain object - * @incrFrom: name of checkpoint representing starting point of incrementa= l backup - * - * Returns a NULL terminated list of pointers to checkpoint definitions in - * chronological order starting from the 'current' checkpoint until reachi= ng - * @incrFrom. - */ -static virDomainMomentDefPtr * -qemuBackupBeginCollectIncrementalCheckpoints(virDomainObjPtr vm, - const char *incrFrom) -{ - virDomainMomentObjPtr n =3D virDomainCheckpointGetCurrent(vm->checkpoi= nts); - g_autofree virDomainMomentDefPtr *incr =3D NULL; - size_t nincr =3D 0; - - while (n) { - virDomainMomentDefPtr def =3D n->def; - - if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) - return NULL; - - if (STREQ(def->name, incrFrom)) { - def =3D NULL; - if (VIR_APPEND_ELEMENT_COPY(incr, nincr, def) < 0) - return NULL; - - return g_steal_pointer(&incr); - } - - if (!n->def->parent_name) - break; - - n =3D virDomainCheckpointFindByName(vm->checkpoints, n->def->paren= t_name); - } - - virReportError(VIR_ERR_OPERATION_INVALID, - _("could not locate checkpoint '%s' for incremental bac= kup"), - incrFrom); - return NULL; -} - - -static int -qemuBackupGetBitmapMergeRange(virStorageSourcePtr from, - const char *bitmapname, - virJSONValuePtr *actions, - virStorageSourcePtr *to, - const char *diskdst, - virHashTablePtr blockNamedNodeData) +int +qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain, + virStorageSourcePtr targetsrc, + const char *targetbitmap, + const char *incremental, + virJSONValuePtr actions, + virHashTablePtr blockNamedNodeData) { - g_autoptr(virJSONValue) ret =3D virJSONValueNewArray(); - virStorageSourcePtr tmpsrc =3D NULL; - virStorageSourcePtr n; - bool foundbitmap =3D false; + g_autoptr(virJSONValue) tmpactions =3D NULL; - for (n =3D from; virStorageSourceIsBacking(n); n =3D n->backingStore) { - qemuBlockNamedNodeDataBitmapPtr bitmap =3D NULL; - - if (!(bitmap =3D qemuBlockNamedNodeDataGetBitmapByName(blockNamedN= odeData, - n, - bitmapname))) - break; - - foundbitmap =3D true; - - if (bitmap->inconsistent) { - virReportError(VIR_ERR_INVALID_ARG, - _("bitmap '%s' for image '%s%u' is inconsistent= "), - bitmap->name, diskdst, n->id); - return -1; - } - - if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(ret, - n->nodeformat, - bitmapname) <= 0) - return -1; - - tmpsrc =3D n; - } - - if (!foundbitmap) { - virReportError(VIR_ERR_INVALID_ARG, - _("failed to find bitmap '%s' in image '%s%u'"), - bitmapname, diskdst, from->id); + if (qemuBlockGetBitmapMergeActions(backingChain, NULL, targetsrc, + incremental, targetbitmap, NULL, + &tmpactions, + blockNamedNodeData) < 0) return -1; - } - *actions =3D g_steal_pointer(&ret); - *to =3D tmpsrc; + if (tmpactions && + virJSONValueArrayConcat(actions, tmpactions) < 0) + return -1; return 0; } -virJSONValuePtr -qemuBackupDiskPrepareOneBitmapsChain(virDomainMomentDefPtr *incremental, - virStorageSourcePtr backingChain, - virHashTablePtr blockNamedNodeData, - const char *diskdst) -{ - g_autoptr(virJSONValue) ret =3D NULL; - size_t incridx =3D 0; - virStorageSourcePtr n =3D backingChain; - - ret =3D virJSONValueNewArray(); - - for (incridx =3D 0; incremental[incridx]; incridx++) { - g_autoptr(virJSONValue) tmp =3D virJSONValueNewArray(); - virStorageSourcePtr tmpsrc =3D NULL; - virDomainCheckpointDefPtr chkdef =3D (virDomainCheckpointDefPtr) i= ncremental[incridx]; - bool checkpoint_has_disk =3D false; - size_t i; - - for (i =3D 0; i < chkdef->ndisks; i++) { - if (STRNEQ_NULLABLE(diskdst, chkdef->disks[i].name)) - continue; - - if (chkdef->disks[i].type =3D=3D VIR_DOMAIN_CHECKPOINT_TYPE_BI= TMAP) - checkpoint_has_disk =3D true; - - break; - } - - if (!checkpoint_has_disk) { - if (!incremental[incridx + 1]) { - virReportError(VIR_ERR_INVALID_ARG, - _("disk '%s' not found in checkpoint '%s'"), - diskdst, incremental[incridx]->name); - return NULL; - } - - continue; - } - - if (qemuBackupGetBitmapMergeRange(n, incremental[incridx]->name, - &tmp, &tmpsrc, diskdst, - blockNamedNodeData) < 0) - return NULL; - - if (virJSONValueArrayConcat(ret, tmp) < 0) - return NULL; - - n =3D tmpsrc; - } - - return g_steal_pointer(&ret); -} - - static int qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd, virJSONValuePtr actions, - virDomainMomentDefPtr *incremental, virHashTablePtr blockNamedNodeData) { - g_autoptr(virJSONValue) mergebitmaps =3D NULL; - g_autoptr(virJSONValue) mergebitmapsstore =3D NULL; - - if (!(mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incrementa= l, - dd->domdisk-= >src, - blockNamedNo= deData, - dd->domdisk-= >dst))) - return -1; - - if (!(mergebitmapsstore =3D virJSONValueCopy(mergebitmaps))) - return -1; - - if (qemuMonitorTransactionBitmapAdd(actions, - dd->domdisk->src->nodeformat, - dd->incrementalBitmap, - false, - true, 0) < 0) - return -1; - - if (qemuMonitorTransactionBitmapMerge(actions, - dd->domdisk->src->nodeformat, - dd->incrementalBitmap, - &mergebitmaps) < 0) + if (!qemuBlockBitmapChainIsValid(dd->domdisk->src, + dd->backupdisk->incremental, + blockNamedNodeData)) { + virReportError(VIR_ERR_INVALID_ARG, + _("missing or broken bitmap '%s' for disk '%s'"), + dd->backupdisk->incremental, dd->domdisk->dst); return -1; + } - if (qemuMonitorTransactionBitmapAdd(actions, - dd->store->nodeformat, - dd->incrementalBitmap, - false, - true, 0) < 0) + if (qemuBackupDiskPrepareOneBitmapsChain(dd->domdisk->src, + dd->domdisk->src, + dd->incrementalBitmap, + dd->backupdisk->incremental, + actions, + blockNamedNodeData) < 0) return -1; - if (qemuMonitorTransactionBitmapMerge(actions, - dd->store->nodeformat, - dd->incrementalBitmap, - &mergebitmapsstore) < 0) + if (qemuBackupDiskPrepareOneBitmapsChain(dd->domdisk->src, + dd->store, + dd->incrementalBitmap, + dd->backupdisk->incremental, + actions, + blockNamedNodeData) < 0) return -1; return 0; @@ -382,7 +241,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, virQEMUDriverConfigPtr cfg) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - g_autofree virDomainMomentDefPtr *incremental =3D NULL; /* set data structure */ dd->backupdisk =3D backupdisk; @@ -420,16 +278,12 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, return -1; if (dd->backupdisk->incremental) { - if (!(incremental =3D qemuBackupBeginCollectIncrementalCheckpoints= (vm, dd->backupdisk->incremental))) - return -1; - if (dd->backupdisk->exportbitmap) dd->incrementalBitmap =3D g_strdup(dd->backupdisk->exportbitma= p); else dd->incrementalBitmap =3D g_strdup_printf("backup-%s", dd->dom= disk->dst); - if (qemuBackupDiskPrepareOneBitmaps(dd, actions, incremental, - blockNamedNodeData) < 0) + if (qemuBackupDiskPrepareOneBitmaps(dd, actions, blockNamedNodeDat= a) < 0) return -1; } @@ -883,8 +737,8 @@ qemuBackupBegin(virDomainObjPtr vm, if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEMU_ASYNC_= JOB_BACKUP))) goto endjob; - if ((ndd =3D qemuBackupDiskPrepareData(vm, def, blockNamedNodeData, - actions, cfg, &dd)) <=3D 0) { + if ((ndd =3D qemuBackupDiskPrepareData(vm, def, blockNamedNodeData, ac= tions, + cfg, &dd)) <=3D 0) { if (ndd =3D=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("no disks selected for backup")); diff --git a/src/qemu/qemu_backup.h b/src/qemu/qemu_backup.h index b19c3bf1c9..075fde709b 100644 --- a/src/qemu/qemu_backup.h +++ b/src/qemu/qemu_backup.h @@ -53,8 +53,10 @@ qemuBackupGetJobInfoStats(virQEMUDriverPtr driver, qemuDomainJobInfoPtr jobInfo); /* exported for testing */ -virJSONValuePtr -qemuBackupDiskPrepareOneBitmapsChain(virDomainMomentDefPtr *incremental, - virStorageSourcePtr backingChain, - virHashTablePtr blockNamedNodeData, - const char *diskdst); +int +qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain, + virStorageSourcePtr targetsrc, + const char *targetbitmap, + const char *incremental, + virJSONValuePtr actions, + virHashTablePtr blockNamedNodeData); diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 9e142a8851..30662f6f79 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -716,65 +716,6 @@ testQemuBitmapGetFakeChainEntry(virStorageSourcePtr sr= c, } -typedef virDomainMomentDefPtr testMomentList; - -static void -testMomentListFree(testMomentList *list) -{ - testMomentList *tmp =3D list; - - if (!list) - return; - - while (*tmp) { - virObjectUnref(*tmp); - tmp++; - } - - g_free(list); -} - -G_DEFINE_AUTOPTR_CLEANUP_FUNC(testMomentList, testMomentListFree); - -static virDomainMomentDefPtr -testQemuBackupGetIncrementalMoment(const char *name) -{ - virDomainCheckpointDefPtr checkpoint =3D NULL; - - if (!(checkpoint =3D virDomainCheckpointDefNew())) - abort(); - - checkpoint->disks =3D g_new0(virDomainCheckpointDiskDef, 1); - checkpoint->ndisks =3D 1; - - checkpoint->disks[0].name =3D g_strdup("testdisk"); - checkpoint->disks[0].type =3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP; - - checkpoint->parent.name =3D g_strdup(name); - - return (virDomainMomentDefPtr) checkpoint; -} - - -static virDomainMomentDefPtr * -testQemuBackupGetIncremental(const char *incFrom) -{ - const char *checkpoints[] =3D {"current", "d", "c", "b", "a"}; - virDomainMomentDefPtr *incr; - size_t i; - - incr =3D g_new0(virDomainMomentDefPtr, G_N_ELEMENTS(checkpoints) + 1); - - for (i =3D 0; i < G_N_ELEMENTS(checkpoints); i++) { - incr[i] =3D testQemuBackupGetIncrementalMoment(checkpoints[i]); - - if (STREQ(incFrom, checkpoints[i])) - break; - } - - return incr; -} - static const char *backupDataPrefix =3D "qemublocktestdata/backupmerge/"; struct testQemuBackupIncrementalBitmapCalculateData { @@ -791,10 +732,10 @@ testQemuBackupIncrementalBitmapCalculate(const void *= opaque) const struct testQemuBackupIncrementalBitmapCalculateData *data =3D op= aque; g_autoptr(virJSONValue) nodedatajson =3D NULL; g_autoptr(virHashTable) nodedata =3D NULL; - g_autoptr(virJSONValue) mergebitmaps =3D NULL; - g_autofree char *actual =3D NULL; + g_autoptr(virJSONValue) actions =3D virJSONValueNewArray(); g_autofree char *expectpath =3D NULL; - g_autoptr(testMomentList) incremental =3D NULL; + g_autoptr(virStorageSource) target =3D NULL; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; expectpath =3D g_strdup_printf("%s/%s%s-out.json", abs_srcdir, backupDataPrefix, data->name); @@ -808,19 +749,24 @@ testQemuBackupIncrementalBitmapCalculate(const void *= opaque) return -1; } - incremental =3D testQemuBackupGetIncremental(data->incremental); + if (!(target =3D virStorageSourceNew())) + return -1; - if ((mergebitmaps =3D qemuBackupDiskPrepareOneBitmapsChain(incremental, - data->chain, - nodedata, - "testdisk")))= { - if (!(actual =3D virJSONValueToString(mergebitmaps, true))) + target->nodeformat =3D g_strdup_printf("target_node"); + + if (qemuBackupDiskPrepareOneBitmapsChain(data->chain, + target, + "target-bitmap-name", + data->incremental, + actions, + nodedata) >=3D 0) { + if (virJSONValueToBuffer(actions, &buf, true) < 0) return -1; } else { - actual =3D g_strdup("NULL\n"); + virBufferAddLit(&buf, "NULL\n"); } - return virTestCompareToFile(actual, expectpath); + return virTestCompareToFile(virBufferCurrentContent(&buf), expectpath); } diff --git a/tests/qemublocktestdata/backupmerge/empty-out.json b/tests/qem= ublocktestdata/backupmerge/empty-out.json index 7951defec1..41b42e677b 100644 --- a/tests/qemublocktestdata/backupmerge/empty-out.json +++ b/tests/qemublocktestdata/backupmerge/empty-out.json @@ -1 +1,3 @@ -NULL +[ + +] --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241198; cv=none; d=zohomail.com; s=zohoarc; b=ASjerdKFMlufXzOF2Z203M/X88S4XQc1fJEjTMMPbvAxRCPtdakqdONIr78RjldBydpI+tDBFVup2QP1pkfD1ZqewxgJhetxTeUuoKN8aBaCkUhIMaR2sipI23ofVj2UskQqROVfncth0Na3eNbmOIl5wCdKrhrvIpII/nySdjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241198; 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=ZdtsWCfaMJWV6TbXSwAOq4udENTOcZAeJjBCfYO75go=; b=GnNA/rAwhmEjuC6bkEez5Zn8FyqYJridFzgg9G1F5wr0vgXocWFc6pHVJglqB1uLavpHWQATEhhl6Zk37rRj1bP0B/OjNMFBHwb2m3PpeHRVzYAn9wwhFGWEqV3cZ1yk8Ap06fsJqTF5ZAcsbVIKi5cV5qXSFqVy69wdOzyVQTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241198584130.0834338494658; Mon, 15 Jun 2020 10:13:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-U2AfjzKeOvK9mcxC_-c5HQ-1; Mon, 15 Jun 2020 13:11:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BBB78730EB; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 411357FE9E; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 13BD7104912; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAtXR004924 for ; Mon, 15 Jun 2020 13:10:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95ED61002394; Mon, 15 Jun 2020 17:10:55 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1055F100238D for ; Mon, 15 Jun 2020 17:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241197; 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=ZdtsWCfaMJWV6TbXSwAOq4udENTOcZAeJjBCfYO75go=; b=eqpV8kR8ETGZjleP62Bu6VH5sqKN4LLub30ZD3pmi5pVaTvJoUp+gwZPv4JNGj7LWeeEWN eakbfHztl4/SwP/qyAmv7VdEKwNarmgG5kthlApP7Zz50XQzW4zCgvMetcTkR5h2C5zKQO AI4X+VR6rJFCnRrldBKbcjOxDTphkBo= X-MC-Unique: U2AfjzKeOvK9mcxC_-c5HQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 24/32] qemublocktest: Add 'basic' tests for backup bitmap handling Date: Mon, 15 Jun 2020 19:10:11 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The 'basic' case is just a single backing store layer containing the bitmaps so we just copy the bitmaps over to the backup bitmap. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 4 +++ .../backupmerge/basic-deep-out.json | 25 +++++++++++++++++++ .../backupmerge/basic-flat-out.json | 25 +++++++++++++++++++ .../backupmerge/basic-intermediate-out.json | 25 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 tests/qemublocktestdata/backupmerge/basic-deep-out.json create mode 100644 tests/qemublocktestdata/backupmerge/basic-flat-out.json create mode 100644 tests/qemublocktestdata/backupmerge/basic-intermediate-= out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 30662f6f79..1300e0cbe9 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1263,6 +1263,10 @@ mymain(void) TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty"); + TEST_BACKUP_BITMAP_CALCULATE("basic-flat", bitmapSourceChain, "current= ", "basic"); + TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, = "d", "basic"); + TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "ba= sic"); + #define TEST_CHECKPOINT_DELETE(testname, delbmp, named) \ do { \ checkpointdeletedata.name =3D testname; \ diff --git a/tests/qemublocktestdata/backupmerge/basic-deep-out.json b/test= s/qemublocktestdata/backupmerge/basic-deep-out.json new file mode 100644 index 0000000000..ff77af789b --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/basic-deep-out.json @@ -0,0 +1,25 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/backupmerge/basic-flat-out.json b/test= s/qemublocktestdata/backupmerge/basic-flat-out.json new file mode 100644 index 0000000000..4637bbc377 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/basic-flat-out.json @@ -0,0 +1,25 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/backupmerge/basic-intermediate-out.jso= n b/tests/qemublocktestdata/backupmerge/basic-intermediate-out.json new file mode 100644 index 0000000000..f2f3b3f568 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/basic-intermediate-out.json @@ -0,0 +1,25 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + } + ] + } + } +] --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241070; cv=none; d=zohomail.com; s=zohoarc; b=CTphpvBsLFH9TYa1vOvkcY7CTvJMbEvKpj7p0XI2BcASaVF147IBKeSbRPTuGG7UKNDeiXJIY2451ZHJRMfZHjTma4Bh5nzBiZqhLVWlx1yKIRnbA0zk8JjapR06dIret5VxKrYg3XCGTbgeV5n00DxO36fjnn5k85K/UvgwaEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241070; 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=4TBAK2rVFHUjDDYnJX7bdmLhlvPWDI2nMluZp1wuNq8=; b=Qfa4UPhWcg6PQCURUp0ETVjhVmRhrwQKkpTAjuwYF4FhrMfSdwr5ifXtc2zuMx/3G76HKqO31OIAQnVGUrwz8etZdv93iUsblPEvbmXovX2oV95CaLArxa0ABczdGjONPRpAQ+sFE8pQBRlqnmZgKV1scJbz1gPuAPIAVpR3jo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241070864892.1542121527654; Mon, 15 Jun 2020 10:11:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-bEnabzqhNbSOFu-xbOQ7IA-1; Mon, 15 Jun 2020 13:11:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E24A8035D3; Mon, 15 Jun 2020 17:11:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C4FB5C5D9; Mon, 15 Jun 2020 17:11:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC3CE833DD; Mon, 15 Jun 2020 17:11:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAuQ2004929 for ; Mon, 15 Jun 2020 13:10:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 861341002394; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id F02BA100238D for ; Mon, 15 Jun 2020 17:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241069; 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=4TBAK2rVFHUjDDYnJX7bdmLhlvPWDI2nMluZp1wuNq8=; b=KHK/BhI1EKeLThzkPe7lRbP8Ai57W3PHrSa30Nmz4qP2C/aDuWDZEOG0l5/FDJqcjJ6wVu ELh6PUpXheNHUA229AN6LBgamhiwilPXAhlXRlFVc7kYo4mY53aK0kROasTq65Vv9Z1pc6 arbRyHF4WiZOGrAcuZs62zTeU9yfcPA= X-MC-Unique: bEnabzqhNbSOFu-xbOQ7IA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 25/32] qemublocktest: Add 'snapshots' tests for backup bitmap handling Date: Mon, 15 Jun 2020 19:10:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The 'snapshots' case has multiple layers so we need to make sure that the bitmaps are merged with the appropriate temporary bitmaps formatted from the allocation bitmap for any backing chain layer above. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 4 ++ .../backupmerge/snapshots-deep-out.json | 41 +++++++++++++++++++ .../backupmerge/snapshots-flat-out.json | 25 +++++++++++ .../snapshots-intermediate-out.json | 29 +++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 tests/qemublocktestdata/backupmerge/snapshots-deep-out.= json create mode 100644 tests/qemublocktestdata/backupmerge/snapshots-flat-out.= json create mode 100644 tests/qemublocktestdata/backupmerge/snapshots-intermedi= ate-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 1300e0cbe9..fd6dff82f9 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1267,6 +1267,10 @@ mymain(void) TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, = "d", "basic"); TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "ba= sic"); + TEST_BACKUP_BITMAP_CALCULATE("snapshots-flat", bitmapSourceChain, "cur= rent", "snapshots"); + TEST_BACKUP_BITMAP_CALCULATE("snapshots-intermediate", bitmapSourceCha= in, "d", "snapshots"); + TEST_BACKUP_BITMAP_CALCULATE("snapshots-deep", bitmapSourceChain, "a",= "snapshots"); + #define TEST_CHECKPOINT_DELETE(testname, delbmp, named) \ do { \ checkpointdeletedata.name =3D testname; \ diff --git a/tests/qemublocktestdata/backupmerge/snapshots-deep-out.json b/= tests/qemublocktestdata/backupmerge/snapshots-deep-out.json new file mode 100644 index 0000000000..d678507b85 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/snapshots-deep-out.json @@ -0,0 +1,41 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "a" + }, + { + "node": "libvirt-5-format", + "name": "a" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/backupmerge/snapshots-flat-out.json b/= tests/qemublocktestdata/backupmerge/snapshots-flat-out.json new file mode 100644 index 0000000000..4637bbc377 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/snapshots-flat-out.json @@ -0,0 +1,25 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/backupmerge/snapshots-intermediate-out= .json b/tests/qemublocktestdata/backupmerge/snapshots-intermediate-out.json new file mode 100644 index 0000000000..30d8bcd8b7 --- /dev/null +++ b/tests/qemublocktestdata/backupmerge/snapshots-intermediate-out.json @@ -0,0 +1,29 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "target_node", + "name": "target-bitmap-name", + "persistent": false, + "disabled": true, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "target_node", + "target": "target-bitmap-name", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "d" + } + ] + } + } +] --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241142; cv=none; d=zohomail.com; s=zohoarc; b=POH9OEEZGQaV2NhmabcxRqmc1QngZ/pSapplOFKnrFRTo3KIjkgFJ+8jynoRM3wK/pgSFcAfwIVMoIqujZjE99YxIhMvKuOlyXoc5cJo3rpH8LDyxr82PMlHXmAjvbzcFG5rX5MCa0XpTbK6Kq4HXMkCkphpDxOZnNmcmwWY/TQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241142; 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=SmBGw8fsEYkOUuKZxwh0qFq2kx1N3596muFA0f6kyOw=; b=h9f5QVDzEHqoBnStP7JYCjPErog5cZGBgrAy03M1ImiNBuZ8lfsF2a1lmcjbTFqJuAjSqmY+pRLBpbuRvh7SPpWCe5p0IvNk53LKv4IeIuRTcqZZprp4dBzLG8VgKLZLPHXx9b2NZwsmg37AAwgKpjQuoy/Czmg9kERGLib7Rjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241142778404.1045723588844; Mon, 15 Jun 2020 10:12:22 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-YLLPY3pyMZOHKTZv29PtxQ-1; Mon, 15 Jun 2020 13:11:13 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C3C210059C2; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 668E71001901; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 36CF3180954D; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHAvkG004937 for ; Mon, 15 Jun 2020 13:10:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 72A76100164D; Mon, 15 Jun 2020 17:10:57 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id DED0F10027A6 for ; Mon, 15 Jun 2020 17:10:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241141; 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=SmBGw8fsEYkOUuKZxwh0qFq2kx1N3596muFA0f6kyOw=; b=bEhFdXN3/9LBbC2WGEej1FW3F5kx68YdB1pVlASsEE59xBGFpsIVbqFOPlBz2C+O2V4AXh 51DGwcYkbxfUUQuo0t1JeYTpsS56N82d7lJauvzMd2VmDK3SulraKdJnLhBYI7tVhtcE+y sv7yTzLcYnaxcg5XqOcxMaqWw9D1kz8= X-MC-Unique: YLLPY3pyMZOHKTZv29PtxQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 26/32] qemu: Rewrite bitmap handling for block commit Date: Mon, 15 Jun 2020 19:10:13 +0200 Message-Id: <11c26e4f87334ca4df3ed140fb0ff05eaff9c907.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reuse qemuBlockGetBitmapMergeActions which allows to remove the ad-hoc implementatio of bitmap merging for block commit. The new approach is way simpler and more robust and also allows us to get rid of the disabling of bitmaps done prior to the start as we actually do want to update the bitmaps in the base. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 203 +----------------- src/qemu/qemu_block.h | 11 +- src/qemu/qemu_blockjob.c | 25 ++- src/qemu/qemu_driver.c | 56 +---- tests/qemublocktest.c | 18 +- .../qemublocktestdata/bitmapblockcommit/empty | 1 - 6 files changed, 42 insertions(+), 272 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 86f8410ce7..e958fb71fa 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3209,117 +3209,7 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr= src, /** * @topsrc: virStorageSource representing 'top' of the job * @basesrc: virStorageSource representing 'base' of the job - * @blockNamedNodeData: hash table containing data about bitmaps - * @actions: filled with arguments for a 'transaction' command - * @disabledBitmapsBase: filled with a list of bitmap names which must be = disabled - * - * Prepares data for correctly handling bitmaps during the start of a comm= it - * job. The bitmaps in the 'base' image must be disabled, so that the writ= es - * done by the blockjob don't dirty the enabled bitmaps. - * - * @actions and @disabledBitmapsBase are untouched if no bitmaps need - * to be disabled. - */ -int -qemuBlockBitmapsHandleCommitStart(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, - virHashTablePtr blockNamedNodeData, - virJSONValuePtr *actions, - char ***disabledBitmapsBase) -{ - g_autoptr(virJSONValue) act =3D virJSONValueNewArray(); - VIR_AUTOSTRINGLIST bitmaplist =3D NULL; - size_t curbitmapstr =3D 0; - qemuBlockNamedNodeDataPtr entry; - bool disable_bitmaps =3D false; - size_t i; - - if (!(entry =3D virHashLookup(blockNamedNodeData, basesrc->nodeformat)= )) - return 0; - - bitmaplist =3D g_new0(char *, entry->nbitmaps + 1); - - for (i =3D 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap =3D entry->bitmaps[i]; - - if (!bitmap->recording || bitmap->inconsistent || - !qemuBlockBitmapChainIsValid(topsrc, bitmap->name, blockNamedN= odeData)) - continue; - - disable_bitmaps =3D true; - - if (qemuMonitorTransactionBitmapDisable(act, basesrc->nodeformat, - bitmap->name) < 0) - return -1; - - bitmaplist[curbitmapstr++] =3D g_strdup(bitmap->name); - } - - if (disable_bitmaps) { - *actions =3D g_steal_pointer(&act); - *disabledBitmapsBase =3D g_steal_pointer(&bitmaplist); - } - - return 0; -} - - -struct qemuBlockBitmapsHandleCommitData { - bool skip; - bool create; - bool enable; - const char *basenode; - virJSONValuePtr merge; - unsigned long long granularity; - bool persistent; -}; - - -static void -qemuBlockBitmapsHandleCommitDataFree(void *opaque) -{ - struct qemuBlockBitmapsHandleCommitData *data =3D opaque; - - virJSONValueFree(data->merge); - g_free(data); -} - - -static int -qemuBlockBitmapsHandleCommitFinishIterate(void *payload, - const void *entryname, - void *opaque) -{ - struct qemuBlockBitmapsHandleCommitData *data =3D payload; - const char *bitmapname =3D entryname; - virJSONValuePtr actions =3D opaque; - - if (data->skip) - return 0; - - if (data->create) { - if (qemuMonitorTransactionBitmapAdd(actions, data->basenode, bitma= pname, - data->persistent, !data->enabl= e, - data->granularity) < 0) - return -1; - } else { - if (data->enable && - qemuMonitorTransactionBitmapEnable(actions, data->basenode, bi= tmapname) < 0) - return -1; - } - - if (data->merge && - qemuMonitorTransactionBitmapMerge(actions, data->basenode, bitmapn= ame, - &data->merge) < 0) - return -1; - - return 0; -} - - -/** - * @topsrc: virStorageSource representing 'top' of the job - * @basesrc: virStorageSource representing 'base' of the job + * @active: commit job is an active layer block-commit * @blockNamedNodeData: hash table containing data about bitmaps * @actions: filled with arguments for a 'transaction' command * @disabledBitmapsBase: bitmap names which were disabled @@ -3332,95 +3222,20 @@ qemuBlockBitmapsHandleCommitFinishIterate(void *pay= load, int qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, virStorageSourcePtr basesrc, + bool active, virHashTablePtr blockNamedNodeData, - virJSONValuePtr *actions, - char **disabledBitmapsBase) + virJSONValuePtr *actions) { - g_autoptr(virJSONValue) act =3D virJSONValueNewArray(); - virStorageSourcePtr n; - qemuBlockNamedNodeDataPtr entry; - g_autoptr(virHashTable) commitdata =3D NULL; - struct qemuBlockBitmapsHandleCommitData *bitmapdata; - size_t i; - - commitdata =3D virHashNew(qemuBlockBitmapsHandleCommitDataFree); - - for (n =3D topsrc; n !=3D basesrc; n =3D n->backingStore) { - if (!(entry =3D virHashLookup(blockNamedNodeData, n->nodeformat))) - continue; - - for (i =3D 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap =3D entry->bitmaps[i]; - - if (!(bitmapdata =3D virHashLookup(commitdata, bitmap->name)))= { - bitmapdata =3D g_new0(struct qemuBlockBitmapsHandleCommitD= ata, 1); + virStorageSourcePtr writebitmapsrc =3D NULL; - /* we must mirror the state of the topmost bitmap and merge - * everything else */ - bitmapdata->create =3D true; - bitmapdata->enable =3D bitmap->recording; - bitmapdata->basenode =3D basesrc->nodeformat; - bitmapdata->merge =3D virJSONValueNewArray(); - bitmapdata->granularity =3D bitmap->granularity; - bitmapdata->persistent =3D bitmap->persistent; + if (active) + writebitmapsrc =3D basesrc; - if (virHashAddEntry(commitdata, bitmap->name, bitmapdata) = < 0) { - qemuBlockBitmapsHandleCommitDataFree(bitmapdata); - return -1; - } - } - - if (bitmap->inconsistent || - !qemuBlockBitmapChainIsValid(topsrc, bitmap->name, blockNa= medNodeData)) - bitmapdata->skip =3D true; - - if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(bitmapdat= a->merge, - n->nodefo= rmat, - bitmap->n= ame) < 0) - return -1; - } - } - - if ((entry =3D virHashLookup(blockNamedNodeData, basesrc->nodeformat))= ) { - /* note that all bitmaps in 'base' were disabled when commit was s= tarted */ - for (i =3D 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap =3D entry->bitmaps[i]; - - if ((bitmapdata =3D virHashLookup(commitdata, bitmap->name))) { - bitmapdata->create =3D false; - } else { - if (disabledBitmapsBase) { - char **disabledbitmaps; - - for (disabledbitmaps =3D disabledBitmapsBase; *disable= dbitmaps; disabledbitmaps++) { - if (STREQ(*disabledbitmaps, bitmap->name)) { - bitmapdata =3D g_new0(struct qemuBlockBitmapsH= andleCommitData, 1); - - bitmapdata->create =3D false; - bitmapdata->enable =3D true; - bitmapdata->basenode =3D basesrc->nodeformat; - bitmapdata->granularity =3D bitmap->granularit= y; - bitmapdata->persistent =3D bitmap->persistent; - - if (virHashAddEntry(commitdata, bitmap->name, = bitmapdata) < 0) { - qemuBlockBitmapsHandleCommitDataFree(bitma= pdata); - return -1; - } - - break; - } - } - } - } - } - } - - if (virHashForEach(commitdata, qemuBlockBitmapsHandleCommitFinishItera= te, act) < 0) + if (qemuBlockGetBitmapMergeActions(topsrc, basesrc, basesrc, NULL, NUL= L, + writebitmapsrc, actions, + blockNamedNodeData) < 0) return -1; - if (virJSONValueArraySize(act) > 0) - *actions =3D g_steal_pointer(&act); - return 0; } diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 0f5b4cfaa9..24b87e79db 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -243,19 +243,12 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr s= rc, bool shallow, virJSONValuePtr *actions); -int -qemuBlockBitmapsHandleCommitStart(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, - virHashTablePtr blockNamedNodeData, - virJSONValuePtr *actions, - char ***disabledBitmapsBase); - int qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, virStorageSourcePtr basesrc, + bool active, virHashTablePtr blockNamedNodeData, - virJSONValuePtr *actions, - char **disabledBitmapsBase); + virJSONValuePtr *actions); int qemuBlockReopenReadWrite(virDomainObjPtr vm, diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 17dc08476b..8e81b142f4 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1069,6 +1069,7 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDom= ainObjPtr vm, qemuDomainObjPrivatePtr priv =3D vm->privateData; g_autoptr(virHashTable) blockNamedNodeData =3D NULL; g_autoptr(virJSONValue) actions =3D NULL; + bool active =3D job->type =3D=3D QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) return 0; @@ -1078,16 +1079,18 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virD= omainObjPtr vm, if (qemuBlockBitmapsHandleCommitFinish(job->data.commit.top, job->data.commit.base, + active, blockNamedNodeData, - &actions, - job->data.commit.disabledBitmap= sBase) < 0) + &actions) < 0) return 0; if (!actions) return 0; - if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) < 0) - return -1; + if (!active) { + if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) = < 0) + return -1; + } if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) return -1; @@ -1097,8 +1100,10 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDo= mainObjPtr vm, if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) return -1; - if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0) - return -1; + if (!active) { + if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) <= 0) + return -1; + } return 0; } @@ -1268,6 +1273,9 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEMU= DriverPtr driver, job->disk->src =3D job->data.commit.base; job->disk->src->readonly =3D job->data.commit.top->readonly; + if (qemuBlockJobProcessEventCompletedCommitBitmaps(vm, job, asyncJob) = < 0) + return; + qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job= ->data.commit.top); if (job->data.commit.deleteCommittedImages) @@ -1339,6 +1347,7 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDri= verPtr driver, virDomainObjPtr vm, qemuBlockJobDataPtr job) { + g_autoptr(virJSONValue) actions =3D virJSONValueNewArray(); virDomainDiskDefPtr disk =3D job->disk; VIR_DEBUG("active commit job '%s' on VM '%s' failed", job->name, vm->d= ef->name); @@ -1346,6 +1355,10 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDr= iverPtr driver, if (!disk) return; + ignore_value(qemuMonitorTransactionBitmapRemove(actions, disk->mirror-= >nodeformat, + "libvirt-tmp-activewri= te")); + + /* Ideally, we would make the backing chain read only again (yes, SELi= nux * can do that using different labels). But that is not implemented ye= t and * not leaking security driver metadata is more important. */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 88517ba6a7..6256046762 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17312,9 +17312,9 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, case QEMU_BLOCKJOB_TYPE_COPY: if (blockdev && !job->jobflagsmissing) { - g_autoptr(virHashTable) blockNamedNodeData =3D NULL; bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; bool reuse =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT; + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) return -1; @@ -17352,16 +17352,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, * the bitmaps if it wasn't present thus must skip this */ if (blockdev && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) { - g_autoptr(virHashTable) blockNamedNodeData =3D NULL; - if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) - return -1; + actions =3D virJSONValueNewArray(); - if (qemuBlockBitmapsHandleCommitFinish(job->data.commit.top, - job->data.commit.base, - blockNamedNodeData, - &actions, - job->data.commit.disabl= edBitmapsBase) < 0) + if (qemuMonitorTransactionBitmapAdd(actions, + job->data.commit.base->nod= eformat, + "libvirt-tmp-activewrite", + false, + false, + 0) < 0) return -1; } @@ -18482,7 +18481,6 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *nodebase =3D NULL; bool persistjob =3D false; bool blockdev =3D false; - g_autoptr(virJSONValue) bitmapDisableActions =3D NULL; VIR_AUTOSTRINGLIST bitmapDisableList =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | @@ -18647,27 +18645,6 @@ qemuDomainBlockCommit(virDomainPtr dom, goto endjob; } - if (blockdev && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) { - g_autoptr(virHashTable) blockNamedNodeData =3D NULL; - if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEMU_AS= YNC_JOB_NONE))) - goto endjob; - - if (qemuBlockBitmapsHandleCommitStart(topSource, baseSource, - blockNamedNodeData, - &bitmapDisableActions, - &bitmapDisableList) < 0) - goto endjob; - - /* if we don't have terminator on 'base' we can't reopen it */ - if (bitmapDisableActions && !baseSource->backingStore) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("can't handle bitmaps on unterminated backing= image '%s'"), - base); - goto endjob; - } - } - if (!(job =3D qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSourc= e, baseSource, &bitmapDisableList, flags & VIR_DOMAIN_BLOCK_COMMIT_= DELETE, @@ -18692,23 +18669,6 @@ qemuDomainBlockCommit(virDomainPtr dom, !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, f= alse))) goto endjob; - if (bitmapDisableActions) { - int rc; - - if (qemuBlockReopenReadWrite(vm, baseSource, QEMU_ASYNC_JOB_NO= NE) < 0) - goto endjob; - - qemuDomainObjEnterMonitor(driver, vm); - rc =3D qemuMonitorTransaction(priv->mon, &bitmapDisableActions= ); - if (qemuDomainObjExitMonitor(driver, vm) < 0) - goto endjob; - - if (qemuBlockReopenReadOnly(vm, baseSource, QEMU_ASYNC_JOB_NON= E) < 0) - goto endjob; - - if (rc < 0) - goto endjob; - } } else { device =3D job->name; } diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index fd6dff82f9..5be98b9320 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -928,12 +928,11 @@ testQemuBlockBitmapBlockcommit(const void *opaque) g_autofree char *actual =3D NULL; g_autofree char *expectpath =3D NULL; - g_autoptr(virJSONValue) actionsDisable =3D NULL; g_autoptr(virJSONValue) actionsMerge =3D NULL; g_autoptr(virJSONValue) nodedatajson =3D NULL; g_autoptr(virHashTable) nodedata =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - VIR_AUTOSTRINGLIST bitmapsDisable =3D NULL; + bool active =3D data->top =3D=3D data->chain; expectpath =3D g_strdup_printf("%s/%s%s", abs_srcdir, blockcommitPrefix, data->name); @@ -947,20 +946,10 @@ testQemuBlockBitmapBlockcommit(const void *opaque) return -1; } - if (qemuBlockBitmapsHandleCommitStart(data->top, data->base, nodedata, - &actionsDisable, &bitmapsDisable= ) < 0) - return -1; - - virBufferAddLit(&buf, "pre job bitmap disable:\n"); - - if (actionsDisable && - virJSONValueToBuffer(actionsDisable, &buf, true) < 0) - return -1; - virBufferAddLit(&buf, "merge bitmpas:\n"); - if (qemuBlockBitmapsHandleCommitFinish(data->top, data->base, nodedata, - &actionsMerge, bitmapsDisable) = < 0) + if (qemuBlockBitmapsHandleCommitFinish(data->top, data->base, active, = nodedata, + &actionsMerge) < 0) return -1; if (actionsMerge && @@ -1357,6 +1346,7 @@ mymain(void) #define TEST_BITMAP_BLOCKCOMMIT(testname, topimg, baseimg, ndf) \ do {\ blockbitmapblockcommitdata.name =3D testname; \ + blockbitmapblockcommitdata.chain =3D bitmapSourceChain; \ blockbitmapblockcommitdata.top =3D testQemuBitmapGetFakeChainEntry= (bitmapSourceChain, topimg); \ blockbitmapblockcommitdata.base =3D testQemuBitmapGetFakeChainEntr= y(bitmapSourceChain, baseimg); \ blockbitmapblockcommitdata.nodedatafile =3D ndf; \ diff --git a/tests/qemublocktestdata/bitmapblockcommit/empty b/tests/qemubl= ocktestdata/bitmapblockcommit/empty index bfc58f994e..9260011852 100644 --- a/tests/qemublocktestdata/bitmapblockcommit/empty +++ b/tests/qemublocktestdata/bitmapblockcommit/empty @@ -1,2 +1 @@ -pre job bitmap disable: merge bitmpas: --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241082; cv=none; d=zohomail.com; s=zohoarc; b=PM2xoaG6t5NqhagD8LgliSSnv1+8QVSSOIhxImmTBnbd/7rdQ87RYdWBPFuqtjOyAGKcntNCtafbo0REdfuU4b6suAwgsLNIR9e6WeU/gTSVLbWwwo+ACwDeInY6al/FWqoYG+6MxctAAa5f2QxkMVqSS1GR5XyFyua0BdMf4BM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241082; 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=5lijhZ2i9hCpY5h05a0MnZQRmRIDZTZgQni7wJmNPSA=; b=hisCeWAWzGLzLCiZusPLbmco5qOx6nLjZfY9b5iajtycsShJc+fWHQJx+im3NHpsSM2jEJfvZcIQed7nW2AAaoEB+wJM0yzdZovpqxd2zXHmtHpFuCTJd2/3aHZQgBPgTo2Gk0V0FKRofc5P0ipQfhSEDansnPAb9CQQM8jplVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 159224108287394.84768141678603; Mon, 15 Jun 2020 10:11:22 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-lqnz2ZWFM1iPd3X7zjqxpA-1; Mon, 15 Jun 2020 13:11:16 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0483803336; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B161B7890F; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 80CD595AA1; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB1bs004983 for ; Mon, 15 Jun 2020 13:11:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3231F100238D; Mon, 15 Jun 2020 17:11:01 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B082100164D for ; Mon, 15 Jun 2020 17:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241081; 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=5lijhZ2i9hCpY5h05a0MnZQRmRIDZTZgQni7wJmNPSA=; b=U8pLoFekOOPtUFRndYyHvQvTcpBGLOcOxvNICTBeNJJak5VnV9t8ino1hVLgI24yYoLJAb 9JPyKoz11ExXoLyUW6MwI23Y9DdgNN27Zgc6nx4IAKb2shBuopsisFPKBrcBrjLgy/vgpr RlVhumNebL2DfBa7FTe9RDO49hyS5dM= X-MC-Unique: lqnz2ZWFM1iPd3X7zjqxpA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 27/32] qemublocktest: Add 'basic' tests for commit bitmap handling Date: Mon, 15 Jun 2020 19:10:14 +0200 Message-Id: <8ac4d64215d665f3f269aa8a7826fc5b97b8c27d.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the 'basic case we have few bitmaps in only the top layer. Simulate commit into the backing of the top layer and also 2 levels deep. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 4 + .../bitmapblockcommit/basic-1-2 | 145 ++++++++++++++++++ .../bitmapblockcommit/basic-1-3 | 145 ++++++++++++++++++ .../bitmapblockcommit/basic-2-3 | 1 + 4 files changed, 295 insertions(+) create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-2 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-3 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-2-3 diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 5be98b9320..1a8ce3b73d 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1358,6 +1358,10 @@ mymain(void) TEST_BITMAP_BLOCKCOMMIT("empty", 1, 2, "empty"); + TEST_BITMAP_BLOCKCOMMIT("basic-1-2", 1, 2, "basic"); + TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic"); + TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic"); + cleanup: qemuTestDriverFree(&driver); VIR_FREE(capslatest_x86_64); diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-1-2 new file mode 100644 index 0000000000..d393d31044 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 @@ -0,0 +1,145 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-1-3 new file mode 100644 index 0000000000..3fa902c354 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 @@ -0,0 +1,145 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 b/tests/qe= mublocktestdata/bitmapblockcommit/basic-2-3 new file mode 100644 index 0000000000..9260011852 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 @@ -0,0 +1 @@ +merge bitmpas: --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241077; cv=none; d=zohomail.com; s=zohoarc; b=b8tlqzrMx40m0AGCvwDXKOkmS9wQzEKfqgJ7fax2R8zBfSc4VSCz2mK1DGA31Dy/5E8xtJgHa9SS1ZFgOsy4Fi5sw2IiuG5KSeK7Oq3gYToIdeYYaDNvee+RvHyU1/7ah2OuyBQPw8ZhX4lraIAhGDllgfel6kPHQX8mEbRzBpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241077; 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=Srd3h2ayJyKwlS07S/vjTLNbOVTeZDzP83rF6q5fb5Q=; b=BkAusYU49ROs1fE574vV2vryrN1uOVbCTovQ4dtNdXQYW1F6ibdUgbKAsWXXXLeIKwhuVPNSjhXsLnO7SF3ZXAGi1LXYQ36a3OP36fPW/gn9savHW8YIW6Ek2wmT3Kev3M2lFrCLCEu8B+sOHX70B1kGRpe4S5LN1sM999fUkXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241077029707.64442068382; Mon, 15 Jun 2020 10:11:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-PTIf7g9iODmCpIgWF_P_gQ-1; Mon, 15 Jun 2020 13:11:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D14E1138308; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E25F5D9D5; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DB25F104903; Mon, 15 Jun 2020 17:11:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB2iI004992 for ; Mon, 15 Jun 2020 13:11:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 246451001901; Mon, 15 Jun 2020 17:11:02 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9270B100164D for ; Mon, 15 Jun 2020 17:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241075; 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=Srd3h2ayJyKwlS07S/vjTLNbOVTeZDzP83rF6q5fb5Q=; b=XXqaEWYhuaXSSvGUSyVCurFYJRNm/f3pm7h6L//JsG6j565vDQFc3aQUEpwLQqmGvaoLCj h+TjKv9h1yjES/sDpk1u9FbX9aS0KLVp3VOuFvfiSQWwRRDK652zsmRJ2ZXJMcdH5O2CKJ rEO79Hp8kU11NG9ZpmZp8wBPk9PuDk8= X-MC-Unique: PTIf7g9iODmCpIgWF_P_gQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 28/32] qemublocktest: Add 'snapshots' tests for block commit bitmap handling Date: Mon, 15 Jun 2020 19:10:15 +0200 Message-Id: <67cbb5bc21d7f09a373ce2a78f4d3cd8568cc578.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Simulate commit between all the combinations of layers in the 'snapshots' case to see whether the code merges the correct bitmaps with the correct depth of temporary bitmaps. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 14 ++ .../bitmapblockcommit/snapshots-1-2 | 105 +++++++++++ .../bitmapblockcommit/snapshots-1-3 | 131 ++++++++++++++ .../bitmapblockcommit/snapshots-1-4 | 163 +++++++++++++++++ .../bitmapblockcommit/snapshots-1-5 | 167 ++++++++++++++++++ .../bitmapblockcommit/snapshots-2-3 | 65 +++++++ .../bitmapblockcommit/snapshots-2-4 | 97 ++++++++++ .../bitmapblockcommit/snapshots-2-5 | 101 +++++++++++ .../bitmapblockcommit/snapshots-3-4 | 62 +++++++ .../bitmapblockcommit/snapshots-3-5 | 66 +++++++ .../bitmapblockcommit/snapshots-4-5 | 16 ++ 11 files changed, 987 insertions(+) create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 1a8ce3b73d..4a737e19d3 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1362,6 +1362,20 @@ mymain(void) TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic"); TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-1-2", 1, 2, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-1-3", 1, 3, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-1-4", 1, 4, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-1-5", 1, 5, "snapshots"); + + TEST_BITMAP_BLOCKCOMMIT("snapshots-2-3", 2, 3, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-2-4", 2, 4, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-2-5", 2, 5, "snapshots"); + + TEST_BITMAP_BLOCKCOMMIT("snapshots-3-4", 3, 4, "snapshots"); + TEST_BITMAP_BLOCKCOMMIT("snapshots-3-5", 3, 5, "snapshots"); + + TEST_BITMAP_BLOCKCOMMIT("snapshots-4-5", 4, 5, "snapshots"); + cleanup: qemuTestDriverFree(&driver); VIR_FREE(capslatest_x86_64); diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-2 new file mode 100644 index 0000000000..7d5b0a4402 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 @@ -0,0 +1,105 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-2-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-2-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-3 new file mode 100644 index 0000000000..17a020ba20 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 @@ -0,0 +1,131 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "d" + }, + { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-3-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-4 new file mode 100644 index 0000000000..972d30b2e1 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 @@ -0,0 +1,163 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "c" + }, + { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "b" + }, + { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "d" + }, + { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-4-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-1-5 new file mode 100644 index 0000000000..3cda5b4132 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 @@ -0,0 +1,167 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "c" + }, + { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "b" + }, + { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "a" + }, + { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "d" + }, + { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-5-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-3 new file mode 100644 index 0000000000..cb952eeb06 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 @@ -0,0 +1,65 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-3-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "d" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "a" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "b" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-3-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "c" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-4 new file mode 100644 index 0000000000..a540ca42e3 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 @@ -0,0 +1,97 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "d" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "b" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "c" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-2-5 new file mode 100644 index 0000000000..8ea6036a33 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 @@ -0,0 +1,101 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "d" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "a" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "b" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "c" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-3-4 new file mode 100644 index 0000000000..736d4fd9df --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 @@ -0,0 +1,62 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "c" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-4-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "b" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-4-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "a" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-3-5 new file mode 100644 index 0000000000..207d82e6b6 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 @@ -0,0 +1,66 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "c" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "libvirt-5-format", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "b" + } + ] + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "a" + } + ] + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 b/test= s/qemublocktestdata/bitmapblockcommit/snapshots-4-5 new file mode 100644 index 0000000000..4a8e6c5cff --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 @@ -0,0 +1,16 @@ +merge bitmpas: +[ + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "libvirt-5-format", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-4-format", + "name": "a" + } + ] + } + } +] --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241206; cv=none; d=zohomail.com; s=zohoarc; b=bxhAN5JYux/VoYPSSgIQ6CF4wl3TilIutGfo+W6FQZsWcCihTg+1hEH45D9J0Io+Yk8t8e1tw0rFMoP1nM8Ny2lIpgnBrbHetyc0uheEqHVlYSl1eWSoCtuiOZADzOLYPUIVqvJUGRusUgdzSn9Rrb48M9ZMNRH3e1I+e08und8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241206; 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=N3RDciIY4XNe4nAxJJQNGDhcTZ+GSqi4IU3aDZcQspo=; b=cxAT6YM/7BrN3jfn5ufb9U/EKmfVjGZYfawzZbCDqxueOaAfhRIO/Ms64ewrZVKTuDIqOIFkuLBsDKrKo3XpjLDg0HFC27N67upDzaU4vLZ+RItQKnsuYGHnJSNFfDSGaBAcfOk0Yr4KV3wJGrBDqae3fnJAq/3sNuXitYYJKoM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241206254990.8120221250255; Mon, 15 Jun 2020 10:13:26 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-pRLmKwj6NhivaSjkKuMCQg-1; Mon, 15 Jun 2020 13:11:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC06118585C5; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B34A60C05; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5E90910491A; Mon, 15 Jun 2020 17:11:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB3Jr005002 for ; Mon, 15 Jun 2020 13:11:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 168BE1002394; Mon, 15 Jun 2020 17:11:03 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 830A1100164D for ; Mon, 15 Jun 2020 17:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241205; 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=N3RDciIY4XNe4nAxJJQNGDhcTZ+GSqi4IU3aDZcQspo=; b=eLO1pnq2C1Zu23JOvomG44eSGBrJ4Y8M25XVmTWusjAu2rLuZzvn/yeRjgD3Qc+OWGYQnU EUhK3IyxE+lSFZGYcLsI8AaCLydeh3iP5o+1ZMvxT+bdozgD9lqRkBZdRw9f0neaKZKI9Q cp9LNdJJYCdrQ0oGcWXb3TewVdr0TBo= X-MC-Unique: pRLmKwj6NhivaSjkKuMCQg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 29/32] qemu: blockjob: Remove 'disabledBitmapsBase' field from commit job private data Date: Mon, 15 Jun 2020 19:10:16 +0200 Message-Id: <30f35dac7d15cd31541af19fe98ce7ddabcad45c.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" New semantics of the bitmap handling don't need this. Remove the field and all uses of it including the status XML. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_blockjob.c | 44 ------------------- src/qemu/qemu_blockjob.h | 3 -- src/qemu/qemu_domain.c | 22 ---------- src/qemu/qemu_driver.c | 3 +- .../blockjob-blockdev-in.xml | 4 -- 5 files changed, 1 insertion(+), 75 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 8e81b142f4..58ba3e6e96 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -84,11 +84,6 @@ qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job) virObjectUnref(job->data.backup.store); g_free(job->data.backup.bitmap); } - - if (job->type =3D=3D QEMU_BLOCKJOB_TYPE_COMMIT || - job->type =3D=3D QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT) { - virStringListFree(job->data.commit.disabledBitmapsBase); - } } @@ -290,7 +285,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virStorageSourcePtr topparent, virStorageSourcePtr top, virStorageSourcePtr base, - char ***disabledBitmapsBase, bool delete_imgs, unsigned int jobflags) { @@ -316,7 +310,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, job->data.commit.top =3D top; job->data.commit.base =3D base; job->data.commit.deleteCommittedImages =3D delete_imgs; - job->data.commit.disabledBitmapsBase =3D g_steal_pointer(disabledBitma= psBase); job->jobflags =3D jobflags; if (qemuBlockJobRegister(job, vm, disk, true) < 0) @@ -1369,40 +1362,6 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDr= iverPtr driver, } -static void -qemuBlockJobProcessEventFailedCommitCommon(virDomainObjPtr vm, - qemuBlockJobDataPtr job, - qemuDomainAsyncJob asyncJob) -{ - qemuDomainObjPrivatePtr priv =3D vm->privateData; - g_autoptr(virJSONValue) actions =3D virJSONValueNewArray(); - char **disabledBitmaps =3D job->data.commit.disabledBitmapsBase; - - if (!disabledBitmaps || !*disabledBitmaps) - return; - - for (; *disabledBitmaps; disabledBitmaps++) { - qemuMonitorTransactionBitmapEnable(actions, - job->data.commit.base->nodeform= at, - *disabledBitmaps); - } - - if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) < 0) - return; - - if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) - return; - - qemuMonitorTransaction(priv->mon, &actions); - - if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) - return; - - if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0) - return; -} - - static void qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -1510,8 +1469,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlock= JobDataPtr job, case QEMU_BLOCKJOB_TYPE_COMMIT: if (success) qemuBlockJobProcessEventCompletedCommit(driver, vm, job, async= Job); - else - qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob); break; case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: @@ -1519,7 +1476,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlock= JobDataPtr job, qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job,= asyncJob); } else { qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job); - qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob); } break; diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 19498b5bd8..9f73a3547c 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -88,8 +88,6 @@ struct _qemuBlockJobCommitData { virStorageSourcePtr top; virStorageSourcePtr base; bool deleteCommittedImages; - char **disabledBitmapsBase; /* a NULL-terminated list of bitmap names = which - were disabled in @base for the commit j= ob */ }; @@ -187,7 +185,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virStorageSourcePtr topparent, virStorageSourcePtr top, virStorageSourcePtr base, - char ***disabledBitmapsBase, bool delete_imgs, unsigned int jobflags); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2dad823a86..0548e9c2e6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2623,7 +2623,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDat= aPtr job, virBufferPtr buf) { g_auto(virBuffer) disabledBitmapsBuf =3D VIR_BUFFER_INIT_CHILD(buf); - char **bitmaps =3D job->data.commit.disabledBitmapsBase; if (job->data.commit.base) virBufferAsprintf(buf, "\n", job->data.commit.b= ase->nodeformat); @@ -2637,9 +2636,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDat= aPtr job, if (job->data.commit.deleteCommittedImages) virBufferAddLit(buf, "\n"); - while (bitmaps && *bitmaps) - virBufferEscapeString(&disabledBitmapsBuf, "\= n", *(bitmaps++)); - virXMLFormatElement(buf, "disabledBaseBitmaps", NULL, &disabledBitmaps= Buf); } @@ -3260,9 +3256,6 @@ static int qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job, xmlXPathContextPtr ctxt) { - g_autofree xmlNodePtr *nodes =3D NULL; - ssize_t nnodes; - if (job->type =3D=3D QEMU_BLOCKJOB_TYPE_COMMIT) { qemuDomainObjPrivateXMLParseBlockjobNodename(job, "string(./topparent/@= node)", @@ -3289,21 +3282,6 @@ qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuB= lockJobDataPtr job, !job->data.commit.base) return -1; - if ((nnodes =3D virXPathNodeSet("./disabledBaseBitmaps/bitmap", ctxt, = &nodes)) > 0) { - size_t i; - - job->data.commit.disabledBitmapsBase =3D g_new0(char *, nnodes + 1= ); - - for (i =3D 0; i < nnodes; i++) { - char *tmp; - - if (!(tmp =3D virXMLPropString(nodes[i], "name"))) - return -1; - - job->data.commit.disabledBitmapsBase[i] =3D g_steal_pointer(&t= mp); - } - } - return 0; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6256046762..8cf3629a80 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18481,7 +18481,6 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *nodebase =3D NULL; bool persistjob =3D false; bool blockdev =3D false; - VIR_AUTOSTRINGLIST bitmapDisableList =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | VIR_DOMAIN_BLOCK_COMMIT_ACTIVE | @@ -18646,7 +18645,7 @@ qemuDomainBlockCommit(virDomainPtr dom, } if (!(job =3D qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSourc= e, - baseSource, &bitmapDisableList, + baseSource, flags & VIR_DOMAIN_BLOCK_COMMIT_= DELETE, flags))) goto endjob; diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index cc17a17ff4..ca6d110179 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -243,10 +243,6 @@ - - - - --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592241082; cv=none; d=zohomail.com; s=zohoarc; b=Euvw6Nt+J9T4+DpHwGmYHMyJNHwtvBaw9C9HCdbt4n2vrze8UaIYWXetIlJX1w13WYacXQL7Imjp/6E4aF4EvEMse9kpgQjzVIHtpO1MwDWaNLDf1dYViXvvk7Y2rllj0/nYVG3wEFLeEMperWcqH18k5zjNywA4eh9aH0Z/MM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241082; 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=6rTBim5wH6yj4G0r03UIaSfya6OmXJXRI1StBAlDWmk=; b=Zi8RlS/baussVsO0ygyW6/eG5ydW66NQkARTohdwne3814XnQM6fgGzuxxT6uwmz3OixWSZAdYwaZtW7U8O0JXwLtDHYw9Eb3U+2BceEuVgIIF5Sir7KTxIgJ+LJPHz9joadPIdeb7S3gAlrk9UEKyB137+SIQW/xKB4VX5uFUk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592241082960487.7286586995066; Mon, 15 Jun 2020 10:11:22 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-DHH5m22LOLuS2kTKc2ypww-1; Mon, 15 Jun 2020 13:11:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8DC91138305; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9B8790342; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 895F71806B0A; Mon, 15 Jun 2020 17:11:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB3eI005014 for ; Mon, 15 Jun 2020 13:11:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id EFA6F100164D; Mon, 15 Jun 2020 17:11:03 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AE1A100238D for ; Mon, 15 Jun 2020 17:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241081; 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=6rTBim5wH6yj4G0r03UIaSfya6OmXJXRI1StBAlDWmk=; b=hevaBWE9SPkZ+GttzP5OGtaucokoZDnqZ7UIwVrQsedPgrflcE0enV7lja08fQKwEKYgB5 Yo6QdH4O7NrpXtzB+Wd88NmmFdzo2RGQJQzRvBv2WSr9FX9fUKWw3bZzgcahq4Imt8pfUy OAK0+SymVM1URL6ll5lnKyX85VC3xsg= X-MC-Unique: DHH5m22LOLuS2kTKc2ypww-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 30/32] qemu: Rewrite bitmap handling for block copy Date: Mon, 15 Jun 2020 19:10:17 +0200 Message-Id: <42db2ffc289e51e05707f3a1b345a4dbb8733b11.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reuse qemuBlockGetBitmapMergeActions which allows to remove the ad-hoc implementatio of bitmap merging for block copy. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 113 ++------------------------------------- src/qemu/qemu_blockjob.c | 40 ++++++++++++++ src/qemu/qemu_driver.c | 13 ++--- tests/qemublocktest.c | 6 ++- 4 files changed, 57 insertions(+), 115 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index e958fb71fa..0480f6b97d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3068,38 +3068,6 @@ qemuBlockBitmapChainIsValid(virStorageSourcePtr src, } -struct qemuBlockBitmapsHandleBlockcopyConcatData { - virHashTablePtr bitmaps_merge; - virJSONValuePtr actions; - const char *mirrornodeformat; - bool has_bitmaps; -}; - - -static int -qemuBlockBitmapsHandleBlockcopyConcatActions(void *payload, - const void *name, - void *opaque) -{ - struct qemuBlockBitmapsHandleBlockcopyConcatData *data =3D opaque; - virJSONValuePtr createactions =3D payload; - const char *bitmapname =3D name; - g_autoptr(virJSONValue) mergebitmaps =3D virHashSteal(data->bitmaps_me= rge, bitmapname); - - data->has_bitmaps =3D true; - - virJSONValueArrayConcat(data->actions, createactions); - - if (qemuMonitorTransactionBitmapMerge(data->actions, - data->mirrornodeformat, - bitmapname, - &mergebitmaps) < 0) - return -1; - - return 0; -} - - /** * qemuBlockBitmapsHandleBlockcopy: * @src: disk source @@ -3122,86 +3090,15 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr= src, bool shallow, virJSONValuePtr *actions) { - g_autoptr(virHashTable) bitmaps =3D virHashNew(virJSONValueHashFree); - g_autoptr(virHashTable) bitmaps_merge =3D virHashNew(virJSONValueHashF= ree); - g_autoptr(virHashTable) bitmaps_skip =3D virHashNew(NULL); - g_autoptr(virJSONValue) tmpactions =3D virJSONValueNewArray(); - qemuBlockNamedNodeDataPtr entry; - virStorageSourcePtr n; - size_t i; - struct qemuBlockBitmapsHandleBlockcopyConcatData data =3D { .bitmaps_m= erge =3D bitmaps_merge, - .actions =3D= tmpactions, - .mirrornodef= ormat =3D mirror->nodeformat, - .has_bitmaps= =3D false, }; - - for (n =3D src; n; n =3D n->backingStore) { - if (!(entry =3D virHashLookup(blockNamedNodeData, n->nodeformat))) - continue; - - for (i =3D 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap =3D entry->bitmaps[i]; - virJSONValuePtr bitmap_merge; - - if (virHashHasEntry(bitmaps_skip, bitmap->name)) - continue; - - if (!(bitmap_merge =3D virHashLookup(bitmaps_merge, bitmap->na= me))) { - g_autoptr(virJSONValue) tmp =3D NULL; - bool disabled =3D !bitmap->recording; - - /* disable any non top-layer bitmaps */ - if (n !=3D src) - disabled =3D true; - - if (!bitmap->persistent || - !(qemuBlockBitmapChainIsValid(n, bitmap->name, - blockNamedNodeData))) { - ignore_value(virHashAddEntry(bitmaps_skip, bitmap->nam= e, NULL)); - continue; - } - - /* prepare the data for adding the bitmap to the mirror */ - tmp =3D virJSONValueNewArray(); - - if (qemuMonitorTransactionBitmapAdd(tmp, - mirror->nodeformat, - bitmap->name, - true, - disabled, - bitmap->granularity) <= 0) - return -1; + virStorageSourcePtr base =3D NULL; - if (virHashAddEntry(bitmaps, bitmap->name, tmp) < 0) - return -1; - - tmp =3D NULL; - - /* prepare array for merging all the bitmaps from the orig= inal chain */ - tmp =3D virJSONValueNewArray(); - - if (virHashAddEntry(bitmaps_merge, bitmap->name, tmp) < 0) - return -1; - - bitmap_merge =3D g_steal_pointer(&tmp); - } + if (shallow) + base =3D src->backingStore; - if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(bitmap_me= rge, - n->nodefo= rmat, - bitmap->n= ame) < 0) - return -1; - } - - if (shallow) - break; - } - - if (virHashForEach(bitmaps, qemuBlockBitmapsHandleBlockcopyConcatActio= ns, - &data) < 0) + if (qemuBlockGetBitmapMergeActions(src, base, mirror, NULL, NULL, mirr= or, actions, + blockNamedNodeData) < 0) return -1; - if (data.has_bitmaps) - *actions =3D g_steal_pointer(&tmpactions); - return 0; } diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 58ba3e6e96..7e4530f48b 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1282,6 +1282,43 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEM= UDriverPtr driver, } +static int +qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObjPtr vm, + qemuBlockJobDataPtr job, + qemuDomainAsyncJob asyncJob) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + g_autoptr(virJSONValue) actions =3D NULL; + bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) + return 0; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, asyncJob))) + return -1; + + if (qemuBlockBitmapsHandleBlockcopy(job->disk->src, + job->disk->mirror, + blockNamedNodeData, + shallow, + &actions) < 0) + return 0; + + if (!actions) + return 0; + + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) + return -1; + + qemuMonitorTransaction(priv->mon, &actions); + + if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) + return -1; + + return 0; +} + static void qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -1296,6 +1333,8 @@ qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDri= verPtr driver, !job->disk->mirror) return; + qemuBlockJobProcessEventCompletedCopyBitmaps(vm, job, asyncJob); + /* for shallow copy without reusing external image the user can either= not * specify the backing chain in which case libvirt will open and use t= he * chain the user provided or not specify a chain in which case we'll @@ -1329,6 +1368,7 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDri= verPtr driver, !job->disk->mirror) return; + /* activeWrite bitmap is removed automatically here */ qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job= ->disk->mirror); virObjectUnref(job->disk->mirror); job->disk->mirror =3D NULL; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8cf3629a80..c4d8a13004 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17314,14 +17314,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, if (blockdev && !job->jobflagsmissing) { bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; bool reuse =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT; - g_autoptr(virHashTable) blockNamedNodeData =3D NULL; - if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, QEM= U_ASYNC_JOB_NONE))) - return -1; + actions =3D virJSONValueNewArray(); - if (qemuBlockBitmapsHandleBlockcopy(disk->src, disk->mirror, - blockNamedNodeData, - shallow, &actions) < 0) + if (qemuMonitorTransactionBitmapAdd(actions, + disk->mirror->nodeformat, + "libvirt-tmp-activewrite", + false, + false, + 0) < 0) return -1; /* Open and install the backing chain of 'mirror' late if we c= an use diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 4a737e19d3..1c6517646b 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -881,6 +881,7 @@ testQemuBlockBitmapBlockcopy(const void *opaque) g_autoptr(virJSONValue) nodedatajson =3D NULL; g_autoptr(virHashTable) nodedata =3D NULL; g_autoptr(virStorageSource) fakemirror =3D virStorageSourceNew(); + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; if (!fakemirror) return -1; @@ -903,10 +904,13 @@ testQemuBlockBitmapBlockcopy(const void *opaque) data->shallow, &actions) < 0) return -1; + if (actions && - !(actual =3D virJSONValueToString(actions, true))) + virJSONValueToBuffer(actions, &buf, true) < 0) return -1; + actual =3D virBufferContentAndReset(&buf); + return virTestCompareToFile(actual, expectpath); } --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1592241085; cv=none; d=zohomail.com; s=zohoarc; b=SOJfAOus41ZNUftzLu5DHZxo6UknOLGs+5vmapy17Y8mzDdCPc0tX/tnLKMCSOrhXywkTfsWKgvFjUa8vl8mdfwCA8geekyvnGbEv8lzeovdryE1YvdjGCkumHdB7ER5EaV0mdwVFrTfLfA9qAIhiKE4Ys4SJL5hlbhjbLf5uCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241085; 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=PxLSaM9P1rsIMSh2Gn3N+0vtYGyzU5rzALqKZhp1az8=; b=hh1devvQUz5VYaNS4LFf1IlazBxQ6Ms0/XKqgmjq0PV1FlEHy9Ry77A0zhDLeODhFg5ByIbAwgoS6mXNcE44OBGT1pm2S12Gm/3u2woFf+EookBzqGFp98b2Hiq7o7+XPL5tpht/dETemqTnJ7y9XAd6NQTsuAdQ9S29vs+DraM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1592241085867406.84785539432676; Mon, 15 Jun 2020 10:11:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-meBQNFg8MVOw3gk5AudeuA-1; Mon, 15 Jun 2020 13:11:20 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E7B0873409; Mon, 15 Jun 2020 17:11:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1F3360C05; Mon, 15 Jun 2020 17:11:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C094B180CB39; Mon, 15 Jun 2020 17:11:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB4PC005022 for ; Mon, 15 Jun 2020 13:11:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id DAB0A100238D; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54B17100164D for ; Mon, 15 Jun 2020 17:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241084; 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=PxLSaM9P1rsIMSh2Gn3N+0vtYGyzU5rzALqKZhp1az8=; b=Y96nFop1/keMqg+VhEn/f4RpmSG2v628ffWapokbSxcz64b+tH3EyxsKTGKMlIILa0vRL5 ktOSWP0V0tcBV36Fu/FmWyAElhdBSlY4s8sawe0O3BI96RGxpqSEtMF1b7Hz40/b7wPp1h qeGtP33YPdgKj4xu1+nZOtBgi3vu8cI= X-MC-Unique: meBQNFg8MVOw3gk5AudeuA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 31/32] qemublocktest: Add test cases for handling bitmaps during block-copy Date: Mon, 15 Jun 2020 19:10:18 +0200 Message-Id: <3fedc5da6bf9613d9223648c9fd0030b90ad76f4.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Test both 'basic' and 'snapshots' cases on shallow and deep copy modes. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- tests/qemublocktest.c | 5 + .../bitmapblockcopy/basic-deep-out.json | 144 ++++++++++++++ .../bitmapblockcopy/basic-shallow-out.json | 144 ++++++++++++++ .../bitmapblockcopy/snapshots-deep-out.json | 180 ++++++++++++++++++ .../snapshots-shallow-out.json | 144 ++++++++++++++ 5 files changed, 617 insertions(+) create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.= json create mode 100644 tests/qemublocktestdata/bitmapblockcopy/basic-shallow-o= ut.json create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-= out.json create mode 100644 tests/qemublocktestdata/bitmapblockcopy/snapshots-shall= ow-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 1c6517646b..0ab599dd67 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1346,6 +1346,11 @@ mymain(void) TEST_BITMAP_BLOCKCOPY("empty-shallow", true, "empty"); TEST_BITMAP_BLOCKCOPY("empty-deep", false, "empty"); + TEST_BITMAP_BLOCKCOPY("basic-shallow", true, "basic"); + TEST_BITMAP_BLOCKCOPY("basic-deep", false, "basic"); + + TEST_BITMAP_BLOCKCOPY("snapshots-shallow", true, "snapshots"); + TEST_BITMAP_BLOCKCOPY("snapshots-deep", false, "snapshots"); #define TEST_BITMAP_BLOCKCOMMIT(testname, topimg, baseimg, ndf) \ do {\ diff --git a/tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json b/= tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json new file mode 100644 index 0000000000..a8c2749879 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcopy/basic-deep-out.json @@ -0,0 +1,144 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json= b/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json new file mode 100644 index 0000000000..a8c2749879 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcopy/basic-shallow-out.json @@ -0,0 +1,144 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.jso= n b/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json new file mode 100644 index 0000000000..ac2ffb4ce2 --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcopy/snapshots-deep-out.json @@ -0,0 +1,180 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "libvirt-2-format", + "name": "c" + }, + { + "node": "libvirt-3-format", + "name": "c" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "libvirt-2-format", + "name": "b" + }, + { + "node": "libvirt-3-format", + "name": "b" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "libvirt-2-format", + "name": "a" + }, + { + "node": "libvirt-3-format", + "name": "a" + }, + { + "node": "libvirt-4-format", + "name": "a" + }, + { + "node": "libvirt-5-format", + "name": "a" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "libvirt-2-format", + "name": "d" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.= json b/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json new file mode 100644 index 0000000000..3a9942569a --- /dev/null +++ b/tests/qemublocktestdata/bitmapblockcopy/snapshots-shallow-out.json @@ -0,0 +1,144 @@ +[ + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "current", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "current", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "current" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "c", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "c", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "c" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "b", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "b", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "b" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "a", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "a", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "a" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-add", + "data": { + "node": "mirror-format-node", + "name": "d", + "persistent": true, + "disabled": false, + "granularity": 65536 + } + }, + { + "type": "block-dirty-bitmap-merge", + "data": { + "node": "mirror-format-node", + "target": "d", + "bitmaps": [ + { + "node": "libvirt-1-format", + "name": "d" + }, + { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + ] + } + }, + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] --=20 2.26.2 From nobody Sun May 5 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1592241129; cv=none; d=zohomail.com; s=zohoarc; b=bpI9o+bL11JscyM5wdVJT/z1HsGRb4w0MJyqzI91S6omf2D73VJPxpuo9zWjbBgtf0qE+wPqTM79JKM4d5rUldcdhouN665WCOgslP8J93vwysSbD4qXmdd5HzbFSVT9t7zuzx3wfqSDRQ/cRuyzOrJ1ruN9gFcpwzkPlBEKZ04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592241129; 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=gAlaNkAZ73XbtQp2uEvrgBZnzvBSGma84h+UOm4aJ6w=; b=T5sLhnhB3T8/xOenB29OPhHjhXCOd7vPxn7LubUqspZbNqbx2wrgOEPYvXbhVGqqMNXWyVOLmpNiz4XuFe8xARo+j7qvPgxnokRlbT+rPrnQIKEdNErjC2wkQ6SgcU4grV8x/UCGKC+5wa604h1/mzd3FRb696GFDWcttIzxn9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1592241129927957.2121067043488; Mon, 15 Jun 2020 10:12:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-70-5XAj2UyhOaagdB3r5pyj5A-1; Mon, 15 Jun 2020 13:11:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD1121138308; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9044778FC5; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 62E4695AA4; Mon, 15 Jun 2020 17:11:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FHB5Cd005027 for ; Mon, 15 Jun 2020 13:11:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC3C3100238D; Mon, 15 Jun 2020 17:11:05 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46402100164D for ; Mon, 15 Jun 2020 17:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592241128; 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=gAlaNkAZ73XbtQp2uEvrgBZnzvBSGma84h+UOm4aJ6w=; b=T3F4jJ55pN1Wx7cnXvjnAvIdChDfSEi1SyGP8WrB+mAcYE+Is5fgtCMJNI8A8pIiSmygkL iRsklM0HXBqYhk9Aa5X11ubvFtxt8dUZxee52oo5lIBF/5NcQ5aJ+ZSSr6sTrh9VZUAvNP xpUC2yZDQCEZgIhyF+4A8rvhhR4QnXQ= X-MC-Unique: 5XAj2UyhOaagdB3r5pyj5A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 32/32] kbase: Add document outlining internals of incremental backup in qemu Date: Mon, 15 Jun 2020 19:10:19 +0200 Message-Id: <4557db5a4445286a22c6f72ec8a9732968c5dc72.1592240635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Outline the basics and how to integrate with externally created overlays. Other topics will continue later. Signed-off-by: Peter Krempa --- docs/kbase.html.in | 3 + docs/kbase/incrementalbackupinternals.rst | 210 ++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 docs/kbase/incrementalbackupinternals.rst diff --git a/docs/kbase.html.in b/docs/kbase.html.in index c586e0f676..4257e52b7e 100644 --- a/docs/kbase.html.in +++ b/docs/kbase.html.in @@ -36,6 +36,9 @@
Virtio-FS
Share a filesystem between the guest and the host
+ +
Incremental = backup internals
+
Incremental backup implementation details relevant for users diff --git a/docs/kbase/incrementalbackupinternals.rst b/docs/kbase/increme= ntalbackupinternals.rst new file mode 100644 index 0000000000..adf12002d2 --- /dev/null +++ b/docs/kbase/incrementalbackupinternals.rst @@ -0,0 +1,210 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Internals of incremental backup handling in qemu +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. contents:: + +Libvirt's implementation of incremental backups in the ``qemu`` driver uses +qemu's ``block-dirty-bitmaps`` under the hood to track the guest visible d= isk +state changes correspoiding to the points in time described by a libvirt +checkpoint. + +There are some semantical implications how libvirt creates and manages the +bitmaps which de-facto become API as they are written into the disk images= and +this document will try to sumarize them. + +Glossary +=3D=3D=3D=3D=3D=3D=3D=3D + +Checkpoint + + A libvirt object which represents a named point in time of the life of= the + vm where libvirt tracks writes the VM has done and allows then a backu= p of + block which changed. Note that state of the VM memory is _not_ capture= d. + + A checkpoint can be created either explicitly via the corresponding API + which isn't very useful or is created as part of creating an + incremental or full backup of the VM using the ``virDomainBackupBegin`= ` API + which allows a next backup to only copy the differences. + +Backup + + A copy of either all blocks of selected disks (full backup) or blocks = changed + since a checkpoint (incremental backup) at the time the backup job was + started. (Blocks modified while the backup job is running are not part= of the + backup!) + +Snapshot + + Similarly to a checkpoint it's a point in time in the lifecycle of the= VM + but the state of the VM including memory is captured at that point all= owing + returning to the state later. + +Blockjob + + A long running job which modifies the shape and/or location of the disk + backing chain (images storing the disk contents). Libvirt supports + ``block pull`` where data is moved up the chain towards the active lay= er, + ``block commit`` where data is moved down the chain towards the base/o= ldest + image. These blockjobs always remove images from the backing chain. La= stly + ``block copy`` where image is moved to a different location (and possi= bly + collapsed moving all of the data into the new location into the one im= age). + +block-dirty-bitmap (bitmap) + + A data structure in qemu tracking which blocks were written by the gue= st + OS since the bitmap was created. + +Relationships of bitmaps, checkpoints and VM disks +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +When a checkpoint is created libvirt creates a block-dirty-bitmap for every +configured VM disk named the same way as chcheckpoint. The bitmap is activ= ely +recording which blocks were changed by the guest OS from that point on. Ot= her +bitmaps are not impacted by any way as they are self-contained: + +:: + + +----------------+ +----------------+ + | disk: vda | | disk: vdb | + +--------+-------+ +--------+-------+ + | | + +--------v-------+ +--------v-------+ + | vda-1.qcow2 | | vdb-1.qcow2 | + | | | | + | bitmaps: chk-a | | bitmaps: chk-a | + | chk-b | | chk-b | + | | | | + +----------------+ +----------------+ + +Bitmaps are created at the same time to track changes to all disks in sync= and +are active and persisted in the QCOW2 image. Oter formats currently don't +support this feature. + +Modification of bitmaps outside of libvirt is not recommended, but when ad= rering +to the same semantics which the document will describe it should be safe t= o do +so but obviously we can't guarantee that. + + +Integration with external snapshots +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Handling of bitmaps +------------------- + +Creating an external snapshot involves adding a new layer to the backing c= hain +on top of the previous chain. In this step there are no new bitmaps create= d by +default, which would mean that backups become impossible after this step. + +To prevent this from happening we need to re-create the active bitmaps in = the +new top/active layer of the backing chain which allows us to continue trac= king +the changes with same granularity as before and also allows libvirt to sti= tch +together all the corresponding bitmaps to do a backup acorss snapshots. + +After taking a snapshot of the ``vda`` disk from the example above placed = into +``vda-2.qcow2`` the following topology will be created: + +:: + + +----------------+ + | disk: vda | + +-------+--------+ + | + +-------v--------+ +----------------+ + | vda-2.qcow2 | | vda-1.qcow2 | + | | | | + | bitmaps: chk-a +----> bitmaps: chk-a | + | chk-b | | chk-b | + | | | | + +----------------+ +----------------+ + +Checking bitmap health +---------------------- + +QEMU optimizes disk writes by only updating the bitmaps in certain cases. = This +also can cause problems in cases when e.g. QEMU crashes. + +For a chain of bitmaps corresponding in a backing chain to be considered v= alid +and eligible for use with ``virDomainBackupBegin`` it must conform to the +following rules: + +1) Top image must contain the bitmap +2) If any of the backing images in the chain contain the bitmap too all + contiguous images must have the bitmap (no gaps) +3) all of the above bitmaps must be marked as active + (``auto`` flag in ``qemu-img`` output, ``recording`` in qemu) +4) none of the above bitmaps can be inconsistent + (``in-use`` flag in ``qemu-img`` provided that it's not used on image w= hich + is currently in use by a qemu instance, or ``inconsistent`` in qemu) + +:: + + # check that image has bitmaps + $ qemu-img info vda-1.qcow2 + image: vda-1.qcow2 + file format: qcow2 + virtual size: 100 MiB (104857600 bytes) + disk size: 220 KiB + cluster_size: 65536 + Format specific information: + compat: 1.1 + compression type: zlib + lazy refcounts: false + bitmaps: + [0]: + flags: + [0]: in-use + [1]: auto + name: chk-a + granularity: 65536 + [1]: + flags: + [0]: auto + name: chk-b + granularity: 65536 + refcount bits: 16 + corrupt: false + +(See also the ``qemuBlockBitmapChainIsValid`` helper method in +``src/qemu/qemu_block.c``) + +Creating external checkpoints manually +-------------------------------------- + +To create the same topology outside of libvirt (e.g when doing snapshots o= ffline) +a new ``qemu-img`` which supports the ``bitmap`` subcomand is necessary. T= he +following algorithm then ensures that the new image after snapshot will wo= rk +with backups (note that ``jq`` is a JSON processor): + +:: + + # arguments + SNAP_IMG=3D"vda-2.qcow2" + BACKING_IMG=3D"vda-1.qcow2" + + # constants - snapshots and bitmaps work only with qcow2 + SNAP_FMT=3D"qcow2" + BACKING_IMG_FMT=3D"qcow2" + + # create snapshot overlay + qemu-img create -f "$SNAP_FMT" -F "$BACKING_IMG_FMT" -b "$BACKING_IMG" "= $SNAP_IMG" + + BACKING_IMG_INFO=3D$(qemu-img info --output=3Djson -f "$BACKING_IMG_FMT"= "$BACKING_IMG") + BACKING_BITMAPS=3D$(jq '."format-specific".data.bitmaps' <<< "$BACKING_I= MG_INFO") + + if [ "x$BACKING_BITMAPS" =3D=3D "xnull" ]; then + exit 0 + fi + + for BACKING_BITMAP_ in $(jq -c '.[]' <<< "$BACKING_BITMAPS"); do + BITMAP_FLAGS=3D$(jq -c -r '.flags[]' <<< "$BACKING_BITMAP_") + BITMAP_NAME=3D$(jq -r '.name' <<< "$BACKING_BITMAP_") + + if grep 'in-use' <<< "$BITMAP_FLAGS" || + grep -v 'auto' <<< "$BITMAP_FLAGS"; then + continue + fi + + qemu-img bitmap -f "$SNAP_FMT" "$SNAP_IMG" --add "$BITMAP_NAME" + + done --=20 2.26.2