From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513086; cv=none; d=zoho.com; s=zohoarc; b=fWuNdxXyAG28B2vyw6rUyQdDSFGbvKNRN2HiYFq0mGH0PbF8tDdsw2HL/rChixbUFMH9XATHKjhA0xFlVLJ0Nd4wxahJCuhsjtWLWrGDfKPa/LSer/pUg6faSBNLob7VrJG0Ff9k0xEtsuqoE19reeu8i+XnpP/Bkho7+79vkSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513086; 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:ARC-Authentication-Results; bh=zXlxX5giUJbNpuBf0qBrYHP5Pq6ycTbCGwPTEB3AoY4=; b=SE5GsWvDzIVaq8Lrif/FZ0CtFyeY0OMh0bvANVKdJGokaSUHc+wZg5KxASpe9kt4P68NPg5XXPHSf2ZRpXc7ZQ07Hsgvk/1vvHap4Z1uP2TBUAh2HdvSIGslg32uVy6uEm/t7gO7zgxxeErWtLgeYSpMaRoczm9ZfGfn0HYEaUo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513086468437.013417023794; Thu, 26 Sep 2019 08:51:26 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 4C5938830B; Thu, 26 Sep 2019 15:51:24 +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 218CA1C941; Thu, 26 Sep 2019 15:51:24 +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 D10DF4EE6D; Thu, 26 Sep 2019 15:51:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpJ2e000770 for ; Thu, 26 Sep 2019 11:51:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA1CE60C5D; Thu, 26 Sep 2019 15:51:19 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5216060C80 for ; Thu, 26 Sep 2019 15:51:18 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:05 +0200 Message-Id: <60d2175032637d844ad163d1485981b24b96c588.1569512942.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] qemu: checkpoint: Refactor cleanup in qemuCheckpointCreateXML 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 26 Sep 2019 15:51:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use VIR_AUTO* helpers and get rid of the 'cleanup' label. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 30d1b6ae3a..4430f69911 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -363,9 +363,9 @@ qemuCheckpointCreateXML(virDomainPtr domain, bool redefine =3D flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE; unsigned int parse_flags =3D 0; virDomainMomentObjPtr other =3D NULL; - virQEMUDriverConfigPtr cfg =3D NULL; - virCapsPtr caps =3D NULL; - virJSONValuePtr actions =3D NULL; + VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg =3D NULL; + VIR_AUTOUNREF(virCapsPtr) caps =3D NULL; + VIR_AUTOPTR(virJSONValue) actions =3D NULL; int ret; VIR_AUTOUNREF(virDomainCheckpointDefPtr) def =3D NULL; @@ -380,32 +380,32 @@ qemuCheckpointCreateXML(virDomainPtr domain, if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot create checkpoint while snapshot exists")= ); - goto cleanup; + return NULL; } if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BITMAP_MERGE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("qemu binary lacks persistent bitmaps support")); - goto cleanup; + return NULL; } if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; + return NULL; if (!virDomainObjIsActive(vm)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot create checkpoint for inactive domain")); - goto cleanup; + return NULL; } if (!(def =3D virDomainCheckpointDefParseString(xmlDesc, caps, driver-= >xmlopt, priv->qemuCaps, parse_fl= ags))) - goto cleanup; + return NULL; /* Unlike snapshots, the RNG schema already ensured a sane filename. */ /* We are going to modify the domain below. */ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; + return NULL; if (redefine) { if (virDomainCheckpointRedefinePrep(vm, &def, &chk, @@ -484,10 +484,6 @@ qemuCheckpointCreateXML(virDomainPtr domain, qemuDomainObjEndJob(driver, vm); - cleanup: - virJSONValueFree(actions); - virObjectUnref(caps); - virObjectUnref(cfg); return checkpoint; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513085; cv=none; d=zoho.com; s=zohoarc; b=A4EvI/9tvRx2P5LdoMhsOTQ/O3+BM+OWo20Rlqu1q+AKfissr91H8L3w/u7gaYUIWMS+ceR4n6cN08d5M9bDlFLiY2yxKU9/AfkD2OSXbdn0ubCdZn3PTKmWZZPISH5CO8uEEXDu1NlSK6cSS9357ATr8x8ruc/0vZeeG9HpMfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513085; 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:ARC-Authentication-Results; bh=cSScP1c02heigBfmfbpr+P1/o7FcREok9oF1jpXxJJA=; b=XE0iBLHTJ8iXDIbEC1bEbe5990cceNpO3xzI4i/o5WKZvoK0KwlOPTbC8Nk5tT8+3YxCyUgzYTKVTojBgnXDvjVK5zYbdXaZ8U65uezopvhBYggfDT5KxkMhoWqCnY9+J1LnckjiBWE3c9w1EA6NGgCR3IppQ1MNL5+sqHIM/54= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513085206927.4135815345898; Thu, 26 Sep 2019 08:51:25 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8BDD2190C01F; Thu, 26 Sep 2019 15:51:23 +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 57FCB1C948; Thu, 26 Sep 2019 15:51:23 +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 0B3DC1803B37; Thu, 26 Sep 2019 15:51:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpKm6000781 for ; Thu, 26 Sep 2019 11:51:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC42C60C80; Thu, 26 Sep 2019 15:51:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 546FF60C5D for ; Thu, 26 Sep 2019 15:51:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] qemu: checkpoint: Remove open-ended TODOs 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Thu, 26 Sep 2019 15:51:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Once somebody is motivated enough to add the support for the quiesce flag or offline checkpoint deletion they are welcome to do so but we don't need to have a reminder. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 4430f69911..59f700e1d3 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -370,7 +370,6 @@ qemuCheckpointCreateXML(virDomainPtr domain, VIR_AUTOUNREF(virDomainCheckpointDefPtr) def =3D NULL; virCheckFlags(VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE, NULL); - /* TODO: VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE */ if (redefine) { parse_flags |=3D VIR_DOMAIN_CHECKPOINT_PARSE_REDEFINE; @@ -570,8 +569,6 @@ qemuCheckpointDelete(virDomainObjPtr vm, return -1; if (!metadata_only) { - /* Until qemu-img supports offline bitmap deletion, we are stuck - * with requiring a running guest */ if (!virDomainObjIsActive(vm)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot delete checkpoint for inactive domain= ")); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513099; cv=none; d=zoho.com; s=zohoarc; b=gMfJCQUWqiX5R6tmIDbqT13vKjoYjvrGp0ZZqtmannIObQLiXu09Y+YuUeknbWZ8XygGAomnRgXtTdA1hsb6hNpQyRMQ/M0grJttIrVRT5+8IbuVFTUF75HG2/bZj742H+Kfr/4WOuR0PMM1swjRP28UuNeET6l/wjk275AnqnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513099; 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:ARC-Authentication-Results; bh=+Wztouh0nMEmL3wiTSJP5AlynFnc2DGHyi9u84x5oAw=; b=VTLZBt5kRvyWKnnPder7lM42njHc80w3y4tzz9XxAPsLIcT0MVkvszVHuGjRkOhs0IwyRsCgW2uQwionJc8UPrjrcwHOBK0hxJQqwalrTFwfQQNNcxN1g0QuTqt2Da5Hj+0kunqPQEjlBoqn92e28FyiMPHP/I2HeHORdG3NY6M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513099558653.2953809211842; Thu, 26 Sep 2019 08:51:39 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id F17C4300BEAE; Thu, 26 Sep 2019 15:51:36 +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 C70EC5C21A; Thu, 26 Sep 2019 15:51:36 +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 880831803B49; Thu, 26 Sep 2019 15:51:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpLsK000788 for ; Thu, 26 Sep 2019 11:51:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5B3E60C5D; Thu, 26 Sep 2019 15:51:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D38E60E1C for ; Thu, 26 Sep 2019 15:51:20 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] qemu: Simplify argument list of qemuDomainBlockPullCommon 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 26 Sep 2019 15:51:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Drop the 'driver' argument since it can be extracted from private data to shorten the argument list. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5852df2a53..71503898e4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17534,14 +17534,14 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, /* bandwidth in MiB/s per public API. Caller must lock vm beforehand, * and not access it afterwards. */ static int -qemuDomainBlockPullCommon(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainBlockPullCommon(virDomainObjPtr vm, const char *path, const char *base, unsigned long bandwidth, unsigned int flags) { qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; const char *device =3D NULL; const char *jobname =3D NULL; virDomainDiskDefPtr disk; @@ -18355,7 +18355,6 @@ static int qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, unsigned long bandwidth, unsigned int flags) { - virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm; int ret =3D -1; unsigned long long speed =3D bandwidth; @@ -18384,7 +18383,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char = *path, const char *base, /* For normal rebase (enhanced blockpull), the common code handles * everything, including vm cleanup. */ if (!(flags & VIR_DOMAIN_BLOCK_REBASE_COPY)) - return qemuDomainBlockPullCommon(driver, vm, path, base, bandwidth= , flags); + return qemuDomainBlockPullCommon(vm, path, base, bandwidth, flags); /* If we got here, we are doing a block copy rebase. */ if (!(dest =3D virStorageSourceNew())) @@ -18540,8 +18539,7 @@ qemuDomainBlockPull(virDomainPtr dom, const char *p= ath, unsigned long bandwidth, return -1; } - return qemuDomainBlockPullCommon(dom->conn->privateData, - vm, path, NULL, bandwidth, flags); + return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513111; cv=none; d=zoho.com; s=zohoarc; b=cgx+OJA3AyD2YNfi+FJGGT9KPiCYMy/FrG1yeFCYkT/cqgAz2E5lwicg1pQ+3E4fyciOE3YzoVsOZM/2EoWJCmw9ABBj8uw3RsqfZuoC4HEOOMQAJuyjRAlRgGxpjZtsxyOq28DwdNf44hz9dcnZXXhBYLPi54IF8gDFeox1U9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513111; 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:ARC-Authentication-Results; bh=OvoU49E2wR9s7yG1yk0OR+4in6sDnRctMzhyF/CwSdU=; b=cNErzMu6M6cISzcu7XKyNMllAMFscYPWvMGg+LUiR91N7+2NbD06Fl6J+nXQmsK/Rg5zFUHRQA6Rbav7mxJr0bKITXOV6BWRg2kl1VzjRwIIZRdH/fWAYEUK9NspX4YyBaCOTyt6oQAyEYP/XYcDv+vVSA44feOGH3rHbdFz0hA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513111174396.3251866472033; Thu, 26 Sep 2019 08:51:51 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5292E3073880; Thu, 26 Sep 2019 15:51:49 +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 295E55DA60; Thu, 26 Sep 2019 15:51:49 +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 E0BBC180BA96; Thu, 26 Sep 2019 15:51:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpMkF000795 for ; Thu, 26 Sep 2019 11:51:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id B817B60E1C; Thu, 26 Sep 2019 15:51:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3ED3E60C80 for ; Thu, 26 Sep 2019 15:51:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 26 Sep 2019 15:51:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add a 'cleanup' label and use jumps as we do in other places. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 71503898e4..3ad1699eb1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18522,24 +18522,27 @@ qemuDomainBlockPull(virDomainPtr dom, const char = *path, unsigned long bandwidth, unsigned int flags) { virDomainObjPtr vm; + int ret =3D -1; + virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1); if (!(vm =3D qemuDomainObjFromDomain(dom))) return -1; - if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) { - virDomainObjEndAPI(&vm); - return -1; - } + if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) + goto cleanup; if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0)= { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot perform block pull while checkpoint exist= s")); - virDomainObjEndAPI(&vm); - return -1; + goto cleanup; } - return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); + ret =3D qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); + + cleanup: + virDomainObjEndAPI(&vm); + return ret; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513095; cv=none; d=zoho.com; s=zohoarc; b=b/4qTxCG/vnaMmbxqKAnGvAHgXEUxj0/J33r14RMVCgGRaOrFBf5yeAxFnURNatmgjavA+7PwAtd1cwC+ROxmDfnv3CppTs6/wALAJ2pZgVN7+HNeI9oyEv03g2z11VP8DEYh/wgR3NDmHwUktd3JBki0ldQsaKgzKhMuzG4yMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513095; 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:ARC-Authentication-Results; bh=WM6sV34CgXF8Gkit5JAxLKPIFZi/MM8OqbqCI3sdjuU=; b=XGsnTw0jm99sQkCmE3I3NZAhMxgFbrJ8vAyWzV8RNxLvbPQP3KL2FnMs8z6MVLcm2rtmmHsRIQoRj73/cf/wLggCY8a091+SPVa/WvkooD9GbIdWE6ZCxOGxCpUIcVKvmMCDKhoi4kU3qDs7KQB2gz1mikag+0Jj3BdghvMX7Yg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513095393889.2540804443379; Thu, 26 Sep 2019 08:51:35 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B628B89810E; Thu, 26 Sep 2019 15:51:33 +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 8E5215D6A7; Thu, 26 Sep 2019 15:51:33 +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 47CE71803B49; Thu, 26 Sep 2019 15:51:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpNrP000806 for ; Thu, 26 Sep 2019 11:51:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B7E760E1C; Thu, 26 Sep 2019 15:51:23 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10DD560C80 for ; Thu, 26 Sep 2019 15:51:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:09 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/8] qemu: caps: Add capability for incremental backup support 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 26 Sep 2019 15:51:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add a new all-covering capability which will be used to interlock incremental backup support until all bits are ready. Reviewed-by: Eric Blake --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 72e070e8ab..2edbb3fdfe 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -540,6 +540,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "dbus-vmstate", "vhost-user-gpu", "vhost-user-vga", + + /* 340 */ + "incremental-backup", ); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 137b7161a5..5e990ce01e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -522,6 +522,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_DEVICE_VHOST_USER_GPU, /* -device vhost-user-gpu */ QEMU_CAPS_DEVICE_VHOST_USER_VGA, /* -device vhost-user-vga */ + /* 340 */ + QEMU_CAPS_INCREMENTAL_BACKUP, /* incremental backup is supported */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513097; cv=none; d=zoho.com; s=zohoarc; b=RabYRH0nWTy4TU275AP4jKIVLbBL1xaSUczVZXMv+rj4Nv81Xm508g1Cq2T3xyMgZBegtBeBdzQJBADxLWd/uWxrwgmwTiFzqsSLasVuxR7nZBQGLy489N/sN/dsEa1eBkEzO3/VoelxHEqTyt3NDqzdiEtfdDkL5G8mCsTty+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513097; 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:ARC-Authentication-Results; bh=NmR+nFsfcjsU/OLLUrVgPPHnlpUsy6aOXYyWyfr4OIM=; b=hmhsTdN2h28MRbGwB2GQpUg/H47prLBRuMth9C7B1u2HVUJBr+JvC9fGrjpS+YkU0bcVS6RPyXAqMCUj4+FoJpGL3WqbP/TqVq3hDjmyOlYPCjJPdIwV7an5o3hx10k/IlFDdQ6zf7H4qPektV3o/UsIzKMxOiAD7tpOxXqLYMI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513097295646.190166421708; Thu, 26 Sep 2019 08:51:37 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A758F3008955; Thu, 26 Sep 2019 15:51:35 +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 834395D6B2; Thu, 26 Sep 2019 15:51:35 +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 4A3124EE70; Thu, 26 Sep 2019 15:51:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpOsW000817 for ; Thu, 26 Sep 2019 11:51:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75C0060C5D; Thu, 26 Sep 2019 15:51:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id F20DB60F80 for ; Thu, 26 Sep 2019 15:51:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:10 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/8] qemu: checkpoint: Forbid creating checkpoints until we support backups 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 26 Sep 2019 15:51:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Checkpoints by themselves are not very useful for anything else than testing the few bitmap interactions that are currently implemented. It's very unlikely that anybody used this feature and thus we can disable it until we have a more complete implementation ready. Additionally the code for deleting checkpoints has many broken failure scenarios which should be fixed first. This will require support of deleting a bitmap in a qemu 'transaction' which was not released yet. Curious users obviously can use the qemu namespace in the XML to enable this for experiments: ... Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 59f700e1d3..46a10cbeba 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -382,9 +382,9 @@ qemuCheckpointCreateXML(virDomainPtr domain, return NULL; } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BITMAP_MERGE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("qemu binary lacks persistent bitmaps support")); + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("incremental backup is not supported yet")); return NULL; } @@ -569,14 +569,15 @@ qemuCheckpointDelete(virDomainObjPtr vm, return -1; if (!metadata_only) { - if (!virDomainObjIsActive(vm)) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP))= { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot delete checkpoint for inactive domain= ")); + _("incremental backup is not supported yet")); goto endjob; } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BITMAP_MERGE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("qemu binary lacks persistent bitmaps support= ")); + + if (!virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot delete checkpoint for inactive domain= ")); goto endjob; } } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513123; cv=none; d=zoho.com; s=zohoarc; b=BxC4d79r4mMYUlTaescP1yVPsE5LheEszYqmVv9UUUNC2OXGUvpLXKQyZvceYrwDw/OuNkRgC/14FPa1OA8wqBhxlIgLTJKhXeagJdhCC5nbeQOX1jgAgpiPORitIGB1FwRP5Fbfa70n8xZc2JCmeZcwVmscqgnNsIjVg9r/eyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513123; 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:ARC-Authentication-Results; bh=/lYTq9tdrqWS2K5LKp2iqBgD72p46SeDZ+v2hqjyzTI=; b=XN+I2szyD9u+/gDTmsH4O+yBVunL40UdWrNf5orzrkElrEob1gzp2nPm4KnF5V8nTwfoBe5rOs0DANzt8nF7uO9WuFGBFfUohOcL/hlQyFVfoNcj9PIlxDE6v6EEg+Dyw6XPjwiuDDBMepvG9jVDBHY6z8hHYp9XxqzK2P94uAU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513123084142.59311593267148; Thu, 26 Sep 2019 08:52:03 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2B90CC04AC69; Thu, 26 Sep 2019 15:52: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 06D415E1B0; Thu, 26 Sep 2019 15:52: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 BE6454EE69; Thu, 26 Sep 2019 15:52:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpPwF000828 for ; Thu, 26 Sep 2019 11:51:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60A1860C5D; Thu, 26 Sep 2019 15:51:25 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB48A60F80 for ; Thu, 26 Sep 2019 15:51:24 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:11 +0200 Message-Id: <9d264be89952e426142bf623daeb7e27bcff9614.1569512942.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] qemu: Aggregate interlocking of blockjobs by checkpoints in one place 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 26 Sep 2019 15:52:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Rather than having to fix 5 places once we support the combination add a function called by all the blockjob/snapshot APIs. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ src/qemu/qemu_driver.c | 25 +++++-------------------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 19fa5420e7..e8a82fee0b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -15513,3 +15513,24 @@ qemuDomainDefHasManagedPR(virDomainObjPtr vm) return jobPR; } + + +/** + * qemuDomainSupportsCheckpointsBlockjobs: + * @vm: domain object + * + * Checks whether a block job is supported in possible combination with + * checkpoints (qcow2 bitmaps). Returns -1 if unsupported and reports an e= rror + * 0 in case everything is supported. + */ +int +qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) +{ + if (virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0= ) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot perform block operations while checkpoint= exists")); + return -1; + } + + return 0; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f45da882a8..01a54d4265 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1217,3 +1217,7 @@ qemuDomainPausedReasonToSuspendedEvent(virDomainPause= dReason reason); int qemuDomainValidateActualNetDef(const virDomainNetDef *net, virQEMUCapsPtr qemuCaps); + +int +qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) + ATTRIBUTE_RETURN_CHECK; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3ad1699eb1..3847c727cf 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15846,11 +15846,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (virDomainSnapshotCreateXMLEnsureACL(domain->conn, vm->def, flags) = < 0) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, domain, NULL, 0) >= 0) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create snapshot while checkpoint exists")= ); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) goto cleanup; - } if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) goto cleanup; @@ -18374,11 +18371,8 @@ qemuDomainBlockRebase(virDomainPtr dom, const char= *path, const char *base, if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0)= { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot perform block rebase while checkpoint exi= sts")); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) goto cleanup; - } /* For normal rebase (enhanced blockpull), the common code handles * everything, including vm cleanup. */ @@ -18464,11 +18458,8 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *= disk, const char *destxml, if (virDomainBlockCopyEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0)= { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot perform block copy while checkpoint exist= s")); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) goto cleanup; - } for (i =3D 0; i < nparams; i++) { virTypedParameterPtr param =3D ¶ms[i]; @@ -18532,11 +18523,8 @@ qemuDomainBlockPull(virDomainPtr dom, const char *= path, unsigned long bandwidth, if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0)= { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot perform block pull while checkpoint exist= s")); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) goto cleanup; - } ret =3D qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); @@ -18591,11 +18579,8 @@ qemuDomainBlockCommit(virDomainPtr dom, if (virDomainBlockCommitEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0)= { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot perform block commit while checkpoint exi= sts")); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) goto cleanup; - } if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) goto cleanup; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 00:57:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569513137; cv=none; d=zoho.com; s=zohoarc; b=jT/cQDQ+xu+4d5LiG9vIeYIr6EwMNLU0DD9NtrDIGTfcPpXikFA36IxNwRJW8MMP0j5NGfM4iyfDQNqymELNL5vBOfdvxzOTX4+Y3JzTAnu6MVdESzhhpBvubrPG6oOm7qeMlDhNGAs84ZDpCKzstJIkyG6il8HdSndtUACo1/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569513137; 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:ARC-Authentication-Results; bh=J9emX/HDwWRTDA4RD3TYHGLW9yQUbRBCjhGY26Uzk3Y=; b=dSpx9U5o0L52tKZxH2GJ6Wklu2YHgR6s5LSEPzalelVpJR8y4dgUzpd1dLFxf9fUeidvbkqFyUQm9aZHYda7sS7lIuJHkd55nXkLkUfHNEf6sPlq+VYgd0HGPEK2UmwB0NlJxV5mXDRaW75bfRF2lqm8ECVLZoyzki+tdsa1r4A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569513137032800.9882937544501; Thu, 26 Sep 2019 08:52:17 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 7B15010DCCAA; Thu, 26 Sep 2019 15:52: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 5264260C5D; Thu, 26 Sep 2019 15:52: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 06B094EE6F; Thu, 26 Sep 2019 15:52:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QFpQix000835 for ; Thu, 26 Sep 2019 11:51:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 61D5060C5D; Thu, 26 Sep 2019 15:51:26 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCCB160F9F for ; Thu, 26 Sep 2019 15:51:25 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 17:51:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] qemu: domain: Base block job interlocking on QEMU_CAPS_INCREMENTAL_BACKUP 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Thu, 26 Sep 2019 15:52:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The QEMU_CAPS_INCREMENTAL_BACKUP will be enabled once all bits of the incremental backup feature work as expected which means also properly interacting with blockjobs and snapshots. Thus we can allow blockjobs and snapshots if QEMU_CAPS_INCREMENTAL_BACKUP is present even when checkpoints exist. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e8a82fee0b..6d42530db0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -15526,7 +15526,10 @@ qemuDomainDefHasManagedPR(virDomainObjPtr vm) int qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) { - if (virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0= ) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP) && + virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0= ) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot perform block operations while checkpoint= exists")); return -1; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list