From nobody Tue Dec 16 00:02:43 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=1658846467; cv=none; d=zohomail.com; s=zohoarc; b=M8riCfa3H0hRRHs3Sbp4xet/f6a+LEnWRromPRJUPDqVYNgkWfTIt8Y715d196OPe4uAEzcyuwVtqBY3M1Yfwb0HB/4JS+VIvLlSWiB9quld+LWAydbohT49z0K6dRuzW4Y5+5tLvhxxe1dnfkUbXwsXfDc1b2LtXopWEMuw+7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846467; 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=a9uQyfrWqnzJN51sgAQOANTu0fenX0eLF+Efcxi5fQs=; b=a8VZJEmjqZ0MHqXCKOjKFWXZSVtkDScBeYThYpyshw2EO4pwGK2biVlBuqXlyY7+H81XyMetAOyf6uRJAiz7JdPSAq27788ipERcCJoRZ3Qprpw3yhd+JNzQ3szxyB1q1YtvMarYZDq6O1LciEO8DLDPT1AwLZS7PEOVwToDjaU= 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 1658846467319314.0545727370246; Tue, 26 Jul 2022 07:41:07 -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-618-y9f2QEojOCuzycInz9eRHQ-1; Tue, 26 Jul 2022 10:39:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5914B806011; 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 3D41E1415122; 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 6EE641947070; 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 C151F1945DBB for ; Tue, 26 Jul 2022 14:38:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B2B8C40CF8EE; Tue, 26 Jul 2022 14:38:43 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 418DC40CFD0A for ; Tue, 26 Jul 2022 14:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846465; 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=a9uQyfrWqnzJN51sgAQOANTu0fenX0eLF+Efcxi5fQs=; b=FifSdWFiu5AKIjwG9AZejwnfQ0+Qs1HI07kvtIxxzDV8oSfRmOHGtM+g75Pzq62unUNsHX rv+sfMPOXGp+4cn2Ot0TicEd5hoTbE0USvk6pp/fHHjZ5QqVFGP3CqNjQuUB+DkSeMbBZe oQhX9MWKbjKDL3XrpSfUtVRrPDW+fpU= X-MC-Unique: y9f2QEojOCuzycInz9eRHQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 43/80] qemu: driver: Remove pre-blockdev code paths from qemuDomainBlockCommit Date: Tue, 26 Jul 2022 16:37:21 +0200 Message-Id: <1d49a270b57c25c871441115b675d146a071d366.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.85 on 10.11.54.7 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: 1658846468152100006 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_driver.c | 60 +++++++++--------------------------------- 1 file changed, 13 insertions(+), 47 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bae9558cfd..e8dc524186 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15469,24 +15469,16 @@ qemuDomainBlockCommit(virDomainPtr dom, virQEMUDriver *driver =3D dom->conn->privateData; qemuDomainObjPrivate *priv; virDomainObj *vm =3D NULL; - const char *device =3D NULL; - const char *jobname =3D NULL; int ret =3D -1; virDomainDiskDef *disk =3D NULL; virStorageSource *topSource; virStorageSource *baseSource =3D NULL; virStorageSource *top_parent =3D NULL; bool clean_access =3D false; - g_autofree char *topPath =3D NULL; - g_autofree char *basePath =3D NULL; g_autofree char *backingPath =3D NULL; unsigned long long speed =3D bandwidth; qemuBlockJobData *job =3D NULL; g_autoptr(virStorageSource) mirror =3D NULL; - const char *nodetop =3D NULL; - const char *nodebase =3D NULL; - bool persistjob =3D false; - bool blockdev =3D false; virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | VIR_DOMAIN_BLOCK_COMMIT_ACTIVE | @@ -15507,8 +15499,6 @@ qemuDomainBlockCommit(virDomainPtr dom, if (virDomainObjCheckActive(vm) < 0) goto endjob; - blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - /* Convert bandwidth MiB to bytes, if necessary */ if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) { if (speed > LLONG_MAX >> 20) { @@ -15539,12 +15529,6 @@ qemuDomainBlockCommit(virDomainPtr dom, 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 (!(topSource =3D virStorageSourceChainLookup(disk->src, NULL, = top, @@ -15600,7 +15584,7 @@ qemuDomainBlockCommit(virDomainPtr dom, if (flags & VIR_DOMAIN_BLOCK_COMMIT_RELATIVE && topSource !=3D disk->src) { - if (blockdev && top_parent && + if (top_parent && qemuBlockUpdateRelativeBacking(vm, top_parent, disk->src) < 0) goto endjob; @@ -15644,39 +15628,21 @@ qemuDomainBlockCommit(virDomainPtr dom, disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_NONE; - /* Start the commit operation. Pass the user's original spelling, - * if any, through to qemu, since qemu may behave differently - * depending on whether the input was specified as relative or - * absolute (that is, our absolute top_canon may do the wrong - * thing if the user specified a relative name). */ - - if (blockdev) { - persistjob =3D true; - jobname =3D job->name; - nodetop =3D topSource->nodeformat; - nodebase =3D baseSource->nodeformat; - device =3D qemuDomainDiskGetTopNodename(disk); - if (!backingPath && top_parent && - !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, f= alse))) - goto endjob; - - } else { - device =3D job->name; - } + if (!backingPath && top_parent && + !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, false= ))) + goto endjob; qemuDomainObjEnterMonitor(driver, vm); - if (!blockdev) { - basePath =3D qemuMonitorDiskNameLookup(priv->mon, device, disk->sr= c, - baseSource); - topPath =3D qemuMonitorDiskNameLookup(priv->mon, device, disk->src, - topSource); - } - - if (blockdev || (basePath && topPath)) - ret =3D qemuMonitorBlockCommit(priv->mon, device, jobname, persist= job, - topPath, nodetop, basePath, nodebase, - backingPath, speed); + ret =3D qemuMonitorBlockCommit(priv->mon, + qemuDomainDiskGetTopNodename(disk), + job->name, + true, + NULL, + topSource->nodeformat, + NULL, + baseSource->nodeformat, + backingPath, speed); qemuDomainObjExitMonitor(vm); --=20 2.36.1