From nobody Sat May 4 06:05:17 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1519308038394931.6054891544159; Thu, 22 Feb 2018 06:00:38 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 273F37FEA8; Thu, 22 Feb 2018 14:00:37 +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 918CC5D757; Thu, 22 Feb 2018 14:00:36 +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 30F9B18033EC; Thu, 22 Feb 2018 14:00:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1ME0Yad027515 for ; Thu, 22 Feb 2018 09:00:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5AC741049465; Thu, 22 Feb 2018 14:00:34 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A9FC1049460 for ; Thu, 22 Feb 2018 14:00:32 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5665B1014E3; Thu, 22 Feb 2018 15:00:31 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 22 Feb 2018 15:00:25 +0100 Message-Id: <1c5ce390fd3aff8636138cd27b4f220f872049a2.1519308025.git.jdenemar@redhat.com> Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu_hotplug: Drop dead code in net update 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: , MIME-Version: 1.0 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 22 Feb 2018 14:00:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" vm->def->nets[changeidx] can never be NULL for changeidx returned by virDomainNetFindIdx. Signed-off-by: Jiri Denemark --- src/qemu/qemu_hotplug.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 87cf578acc..e0a5300f08 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3061,12 +3061,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, if ((changeidx =3D virDomainNetFindIdx(vm->def, newdev)) < 0) goto cleanup; devslot =3D &vm->def->nets[changeidx]; - - if (!(olddev =3D *devslot)) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("cannot find existing network device to modify")); - goto cleanup; - } + olddev =3D *devslot; =20 oldType =3D virDomainNetGetActualType(olddev); if (oldType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV) { --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list