From nobody Thu Apr 18 03:56:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1574859161; cv=none; d=zohomail.com; s=zohoarc; b=FD5bg793HxVAohrkC7DFpti7qITc2q8aiFYNlYYUAaFP5nXKvon/5fM3gmDq/DyOiK9aVXcPr8MA51dR5RsmcPiGUN9USKB+NbjlDabGsQWSMXI9zOe5ovbG+auYb3I2VYWD9V/rLSddrwcUloniUNvs1fa8ri431rf1W3D7674= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574859161; 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=REX2C+fYC9k6neIgw3ezaTWdQS4eats8qllLrxr64iE=; b=WR0rWiCb9hfHJLLXZHEG6ByxXkNTNZfcVhKn36IHoO/WVyfGkSUwkgMFg9GJMvrV/gT3e6Qh7MwcXjeX2yxt03cg6Uosg88v4guuEI9uwmKqhISW2jcAqs2OoUMYlyOwZOpqJemKauv+Lzm5EC1vGf2rQF7hN65tzj8mK8H3Oe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574859161081237.07387572122252; Wed, 27 Nov 2019 04:52:41 -0800 (PST) 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-316-iSAFgAD-OvC2dIBtePRHRg-1; Wed, 27 Nov 2019 07:52:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05A2318AAFA5; Wed, 27 Nov 2019 12:52:32 +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 A7A4360BEC; Wed, 27 Nov 2019 12:52:30 +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 C2F9418089CD; Wed, 27 Nov 2019 12:52:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xARCqRlh029549 for ; Wed, 27 Nov 2019 07:52:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 92FF35D9E1; Wed, 27 Nov 2019 12:52:27 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C0F05D9D6 for ; Wed, 27 Nov 2019 12:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574859159; 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=REX2C+fYC9k6neIgw3ezaTWdQS4eats8qllLrxr64iE=; b=BU2/mxgPSegJbtTZYjGae/GFlI6IDL7l7GK05HTM0eQOBBTfBHrGqAIQk4WjY/xQOgl2Eg deCAMVMURSdzOKIZEyqbYZBid7J19EgNdxEqFCWLunMtsWbb6FxJH9PnKtuSj0BMtbsq1N 4jRyYTyA+swqFEe6XaqSJ8CPTXJ7z88= From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 27 Nov 2019 13:52:23 +0100 Message-Id: <471f6605c945cf788e513cb19011487693d40ca6.1574859089.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH for 5.10] Revert "qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull" 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.12 X-MC-Unique: iSAFgAD-OvC2dIBtePRHRg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 421c9550f5446729b513ee50f5c44e6f6969b5a2. qemuDomainBlockPullCommon calls virDomainObjEndAPI internally so the original commit made us shed two references of @vm instead of one getting us into a premature free of @vm. This is not a straight revert as qemuDomainBlockPull was modified meanwhile. I've also added a warning comment that @vm is consumed. https://bugzilla.redhat.com/show_bug.cgi?id=3D1777230 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- /me hides in shame src/qemu/qemu_driver.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 669c12d6ca..8c2670d377 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18443,24 +18443,23 @@ qemuDomainBlockPull(virDomainPtr dom, const char = *path, unsigned long bandwidth, unsigned int flags) { virDomainObjPtr vm; - int ret =3D -1; - virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1); if (!(vm =3D qemuDomainObjFromDomain(dom))) return -1; - if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) - goto cleanup; - - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) - goto cleanup; + if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) { + virDomainObjEndAPI(&vm); + return -1; + } - ret =3D qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); + if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) { + virDomainObjEndAPI(&vm); + return -1; + } - cleanup: - virDomainObjEndAPI(&vm); - return ret; + /* qemuDomainBlockPullCommon consumes the reference on @vm */ + return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags); } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list