From nobody Fri May 3 02:02:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1556617657; cv=none; d=zoho.com; s=zohoarc; b=B/nbKR+j2TQzvg5zqe4vZ1oJsZO+0cHnNLbk1lchIBNcJ1gmMPROjdo5BCZ8v+ahLUVM1Ap+vmvXYhkBpmdlJ97MgY2MS5qMGyGVS07Doep8ALSZ7/tlSUkl6Ydw7UCz5YGggdNt2fp3iWaHeFu2kjTHAIl64gwepRi8Pfnzmf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556617657; 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:ARC-Authentication-Results; bh=lLAEgGhvtjdHvWsYTTPKphgzI6Jo9o5FDgxSN+QF4p0=; b=iQSbuE7AJl4vu0RgqJUE2Olzr31BMl8icfent3JbFxiuT2RULrpEha5SNs3Donv+7hIg4rhMBp3Y5sZO3X6F5Q4D2HpwqWxK4zfQdww5n1h5d9EL83QoQP80QYuLwBdWJbMIG6t5xKNQiUcxmHlKbw51aYgiY7QvxQ3C9svuZKg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556617657240203.5727728135961; Tue, 30 Apr 2019 02:47:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1F4F307CDF0; Tue, 30 Apr 2019 09:47:34 +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 3C5C46F541; Tue, 30 Apr 2019 09:47:34 +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 A91E93FB11; Tue, 30 Apr 2019 09:47:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3U9lUrW003693 for ; Tue, 30 Apr 2019 05:47:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 73D727C816; Tue, 30 Apr 2019 09:47:30 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id F10EE7C81C for ; Tue, 30 Apr 2019 09:47:27 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 30 Apr 2019 11:47:25 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemuConnectOpen: Drop unused @cfg and simplify 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 30 Apr 2019 09:47:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" After 65a372d6e0 the @cfg variable is no longer used. This means we can drop it and therefore drop 'cleanup' label with it. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_driver.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c072bed1ce..30945d1545 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1094,44 +1094,37 @@ static virDrvOpenStatus qemuConnectOpen(virConnectP= tr conn, virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { - virQEMUDriverConfigPtr cfg =3D NULL; - virDrvOpenStatus ret =3D VIR_DRV_OPEN_ERROR; virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 if (qemu_driver =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("qemu state driver is not active")); - goto cleanup; + return VIR_DRV_OPEN_ERROR; } =20 - cfg =3D virQEMUDriverGetConfig(qemu_driver); - if (virQEMUDriverIsPrivileged(qemu_driver)) { if (STRNEQ(conn->uri->path, "/system") && STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected QEMU URI path '%s', try qemu:///s= ystem"), conn->uri->path); - goto cleanup; + return VIR_DRV_OPEN_ERROR; } } else { if (STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected QEMU URI path '%s', try qemu:///s= ession"), conn->uri->path); - goto cleanup; + return VIR_DRV_OPEN_ERROR; } } =20 if (virConnectOpenEnsureACL(conn) < 0) - goto cleanup; + return VIR_DRV_OPEN_ERROR; =20 conn->privateData =3D qemu_driver; =20 - ret =3D VIR_DRV_OPEN_SUCCESS; - cleanup: - virObjectUnref(cfg); - return ret; + return VIR_DRV_OPEN_SUCCESS; } =20 static int qemuConnectClose(virConnectPtr conn) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list