From nobody Sun Feb 8 19:30:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1602074162; cv=none; d=zohomail.com; s=zohoarc; b=KXYzmHHJTiMnDe2E6QJ1HdNDFXswYfsGXt8ZUOR9uUQcKsh/+FaLbgof4ckhybG3FUE7Pr9fk2aJLp3rctix6tFJh31rciPiQAP0D8dbLkD/tslUh9b2OBRPp3Y9S4L1GAgTSLXvBpFUM6c3GrWTSO+Qc/yHowGOkweF4AicyuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602074162; 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=BVOtSLNZBJUtMV2yqmEqw5IWpdmwO3QXpjPy0R1HQdI=; b=K1+bK/kjte0vd0fw69e+ExIm7oxrEX+KkqzaZpZSaCwi7vT0KKSKcPw7Om5lZ8K4bCMLDJwKqmgGJVcP+mk27RDeENu67VuoCxwk13v+DF/htvNw4N5a5QK+Kma7QwlTmfn/jndZlY28WRtfBYgi51NsWyJ1Py9kA0TedprQlGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602074162206745.8431214015613; Wed, 7 Oct 2020 05:36:02 -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-245-J6fjXF32PSupLOjAat2iUw-1; Wed, 07 Oct 2020 08:35:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3DB2710BBECF; Wed, 7 Oct 2020 12:35:51 +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 180F719C4F; Wed, 7 Oct 2020 12:35:51 +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 D323A18408AD; Wed, 7 Oct 2020 12:35:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 097CZfTA012399 for ; Wed, 7 Oct 2020 08:35:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id D79AD702E7; Wed, 7 Oct 2020 12:35:41 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F95276642 for ; Wed, 7 Oct 2020 12:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602074161; 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=BVOtSLNZBJUtMV2yqmEqw5IWpdmwO3QXpjPy0R1HQdI=; b=FIW5MC+JDCQD+s1otKCOgGkI1TLk+2W70OvPq06ud5uZ5gCQpt24v+fx1dHsb4ptM/DUjA OBcVdpAkA6AoguNWFoyajpPMvOUZYZrzjVbZNKZFIbms9zvBQSdc/IaCsIXOD0xBKdUNWV sRU9MryNSktByfaBl9g6zHqgg4qZOSc= X-MC-Unique: J6fjXF32PSupLOjAat2iUw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv2 03/16] qemu: agent: remove impossible errors Date: Wed, 7 Oct 2020 14:35:24 +0200 Message-Id: <3e44696c6ef8c1d12257b77846df4eb13ac54bb6.1602074066.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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) For both 'ip_addr_arr' and 'ret_array', we: 1) already checked that they are arrays 2) only iterate up to the array size Remove the duplicate checks. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jonathon Jongsma --- src/qemu/qemu_agent.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index fc7b65de2a..51c597f57e 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2160,13 +2160,6 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, const char *hwaddr, *ifname_s, *name =3D NULL; virDomainInterfacePtr iface =3D NULL; =20 - /* Shouldn't happen but doesn't hurt to check neither */ - if (!tmp_iface) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu agent reply missing interface entry in = array")); - goto error; - } - /* interface name is required to be presented */ name =3D virJSONValueObjectGetString(tmp_iface, "name"); if (!name) { @@ -2229,13 +2222,6 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, =20 ip_addr =3D &iface->addrs[addrs_count - 1]; =20 - /* Shouldn't happen but doesn't hurt to check neither */ - if (!ip_addr_obj) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu agent reply missing IP addr in arra= y")); - goto error; - } - if (qemuAgentGetInterfaceOneAddress(ip_addr, ip_addr_obj, name= ) < 0) goto error; } --=20 2.26.2