From nobody Sun Feb 8 22:07:49 2026 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=1583931405; cv=none; d=zohomail.com; s=zohoarc; b=FW2uhtbVjtCSg4/32W83lx65jkLMEIkbRA2wjX3iS0VBlUnJdvCiL/kItw9HTSkFopRwwAnRPSY+/3t0j62c9o9+e55l9nJyI2kbxdCyJo6X/kXarUD/wQ+yCJayywP9jdkeZeU6pKscC4C9jEFmPPeZnyPvY32Y5lwlHwMimYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583931405; 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=ODqkBlXY5GAPItkEwTJ2an93nSQthqyiyXfiZrsmaMk=; b=YsIC9MUP9Cf3uFmQCIZ2p5rH3x6O1SjvVxBMlfpRKbr43cOCbm0lrn/Nu8gs2F1hFaD4bFgGrKgceo74BdXzW2w9BfRYUDSQ5ZSSdH1TFQ+H36xNhFdYP2Glf2HtTQYeK7KZSLSHK9vhh5xVxuBH2RF6ADaVg9IH5Brpevj0e44= 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 15839314054051014.0755818706057; Wed, 11 Mar 2020 05:56: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-107-ZXcZPyY6PcitxPKxiXUaYQ-1; Wed, 11 Mar 2020 08:56:38 -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 9068A1005514; Wed, 11 Mar 2020 12:56: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 644AC92D2A; Wed, 11 Mar 2020 12:56: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 0792286A1E; Wed, 11 Mar 2020 12:56:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02BCuE0p009330 for ; Wed, 11 Mar 2020 08:56:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0EE6F5C219; Wed, 11 Mar 2020 12:56:14 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 617685C1D8; Wed, 11 Mar 2020 12:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583931404; 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=ODqkBlXY5GAPItkEwTJ2an93nSQthqyiyXfiZrsmaMk=; b=UsfmiNhhXylOkOcNr7aNFA5N68cvcWMp9mQUNwrkZzhZhuNDxDxOBl5f87FpJpsJ8NJp6f sVvaGs7dbwCNdOapBrdY1l1wyrWo7PfkIscbrvjHbf8THDyiJ/Y96laJIlU4lSxtC1uIme JB0IbXp8sSm1DrzGhF1xV3eOzW3YcVc= X-MC-Unique: ZXcZPyY6PcitxPKxiXUaYQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 06/19] qemuDomainBlockCommit: Move checks depending on capabilities after liveness check Date: Wed, 11 Mar 2020 13:55:51 +0100 Message-Id: <661b04791b7bc8dbe77df44a3690464252e6f93e.1583930936.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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" Since capabilities are not present for inactive VMs we'd report that we don't support '--delete' or commiting while checkpoints exist rather than the proper error. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d565054436..d3eb2171ef 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18413,9 +18413,6 @@ qemuDomainBlockCommit(virDomainPtr dom, if (virDomainBlockCommitEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) - goto cleanup; - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) goto cleanup; @@ -18424,12 +18421,6 @@ qemuDomainBlockCommit(virDomainPtr dom, blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("deleting committed images is not supported by th= is VM")); - goto endjob; - } - /* Convert bandwidth MiB to bytes, if necessary */ if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) { if (speed > LLONG_MAX >> 20) { @@ -18454,6 +18445,15 @@ qemuDomainBlockCommit(virDomainPtr dom, if (qemuDomainDiskBlockJobIsActive(disk)) goto endjob; + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) + goto endjob; + + if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("deleting committed images is not supported by th= is VM")); + goto endjob; + } + if (!top || STREQ(top, disk->dst)) topSource =3D disk->src; else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) < 0 = || --=20 2.24.1