From nobody Fri Dec 19 17:01:32 2025 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=1596406343; cv=none; d=zohomail.com; s=zohoarc; b=mC4WYJL3rc1nLaN0BtkX2q2YtNH7a/RJTEWXs0k1QidgZViBa0x8rXPYPUKyPNep8l2ZQA9IaBbxOiebAGJhlumEUF6yzJtkhS7tFmKQL6zc2ciltWo2KSawHu8CBd+LspmxZWWo4CWgK/IM36/RxPCaws02Mz7ecSIA1mcMgjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596406343; 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=S3E8KgEwlqyPiZ5+0/uPEheNjBR56wD00MOtqvH5ZMg=; b=AqjuDm7q03vkoT/DINhyqJzh4jwZWoGYjpQ2FmnaV9/chTsCg4pGcIGN/7tB2EtFqjiGKEtRDyqL36cqqkVnCJj73DjCbRumBWONg07O6obtwM7BsulMH1loTpiAs4whqixX7WdMRSh61PL+UyQikIVeAXX+lRKqoEEc1rgClmQ= 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 1596406343320293.29743629928714; Sun, 2 Aug 2020 15:12:23 -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-405-EGlagY20OkyTRWY4Urqgzg-1; Sun, 02 Aug 2020 18:12:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBF451893DCC; Sun, 2 Aug 2020 22:12:14 +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 9D10E8BEC7; Sun, 2 Aug 2020 22:12:14 +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 6D24B1809561; Sun, 2 Aug 2020 22:12:14 +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 072MBgTZ010575 for ; Sun, 2 Aug 2020 18:11:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B6E85FC2F; Sun, 2 Aug 2020 22:11:42 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 813C25C5B7 for ; Sun, 2 Aug 2020 22:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596406342; 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=S3E8KgEwlqyPiZ5+0/uPEheNjBR56wD00MOtqvH5ZMg=; b=LWH8VPK7HSXTxQB8cXCEMXIEW7fE+qrK6silSCeDae/1BTlXQV+bYedqTpxIz2KZHz0z+b nMWRlOPmVCAdlei1sxrtkHdAbd5ilVVu5gZV5dbPrIh0vK1TkVPbIF0l/JlNdhssm4rx2E JNMjGKZS0dltXII+ST+XVeNpw3XycNc= X-MC-Unique: EGlagY20OkyTRWY4Urqgzg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/8] Remove redundant conditions Date: Mon, 3 Aug 2020 00:11:25 +0200 Message-Id: <7ecf882a11f4459b860765a8885866ad3c370de1.1596406221.git.jtomko@redhat.com> In-Reply-To: References: 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) All of these have been checked earlier. Signed-off-by: J=C3=A1n Tomko --- src/hypervisor/virhostdev.c | 2 +- src/libxl/xen_xl.c | 2 +- src/qemu/qemu_hotplug.c | 3 +-- src/qemu/qemu_process.c | 6 +++--- src/rpc/virnetsocket.c | 2 +- src/util/virlease.c | 2 +- src/vbox/vbox_common.c | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index 9017cc3be8..69102b8ebf 100644 --- a/src/hypervisor/virhostdev.c +++ b/src/hypervisor/virhostdev.c @@ -1425,7 +1425,7 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostde= v, usbsrc->bus, usbsrc->device, bus, device); } - } else if (!vendor && bus) { + } else if (bus) { if (virUSBDeviceFindByBus(bus, device, NULL, mandatory, usb) < 0) return -1; } diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index f9dc18ab18..e83a019bcc 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -450,7 +450,7 @@ xenParseXLVnuma(virConfPtr conf, unsigned long long kbsize =3D 0; =20 /* Is there a sublist (vnode)? */ - if (list && list->type =3D=3D VIR_CONF_LIST) { + if (list->type =3D=3D VIR_CONF_LIST) { vnode =3D list->list; =20 while (vnode && vnode->type =3D=3D VIR_CONF_STRING) { diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 26912334d2..b902c1aba1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4711,8 +4711,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver, =20 qemuDomainObjEnterMonitor(driver, vm); =20 - if (rc =3D=3D 0 && - qemuMonitorDelObject(priv->mon, objAlias, true) < 0) + if (qemuMonitorDelObject(priv->mon, objAlias, true) < 0) rc =3D -1; =20 if (rng->backend =3D=3D VIR_DOMAIN_RNG_BACKEND_EGD && diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ec6ca14bbd..e99d9f76fe 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6888,11 +6888,11 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; VIR_DEBUG("Handshake complete, child running"); =20 - if (rv =3D=3D -1) /* The VM failed to start; tear filters before taps = */ + if (rv =3D=3D -1) { + /* The VM failed to start; tear filters before taps */ virDomainConfVMNWFilterTeardown(vm); - - if (rv =3D=3D -1) /* The VM failed to start */ goto cleanup; + } =20 if (qemuDomainObjStartWorker(vm) < 0) goto cleanup; diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 5a7f501923..977d2875fe 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -687,7 +687,7 @@ int virNetSocketNewConnectUNIX(const char *path, if (spawnDaemon) { g_autofree char *binname =3D NULL; =20 - if (spawnDaemon && !binary) { + if (!binary) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Auto-spawn of daemon requested, " "but no binary specified")); diff --git a/src/util/virlease.c b/src/util/virlease.c index 1cb9540d80..aeb605862f 100644 --- a/src/util/virlease.c +++ b/src/util/virlease.c @@ -244,7 +244,7 @@ virLeaseNew(virJSONValuePtr *lease_ret, return -1; if (ip && virJSONValueObjectAppendString(lease_new, "ip-address", ip) = < 0) return -1; - if (mac && virJSONValueObjectAppendString(lease_new, "mac-address", ma= c) < 0) + if (virJSONValueObjectAppendString(lease_new, "mac-address", mac) < 0) return -1; if (hostname && virJSONValueObjectAppendString(lease_new, "hostname", = hostname) < 0) return -1; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 15f8eb074a..bdbb929ad6 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -1201,7 +1201,7 @@ vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr d= ata, IMachine *machine) if (disk->src->readonly) { gVBoxAPI.UIMedium.SetType(medium, MediumType_Immutable); VIR_DEBUG("Setting hard disk to immutable"); - } else if (!disk->src->readonly) { + } else { gVBoxAPI.UIMedium.SetType(medium, MediumType_Normal); VIR_DEBUG("Setting hard disk type to normal"); } --=20 2.26.2