From nobody Sun May 5 15:07:08 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=1587651246; cv=none; d=zohomail.com; s=zohoarc; b=U4/ljkTM1R9WM1YQQTOhwm7bctg9YTTbXf2VO5/z6InDssXRJmxqMbsOjoiA5f0JbQPRrCV8h8aTui8KsHCs049ErlcWeeHUoA/1wKtjY7M3cFiKXgU83kZP+ZVB2lw+lk7jyqyzGOLYXuUMWsLj7OMZT3sqAmlfCNEngrtnvBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587651246; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=6LSAUIAk/GHJ3jVYj19k24gcup9zVhxaQ59c03InKjY=; b=JLqfJgvjIFoYLYno0MZ9QOcCzMolaqGaB/Vc11+WGEEeKEINrIMpmKlVlAyJtRG21nwv9WhkUvWD1bk4AevvdNWWHhcvUGjCp/3Ju8r8EXmzwPg0KbgJvwWYNeVz8J4IQjk+NNZACAzy9LpwSZoY5p/9RnN7bSjQCnsWSYAlK3s= 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 1587651246987871.0431922247602; Thu, 23 Apr 2020 07:14: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-350-0uJG_rniOBmkPC9AJHd2-Q-1; Thu, 23 Apr 2020 10:14:03 -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 6BEF3A0C13; Thu, 23 Apr 2020 14:13:55 +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 615AA60D38; Thu, 23 Apr 2020 14:13:53 +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 B48141809554; Thu, 23 Apr 2020 14:13:50 +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 03NEDmBC005376 for ; Thu, 23 Apr 2020 10:13:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD7EB17166; Thu, 23 Apr 2020 14:13:48 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BC555C1D2 for ; Thu, 23 Apr 2020 14:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587651245; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6LSAUIAk/GHJ3jVYj19k24gcup9zVhxaQ59c03InKjY=; b=UEFSzezipvCIZgJ27JqEi82g2WQlAtXK2RO1bXHGnek1hkqhNr//cKreN7XaPx5m33HAUQ TaUR29c+adL8AQQ9VEUYvG0vvE12n9Lo+YOCDjqhj4X3K8sdomcfulpr4k4LwtUdTzoDr3 pksTtd9wUJYrDlhGtoM2WV9+OvltEd4= X-MC-Unique: 0uJG_rniOBmkPC9AJHd2-Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: Move interlocking of blockjobs and checkpoints after liveness check Date: Thu, 23 Apr 2020 16:13:43 +0200 Message-Id: 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" qemuDomainSupportsCheckpointsBlockjobs checks if the QEMU_CAPS_INCREMENTAL_BACKUP capability is supported to do the interlocking. Capabilities are not present when the VM isn't running though which would create false errors. Move the checks after the liveness check in block job implementations. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake Reviewed-by: Pavel Mores --- src/qemu/qemu_driver.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 00d276061e..5ecf12deef 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17439,6 +17439,9 @@ qemuDomainBlockPullCommon(virDomainObjPtr vm, if (virDomainObjCheckActive(vm) < 0) goto endjob; + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) + goto endjob; + if (!(disk =3D qemuDomainDiskByName(vm->def, path))) goto endjob; @@ -17994,6 +17997,9 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, if (virDomainObjCheckActive(vm) < 0) goto endjob; + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) + goto endjob; + if (!(disk =3D qemuDomainDiskByName(vm->def, path))) goto endjob; @@ -18278,9 +18284,6 @@ qemuDomainBlockRebase(virDomainPtr dom, const char = *path, const char *base, if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) - goto cleanup; - /* For normal rebase (enhanced blockpull), the common code handles * everything, including vm cleanup. */ if (!(flags & VIR_DOMAIN_BLOCK_REBASE_COPY)) @@ -18364,9 +18367,6 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *d= isk, const char *destxml, if (virDomainBlockCopyEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) - goto cleanup; - for (i =3D 0; i < nparams; i++) { virTypedParameterPtr param =3D ¶ms[i]; @@ -18429,11 +18429,6 @@ qemuDomainBlockPull(virDomainPtr dom, const char *= path, unsigned long bandwidth, return -1; } - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) { - virDomainObjEndAPI(&vm); - return -1; - } - /* qemuDomainBlockPullCommon consumes the reference on @vm */ return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); } --=20 2.26.0