From nobody Mon Dec 15 23:05:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1658846361; cv=none; d=zohomail.com; s=zohoarc; b=UXhyEmdEA+i1vJHs+/F2ZqvznJXwzp09G0IldYJ9GqnWl+IjKqKYTW5wdG0xX3tyIwDYKvop2yzSiTD9GQgUb7nbveik4rRxJkLdHAqh5USFTPe69haW7E4Yc22lxt9D74+yEOHroCuqXId+XsGxry+EtYsexx+WP7+4Hxp22Mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846361; 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=5rRwHdh1VRp5sHywQvrkpEU5CUwGEJs8OZjaIb8/xAw=; b=dYh+7RWYSMDD+dVoddTCfUfOCyRRecPKPTjJl+HQzA3xhqDeDKyuv1OllypWmrROAi5xEGP/pwqcWVhTl8g+tUa3h5hfQ800OMEYes1PitkJFmgo6WmAPFD3Dng5csnBkarCvXJyH/Y84udp+BV0Vhi6K8xf2RztY2K5Pfgw5zY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 16588463614531010.2804948719328; Tue, 26 Jul 2022 07:39:21 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-518-WNgO-BvYO5SE2DKlcN1WhQ-1; Tue, 26 Jul 2022 10:39:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F25631824614; Tue, 26 Jul 2022 14:38:57 +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 DBE73C27D95; Tue, 26 Jul 2022 14:38:57 +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 38C1F1947057; Tue, 26 Jul 2022 14:38:53 +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 70EC31945DAB for ; Tue, 26 Jul 2022 14:38:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 60B45400DFD7; Tue, 26 Jul 2022 14:38:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id E42D640466AA for ; Tue, 26 Jul 2022 14:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846359; 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=5rRwHdh1VRp5sHywQvrkpEU5CUwGEJs8OZjaIb8/xAw=; b=cv6QGH7scauBdiBX3q8JqddBLr1EIjBTSyH9rFIvFBOS8PrHQ66Tb/YIcXxrQEwhRocSbU B+O6V8Xo98s3bt1UWL7iA2bh974dn+v2nMmZL952lomjL7pKGrtt1N5rVB36UW55aknrnN PkppGSsUDk3LUYFiOdcEYgjn5FSs7pI= X-MC-Unique: WNgO-BvYO5SE2DKlcN1WhQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 45/80] qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockPullCommon Date: Tue, 26 Jul 2022 16:37:23 +0200 Message-Id: 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.85 on 10.11.54.8 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: 1658846362360100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_driver.c | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ac20d04353..7a2d8dde5e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14466,17 +14466,12 @@ qemuDomainBlockPullCommon(virDomainObj *vm, { qemuDomainObjPrivate *priv =3D vm->privateData; virQEMUDriver *driver =3D priv->driver; - const char *device =3D NULL; - const char *jobname =3D NULL; virDomainDiskDef *disk; virStorageSource *baseSource =3D NULL; - g_autofree char *basePath =3D NULL; g_autofree char *backingPath =3D NULL; unsigned long long speed =3D bandwidth; qemuBlockJobData *job =3D NULL; - bool persistjob =3D false; const char *nodebase =3D NULL; - bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); int ret =3D -1; if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE && !base) { @@ -14511,8 +14506,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm, if (baseSource) { if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE) { - if (blockdev && - qemuBlockUpdateRelativeBacking(vm, disk->src, disk->src) <= 0) + if (qemuBlockUpdateRelativeBacking(vm, disk->src, disk->src) <= 0) goto endjob; if (virStorageSourceGetRelativeBackingPath(disk->src->backingS= tore, @@ -14542,29 +14536,22 @@ qemuDomainBlockPullCommon(virDomainObj *vm, if (!(job =3D qemuBlockJobDiskNewPull(vm, disk, baseSource, flags))) goto endjob; - if (blockdev) { - jobname =3D job->name; - persistjob =3D true; - if (baseSource) { - nodebase =3D baseSource->nodeformat; - if (!backingPath && - !(backingPath =3D qemuBlockGetBackingStoreString(baseSourc= e, false))) - goto endjob; - } - device =3D disk->src->nodeformat; - } else { - device =3D job->name; + if (baseSource) { + nodebase =3D baseSource->nodeformat; + if (!backingPath && + !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, f= alse))) + goto endjob; } qemuDomainObjEnterMonitor(driver, vm); - if (!blockdev && baseSource) - basePath =3D qemuMonitorDiskNameLookup(priv->mon, device, disk->sr= c, - baseSource); - - if (blockdev || - (!baseSource || basePath)) - ret =3D qemuMonitorBlockStream(priv->mon, device, jobname, persist= job, basePath, - nodebase, backingPath, speed); + ret =3D qemuMonitorBlockStream(priv->mon, + disk->src->nodeformat, + job->name, + true, + NULL, + nodebase, + backingPath, + speed); qemuDomainObjExitMonitor(vm); if (ret < 0) --=20 2.36.1