From nobody Mon Dec 15 23:09:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658846416; cv=none; d=zohomail.com; s=zohoarc; b=mkULBln4RfN87Q4lJA9G8Srso0/om3LIIJolJ7hN5PhzsR5uyrGNg0DshWuJiaAO1dJs5GumpZxzcTj7H5BL5ClK2g9/hqHCOJiqPaY4DMgCnAN9+mExItBR14DliZjH/QIARgURTo7ILj5iC0tgsC+HOzcFG4QaNINeXzEi3CY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846416; 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=mbhUHnYrnpc1/iN71rTH3aPodmvEukfmQuQemCQ9Uvk=; b=BZ1TqQXqCgpAneh4CdJWMwtS6VxlKh/jlmz6TfZTNuAgK+cyGA7GK4sQVcLxb+AzUGsAdoeKI0xKWyFr5IN1y8z0GI+e1W+wMatXVwZO1QDpgDK4EVdU+JHlZZCs/+n7AmY31Jpl+sgj8JOZ1DctxQbzws5hFseq1TjiFhERwok= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 165884641613689.20243018930228; Tue, 26 Jul 2022 07:40:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-OxEqF1pZPX2lZstygQXOtQ-1; Tue, 26 Jul 2022 10:39:20 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A97228084FE; Tue, 26 Jul 2022 14:38:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DF68404E4C3; Tue, 26 Jul 2022 14:38:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B79D2194704C; Tue, 26 Jul 2022 14:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 207E91947063 for ; Tue, 26 Jul 2022 14:38:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 142BE40CFD0B; Tue, 26 Jul 2022 14:38:48 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F2EA40CFD0A for ; Tue, 26 Jul 2022 14:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846415; 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=mbhUHnYrnpc1/iN71rTH3aPodmvEukfmQuQemCQ9Uvk=; b=Jfw+HR4QRZk8i9o6KV4aQk5sTE6JUXLXAhZTt2Px0Vz8OZh8q2idIyk3hcGs5OP5pmSL7q UJDUEpDUNV0OMObcMogs0h+px4nKKAnHR7Xxo/gzyzfakjlRu0lXq+Qt5ho4Hg8c57tHiA E1YaX5K4CbXsOuG/FTPVGW7zYI0/Ps4= X-MC-Unique: OxEqF1pZPX2lZstygQXOtQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 48/80] qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPivot Date: Tue, 26 Jul 2022 16:37:26 +0200 Message-Id: <47d6942665c6c01460b2308d2e37c9bf47b4c142.1658843187.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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) X-ZM-MESSAGEID: 1658846416923100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_driver.c | 50 +++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e4caccfbd9..f1fc954f8c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14339,9 +14339,9 @@ qemuDomainBlockPivot(virQEMUDriver *driver, g_autoptr(qemuBlockStorageSourceChainData) chainattachdata =3D NULL; int ret =3D -1; qemuDomainObjPrivate *priv =3D vm->privateData; - bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); g_autoptr(virJSONValue) bitmapactions =3D NULL; g_autoptr(virJSONValue) reopenactions =3D NULL; + int rc =3D 0; if (job->state !=3D QEMU_BLOCKJOB_STATE_READY) { virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, @@ -14369,7 +14369,7 @@ qemuDomainBlockPivot(virQEMUDriver *driver, return -1; case QEMU_BLOCKJOB_TYPE_COPY: - if (blockdev && !job->jobflagsmissing) { + if (!job->jobflagsmissing) { bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; bool reuse =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT; @@ -14406,41 +14406,35 @@ qemuDomainBlockPivot(virQEMUDriver *driver, break; case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: - if (blockdev) { - bitmapactions =3D virJSONValueNewArray(); - - if (qemuMonitorTransactionBitmapAdd(bitmapactions, - job->data.commit.base->nod= eformat, - "libvirt-tmp-activewrite", - false, - false, - 0) < 0) - return -1; - } + bitmapactions =3D virJSONValueNewArray(); + + if (qemuMonitorTransactionBitmapAdd(bitmapactions, + job->data.commit.base->nodefor= mat, + "libvirt-tmp-activewrite", + false, + false, + 0) < 0) + return -1; break; } qemuDomainObjEnterMonitor(driver, vm); - if (blockdev) { - int rc =3D 0; - if (chainattachdata) { - if ((rc =3D qemuBlockStorageSourceChainAttach(priv->mon, chain= attachdata)) =3D=3D 0) { - /* install backing images on success, or unplug them on fa= ilure */ - if ((rc =3D qemuMonitorTransaction(priv->mon, &reopenactio= ns)) !=3D 0) - qemuBlockStorageSourceChainDetach(priv->mon, chainatta= chdata); - } + if (chainattachdata) { + if ((rc =3D qemuBlockStorageSourceChainAttach(priv->mon, chainatta= chdata)) =3D=3D 0) { + /* install backing images on success, or unplug them on failur= e */ + if ((rc =3D qemuMonitorTransaction(priv->mon, &reopenactions))= !=3D 0) + qemuBlockStorageSourceChainDetach(priv->mon, chainattachda= ta); } + } - if (bitmapactions && rc =3D=3D 0) - ignore_value(qemuMonitorTransaction(priv->mon, &bitmapactions)= ); + if (bitmapactions && rc =3D=3D 0) + ignore_value(qemuMonitorTransaction(priv->mon, &bitmapactions)); + + if (rc =3D=3D 0) + ret =3D qemuMonitorJobComplete(priv->mon, job->name); - if (rc =3D=3D 0) - ret =3D qemuMonitorJobComplete(priv->mon, job->name); - } else { - ret =3D qemuMonitorDrivePivot(priv->mon, job->name); - } qemuDomainObjExitMonitor(vm); /* The pivot failed. The block job in QEMU remains in the synchronised= state */ --=20 2.36.1