From nobody Sun Apr 28 20:04:21 2024 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=1591402998; cv=none; d=zohomail.com; s=zohoarc; b=L3D2I/dqPkGe3OTYp4tWPu7d34ukfWuRc9BAgiUaMElkOqGTtv854CSAz+Rlnh5xs4mzuRVVqlNaq9eIQV+Smo7YwPAKKQrhofZ/eih/4cwTc6JBrwrl7cGSOC1cz+ievu7BHl5flTuFRWW9FTFAOGfMJj2A2MP16DtK8WPHEt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591402998; 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=ivnvzdh9xMcpKPLN6l2FOr6gn94tINdbZziLKUY4awE=; b=Gd8dKVAYog/yK2rpf53G9r0lt4+Vfe38TZiunc7J/LymWfPCsuEnxQgUFiugg4TyD0qMD/+UyyoHZSkqje7v3Pu+PTGQWQ0xBz8cr2ylz2dvOaC52CwsRz4z0LCDvmJD4LxhVTRwLsNS5W8/JisPgk3QSLeU1E6EhtQMzyMUnC4= 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 159140299863649.848063314316846; Fri, 5 Jun 2020 17:23:18 -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-487-8J307LzZOKGp24tfTKYknQ-1; Fri, 05 Jun 2020 20:23:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C569F100A623; Sat, 6 Jun 2020 00:23:09 +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 A8B977A8CD; Sat, 6 Jun 2020 00:23:09 +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 7DC69974F5; Sat, 6 Jun 2020 00:23:09 +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 055AMvor018876 for ; Fri, 5 Jun 2020 06:22:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id BE7EA5C3E7; Fri, 5 Jun 2020 10:22:57 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BDF95C1C8 for ; Fri, 5 Jun 2020 10:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591402997; 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=ivnvzdh9xMcpKPLN6l2FOr6gn94tINdbZziLKUY4awE=; b=XYSdj6LOOa5qvVqkDQUX8lEi8cr8ifNuDiBCsB0QVH8IDhV+jx551hONkhw+Sq5wuSGfMU ho+5bc2GOHTsGGJFiaaKzVB/fqWakCC5tzvW03JLnWjyAUGblem9NRDycTlN8m37XMmjTT GBFYASB/3rs5ERVgU5lCWsGQsMOAWTU= X-MC-Unique: 8J307LzZOKGp24tfTKYknQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: blockcommit: Fix placement of qemuDomainDiskBlockJobIsSupported Date: Fri, 5 Jun 2020 12:22:52 +0200 Message-Id: <0940eae5364b824de1246141873c5ad1e41b6624.1591352549.git.pkrempa@redhat.com> 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.11 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" Commit b50a8354f6d added call to qemuDomainDiskBlockJobIsSupported prior to filling the 'disk' variable resulting in a crash when attempting a block commit. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dd9ae30bb5..88517ba6a7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18504,9 +18504,6 @@ qemuDomainBlockCommit(virDomainPtr dom, if (virDomainObjCheckActive(vm) < 0) goto endjob; - if (!qemuDomainDiskBlockJobIsSupported(vm, disk)) - goto endjob; - blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); /* Convert bandwidth MiB to bytes, if necessary */ @@ -18523,6 +18520,9 @@ qemuDomainBlockCommit(virDomainPtr dom, if (!(disk =3D qemuDomainDiskByName(vm->def, path))) goto endjob; + if (!qemuDomainDiskBlockJobIsSupported(vm, disk)) + goto endjob; + if (virStorageSourceIsEmpty(disk->src)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk %s has no source file to be committed"), --=20 2.26.2