From nobody Sun Feb 8 23:41:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.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=1571753056; cv=none; d=zoho.com; s=zohoarc; b=ic5RuYpgeuAjkzQJZv/1GOebfViNpRpV62zYlGBTrkTV8SiLeLPfS9moSDce07Fk94lK19Sak4RjOhcPQsP3zvVB1rBQIVLYj5WmY0glyuKA5kHoaaEGfmAqy8tal1G1HHD6bpLVaGsM1xGA3SA6D4xQlIdWKL271F+tgckDyvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571753056; 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=ToJ6Kwk1btNIvK2tqHGYv9NgN9n3RGkl+IvDVOMY81Q=; b=BobLefR6QZ4y17UrNy3sbD0jB78sp4m4zZ9hqn30lRBDLq9c24ac9GbUe6xIoeloQahsyloINr2s5uFWnsAnHewayC4LDUgyFGgR/iy1yXrbx6IUlXwx2hPy+E1Z7zinxhFVKrKmAp95MapMuyA4FsEf0jAZ0ukS2kCNlWesOFo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571753056422232.53328326957785; Tue, 22 Oct 2019 07:04:16 -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-332-UzL3MvkkPQOQ-4i61mTG5g-1; Tue, 22 Oct 2019 09:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F4DB1800E05; Tue, 22 Oct 2019 13:59:02 +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 685305DC18; Tue, 22 Oct 2019 13:59:02 +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 2412A3FB4B; Tue, 22 Oct 2019 13:59:02 +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 x9MDx1ZQ001803 for ; Tue, 22 Oct 2019 09:59:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16F756012D; Tue, 22 Oct 2019 13:59:01 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 930AB6012E for ; Tue, 22 Oct 2019 13:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571753055; 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=ToJ6Kwk1btNIvK2tqHGYv9NgN9n3RGkl+IvDVOMY81Q=; b=USz4SrtQOy7C7sacEF5Nkp9SG05kQadCAuFTE0lfpcRlM7pyy/EGNOWZy0eWZB2j5WxxwT j/8VKVDm1T2HTEgrEAdJJ3+UQKfFdwN+uyrsaB/t4QW0kx8THS7f87hKZRKnZHyHaY0dj8 CteerlVD9YgsSejOoWOA1nZBZ8RbGAw= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:28 +0200 Message-Id: <1d6a2e9e5e624ba5f31dc67979b53c0e45d6be6f.1571752582.git.mprivozn@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 Subject: [libvirt] [PATCH 24/75] test: Drop virAsprintf() and virAsprintfQuiet() retval checking 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.14 X-MC-Unique: UzL3MvkkPQOQ-4i61mTG5g-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" These functions can't fail really. Drop checking of their retval then. Signed-off-by: Michal Privoznik --- src/test/test_driver.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index e00a65d8bb..96607c04eb 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -640,8 +640,7 @@ testDomainGenerateIfname(virDomainDefPtr domdef) virDomainNetDefPtr net =3D NULL; char *ifname; =20 - if (virAsprintf(&ifname, "testnet%d", ifctr) < 0) - return NULL; + virAsprintf(&ifname, "testnet%d", ifctr); =20 /* Generate network interface names */ if (!(net =3D virDomainNetFindByName(domdef, ifname))) @@ -1076,8 +1075,7 @@ testOpenVolumesForPool(const char *file, g_autoptr(virStorageVolDef) volDef =3D NULL; =20 /* Find storage volumes */ - if (virAsprintf(&vol_xpath, "/node/pool[%d]/volume", objidx) < 0) - return -1; + virAsprintf(&vol_xpath, "/node/pool[%d]/volume", objidx); =20 num =3D virXPathNodeSet(vol_xpath, ctxt, &nodes); if (num < 0) @@ -1093,9 +1091,8 @@ testOpenVolumesForPool(const char *file, return -1; =20 if (!volDef->target.path) { - if (virAsprintf(&volDef->target.path, "%s/%s", - def->target.path, volDef->name) < 0) - return -1; + virAsprintf(&volDef->target.path, "%s/%s", def->target.path, + volDef->name); } =20 if (!volDef->key) @@ -2046,7 +2043,7 @@ testDomainGetHostname(virDomainPtr domain, if (virDomainObjCheckActive(vm) < 0) goto cleanup; =20 - ignore_value(virAsprintf(&ret, "%shost", domain->name)); + virAsprintf(&ret, "%shost", domain->name); =20 cleanup: virDomainObjEndAPI(&vm); @@ -4735,8 +4732,7 @@ testDomainGetFSInfo(virDomainPtr dom, info_ret[0]->mountpoint =3D g_strdup("/"); info_ret[0]->fstype =3D g_strdup("ext4"); info_ret[0]->devAlias[0] =3D g_strdup(name); - if (virAsprintf(&info_ret[0]->name, "%s1", name) < 0) - goto cleanup; + virAsprintf(&info_ret[0]->name, "%s1", name); =20 if (VIR_ALLOC(info_ret[1]) < 0 || VIR_ALLOC(info_ret[1]->devAlias) < 0) @@ -4745,8 +4741,7 @@ testDomainGetFSInfo(virDomainPtr dom, info_ret[1]->mountpoint =3D g_strdup("/boot"); info_ret[1]->fstype =3D g_strdup("ext4"); info_ret[1]->devAlias[0] =3D g_strdup(name); - if (virAsprintf(&info_ret[1]->name, "%s2", name) < 0) - goto cleanup; + virAsprintf(&info_ret[1]->name, "%s2", name); =20 info_ret[0]->ndevAlias =3D info_ret[1]->ndevAlias =3D 1; =20 @@ -5116,8 +5111,7 @@ testDomainInterfaceAddresses(virDomainPtr dom, } else { iface->addrs[0].type =3D VIR_IP_ADDR_TYPE_IPV4; iface->addrs[0].prefix =3D 24; - if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", 1 + i)= < 0) - goto cleanup; + virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", 1 + i); =20 } =20 @@ -6370,8 +6364,7 @@ testConnectFindStoragePoolSources(virConnectPtr conn = G_GNUC_UNUSED, return NULL; } =20 - ignore_value(virAsprintf(&ret, defaultPoolSourcesNetFSXML, - source->hosts[0].name)); + virAsprintf(&ret, defaultPoolSourcesNetFSXML, source->hosts[0].nam= e); return ret; =20 default: @@ -7014,9 +7007,8 @@ testStorageVolCreateXML(virStoragePoolPtr pool, goto cleanup; } =20 - if (virAsprintf(&privvol->target.path, "%s/%s", - def->target.path, privvol->name) < 0) - goto cleanup; + virAsprintf(&privvol->target.path, "%s/%s", def->target.path, + privvol->name); =20 privvol->key =3D g_strdup(privvol->target.path); if (virStoragePoolObjAddVol(obj, privvol) < 0) @@ -7082,9 +7074,8 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool, } def->available =3D (def->capacity - def->allocation); =20 - if (virAsprintf(&privvol->target.path, "%s/%s", - def->target.path, privvol->name) < 0) - goto cleanup; + virAsprintf(&privvol->target.path, "%s/%s", def->target.path, + privvol->name); =20 privvol->key =3D g_strdup(privvol->target.path); if (virStoragePoolObjAddVol(obj, privvol) < 0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list