From nobody Mon Feb 9 02:51:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; 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.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=1571752803; cv=none; d=zoho.com; s=zohoarc; b=DmACp9uxrA6RaB4CP9Ygc9ogjbaSloCr40LwN/5R2yrzTt1z2+KnWxPUtU4ock1/XpJ3sXPhJOQe3JZ5yyTclG3mJvKw1iMpT5NBV2J+Ec5NLrBJcKgYJuYBxOlY6YrHUpRhw0w40O/a2j/IpC+XCMozkFu59goZOKSUxWi9DVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752803; 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=+psdt8niFoh+FHMzOmE5A15IlTpNlL6Y5v2Vc+OrIrw=; b=Io7wPg2Lcvuqff+ZoSfOOkp3t9CAr2U27pa3rmjWN4+lEneY5paHWXwMFgoTD9rbnlpSS34/K8EK0AiiCqec/p4UDl9ods5wQ9OWniA3J2k8aLFc20pdpS2X5lrAdUXs1JUE6t0eXNudc/vOffP9aOOt+9575V2tE9V8aPdcAZ0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571752803274497.20902861763454; Tue, 22 Oct 2019 07:00:03 -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-23-ui1Y1kOpMNKKlU1j2tB57g-1; Tue, 22 Oct 2019 09:58:41 -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 5837D107AD38; Tue, 22 Oct 2019 13:58:32 +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 3161A5DD78; Tue, 22 Oct 2019 13:58:32 +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 E885C180B536; Tue, 22 Oct 2019 13:58:31 +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 x9MDwP1u001544 for ; Tue, 22 Oct 2019 09:58:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7DDD06012D; Tue, 22 Oct 2019 13:58:25 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D49D36012C for ; Tue, 22 Oct 2019 13:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752802; 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=+psdt8niFoh+FHMzOmE5A15IlTpNlL6Y5v2Vc+OrIrw=; b=EO+fFW5vVdX/v8tJ3b1YwMJe4/gUJofxDTRT9S7uNpuhCYpnh62EKjaNqdd7K5pJSmSjcm ysdtQ8sOJqE2wwnFmEs7PxxeKWRsE7vr1TudPWf5U4PpEJyFEbS1GUb+dPjk1Jideo59KX YqwqXmEaArK7vxFk3PmCATheV9Ve1R0= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:09 +0200 Message-Id: <8db15985cdb31156e295f8e9adf930c92505d29d.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 05/75] conf: 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: ui1Y1kOpMNKKlU1j2tB57g-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/conf/capabilities.c | 3 +- src/conf/domain_addr.c | 8 ++--- src/conf/domain_audit.c | 60 ++++++++++++-------------------- src/conf/domain_conf.c | 48 ++++++++++--------------- src/conf/moment_conf.c | 5 ++- src/conf/network_conf.c | 2 +- src/conf/node_device_util.c | 3 +- src/conf/snapshot_conf.c | 5 +-- src/conf/storage_conf.c | 6 ++-- src/conf/virchrdev.c | 7 ++-- src/conf/virnetworkobj.c | 8 ++--- src/conf/virnetworkportdef.c | 2 +- src/conf/virnwfilterbindingobj.c | 2 +- src/conf/virstorageobj.c | 3 +- 14 files changed, 61 insertions(+), 101 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 697d464fe9..b93b6ff451 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1869,8 +1869,7 @@ virCapabilitiesInitCaches(virCapsPtr caps) int rv =3D -1; =20 VIR_FREE(path); - if (virAsprintf(&path, "%s/cpu/cpu%zd/cache/", SYSFS_SYSTEM_PATH, = pos) < 0) - goto cleanup; + virAsprintf(&path, "%s/cpu/cpu%zd/cache/", SYSFS_SYSTEM_PATH, pos); =20 VIR_DIR_CLOSE(dirp); =20 diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index dd8e04576a..9cc098a025 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -1388,10 +1388,10 @@ virDomainCCWAddressAsString(virDomainDeviceCCWAddre= ssPtr addr) { char *addrstr =3D NULL; =20 - ignore_value(virAsprintf(&addrstr, "%x.%x.%04x", - addr->cssid, - addr->ssid, - addr->devno)); + virAsprintf(&addrstr, "%x.%x.%04x", + addr->cssid, + addr->ssid, + addr->devno); return addrstr; } =20 diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 2ae39e3698..98b80e5bec 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -53,7 +53,7 @@ virDomainAuditGetRdev(const char *path) (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode))) { int maj =3D major(sb.st_rdev); int min =3D minor(sb.st_rdev); - ignore_value(virAsprintfQuiet(&ret, "%02X:%02X", maj, min)); + virAsprintfQuiet(&ret, "%02X:%02X", maj, min); } return ret; } @@ -101,11 +101,8 @@ virDomainAuditGenericDev(virDomainObjPtr vm, if (!newsrcpath && !oldsrcpath) return; =20 - if (virAsprintfQuiet(&newdev, "new-%s", type) < 0) - goto no_memory; - - if (virAsprintfQuiet(&olddev, "old-%s", type) < 0) - goto no_memory; + virAsprintfQuiet(&newdev, "new-%s", type); + virAsprintfQuiet(&olddev, "old-%s", type); =20 virUUIDFormat(vm->def->uuid, uuidstr); =20 @@ -376,22 +373,15 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHo= stdevDefPtr hostdev, case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - if (virAsprintfQuiet(&address, - VIR_PCI_DEVICE_ADDRESS_FMT, - pcisrc->addr.domain, - pcisrc->addr.bus, - pcisrc->addr.slot, - pcisrc->addr.function) < 0) { - VIR_WARN("OOM while encoding audit message"); - goto cleanup; - } + virAsprintfQuiet(&address, + VIR_PCI_DEVICE_ADDRESS_FMT, + pcisrc->addr.domain, + pcisrc->addr.bus, + pcisrc->addr.slot, + pcisrc->addr.function); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: - if (virAsprintfQuiet(&address, "%.3d.%.3d", - usbsrc->bus, usbsrc->device) < 0) { - VIR_WARN("OOM while encoding audit message"); - goto cleanup; - } + virAsprintfQuiet(&address, "%.3d.%.3d", usbsrc->bus, usbsrc->d= evice); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { if (scsisrc->protocol =3D=3D @@ -403,13 +393,10 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHo= stdevDefPtr hostdev, } else { virDomainHostdevSubsysSCSIHostPtr scsihostsrc =3D &scsisrc->u.host; - if (virAsprintfQuiet(&address, "%s:%u:%u:%llu", - scsihostsrc->adapter, scsihostsrc->bu= s, - scsihostsrc->target, - scsihostsrc->unit) < 0) { - VIR_WARN("OOM while encoding audit message"); - goto cleanup; - } + virAsprintfQuiet(&address, "%s:%u:%u:%llu", + scsihostsrc->adapter, scsihostsrc->bus, + scsihostsrc->target, + scsihostsrc->unit); } break; } @@ -661,11 +648,8 @@ virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgrou= pPtr cgroup, { char *extra; =20 - if (virAsprintfQuiet(&extra, "major category=3D%s maj=3D%02X acl=3D%s", - name, maj, perms) < 0) { - VIR_WARN("OOM while encoding audit message"); - return; - } + virAsprintfQuiet(&extra, "major category=3D%s maj=3D%02X acl=3D%s", + name, maj, perms); =20 virDomainAuditCgroup(vm, cgroup, reason, extra, success); =20 @@ -699,13 +683,14 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgrou= pPtr cgroup, =20 rdev =3D virDomainAuditGetRdev(path); =20 - if (!(detail =3D virAuditEncode("path", path)) || - virAsprintfQuiet(&extra, "path %s rdev=3D%s acl=3D%s", - detail, VIR_AUDIT_STR(rdev), perms) < 0) { + if (!(detail =3D virAuditEncode("path", path))) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } =20 + virAsprintfQuiet(&extra, "path %s rdev=3D%s acl=3D%s", + detail, VIR_AUDIT_STR(rdev), perms); + virDomainAuditCgroup(vm, cgroup, reason, extra, rc =3D=3D 0); =20 cleanup: @@ -936,12 +921,13 @@ virDomainAuditShmem(virDomainObjPtr vm, =20 virUUIDFormat(vm->def->uuid, uuidstr); =20 - if (!vmname || - virAsprintfQuiet(&shmpath, "/dev/shm/%s", def->name) < 0) { + if (!vmname) { VIR_WARN("OOM while encoding audit message"); goto cleanup; } =20 + virAsprintfQuiet(&shmpath, "/dev/shm/%s", def->name); + if (!virt) { VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 80e19a15df..5674032b30 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4911,8 +4911,7 @@ virDomainPostParseCheckISCSIPath(char **srcpath) if (strchr(*srcpath, '/')) return 0; =20 - if (virAsprintf(&path, "%s/0", *srcpath) < 0) - return -1; + virAsprintf(&path, "%s/0", *srcpath); VIR_FREE(*srcpath); *srcpath =3D g_steal_pointer(&path); return 0; @@ -5573,8 +5572,7 @@ virDomainDefCollectBootOrder(virDomainDefPtr def G_GN= UC_UNUSED, */ return 0; } - if (virAsprintf(&order, "%u", info->bootIndex) < 0) - return -1; + virAsprintf(&order, "%u", info->bootIndex); =20 if (virHashLookup(bootHash, order)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -10122,9 +10120,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlo= pt, =20 if (!target && !(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { if (def->src->srcpool) { - if (virAsprintf(&tmp, "pool =3D '%s', volume =3D '%s'", - def->src->srcpool->pool, def->src->srcpool->volume) < 0) - goto error; + virAsprintf(&tmp, "pool =3D '%s', volume =3D '%s'", + def->src->srcpool->pool, def->src->srcpool->volume= ); =20 virReportError(VIR_ERR_NO_TARGET, "%s", tmp); VIR_FREE(tmp); @@ -10321,8 +10318,7 @@ virDomainParseScaledValue(const char *xpath, g_autofree char *bytes_str =3D NULL; =20 *val =3D 0; - if (virAsprintf(&xpath_full, "string(%s)", xpath) < 0) - return -1; + virAsprintf(&xpath_full, "string(%s)", xpath); =20 bytes_str =3D virXPathString(xpath_full, ctxt); if (!bytes_str) { @@ -10342,11 +10338,10 @@ virDomainParseScaledValue(const char *xpath, return -1; } =20 - if ((units_xpath && - virAsprintf(&xpath_full, "string(%s)", units_xpath) < 0) || - (!units_xpath && - virAsprintf(&xpath_full, "string(%s/@unit)", xpath) < 0)) - return -1; + if (units_xpath) + virAsprintf(&xpath_full, "string(%s)", units_xpath); + else + virAsprintf(&xpath_full, "string(%s/@unit)", xpath); unit =3D virXPathString(xpath_full, ctxt); =20 if (virScaleInteger(&bytes, unit, scale, max) < 0) @@ -19375,8 +19370,7 @@ virDomainResctrlMonDefParse(virDomainDefPtr def, if (!(tmp =3D virBitmapFormat(domresmon->vcpus))) goto cleanup; =20 - if (virAsprintf(&id, "vcpus_%s", tmp) < 0) - goto cleanup; + virAsprintf(&id, "vcpus_%s", tmp); } =20 virResctrlMonitorSetAlloc(domresmon->instance, resctrl->alloc); @@ -19426,8 +19420,7 @@ virDomainResctrlNew(xmlNodePtr node, * directory, so it's nice to have it named appropriately. For no= w it's * 'vcpus_...' but it's designed in order for it to be changeable = in the * future (it's part of the status XML). */ - if (virAsprintf(&alloc_id, "vcpus_%s", vcpus_str) < 0) - goto cleanup; + virAsprintf(&alloc_id, "vcpus_%s", vcpus_str); } =20 if (virResctrlAllocSetID(alloc, alloc_id) < 0) @@ -24028,10 +24021,8 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attr= Buf, virBufferAsprintf(attrBuf, " protocol=3D'%s'", virStorageNetProtocolTypeToString(src->protocol)); =20 - if (src->volume) { - if (virAsprintf(&path, "%s/%s", src->volume, src->path) < 0) - return -1; - } + if (src->volume) + virAsprintf(&path, "%s/%s", src->volume, src->path); =20 virBufferEscapeString(attrBuf, " name=3D'%s'", path ? path : src->path= ); =20 @@ -29198,7 +29189,7 @@ char { char *ret; =20 - ignore_value(virAsprintf(&ret, "%s/%s.xml", dir, name)); + virAsprintf(&ret, "%s/%s.xml", dir, name); return ret; } =20 @@ -30348,8 +30339,7 @@ virDomainDefGetShortName(const virDomainDef *def) len =3D mbstowcs(NULL, def->name, 0); if ((len =3D=3D (size_t) -1 && errno =3D=3D EILSEQ) || len =3D=3D strlen(def->name)) { - ignore_value(virAsprintf(&ret, "%d-%.*s", def->id, - VIR_DOMAIN_SHORT_NAME_MAX, def->name)); + virAsprintf(&ret, "%d-%.*s", def->id, VIR_DOMAIN_SHORT_NAME_MAX, d= ef->name); return ret; } =20 @@ -30385,7 +30375,7 @@ virDomainDefGetShortName(const virDomainDef *def) return NULL; } =20 - ignore_value(virAsprintf(&ret, "%d-%s", def->id, shortname)); + virAsprintf(&ret, "%d-%s", def->id, shortname); return ret; } =20 @@ -31191,10 +31181,8 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskD= efPtr def, } =20 /* iscsi pool has only one source device path */ - if (virAsprintf(&def->src->path, "%s/%s", - pooldef->source.devices[0].path, - tokens[3]) < 0) - goto cleanup; + virAsprintf(&def->src->path, "%s/%s", pooldef->source.devices[0].path, + tokens[3]); =20 /* Storage pool have not supported these 2 attributes yet, * use the defaults. diff --git a/src/conf/moment_conf.c b/src/conf/moment_conf.c index f54a44b33e..f11ba76dd4 100644 --- a/src/conf/moment_conf.c +++ b/src/conf/moment_conf.c @@ -77,9 +77,8 @@ virDomainMomentDefPostParse(virDomainMomentDefPtr def) =20 gettimeofday(&tv, NULL); =20 - if (!def->name && - virAsprintf(&def->name, "%lld", (long long)tv.tv_sec) < 0) - return -1; + if (!def->name) + virAsprintf(&def->name, "%lld", (long long)tv.tv_sec); =20 def->creationTime =3D tv.tv_sec; return 0; diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 7f8e43b25c..8d2bef439b 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2756,7 +2756,7 @@ virNetworkConfigFile(const char *dir, { char *ret =3D NULL; =20 - ignore_value(virAsprintf(&ret, "%s/%s.xml", dir, name)); + virAsprintf(&ret, "%s/%s.xml", dir, name); return ret; } =20 diff --git a/src/conf/node_device_util.c b/src/conf/node_device_util.c index 2728b8a510..6c7b73384f 100644 --- a/src/conf/node_device_util.c +++ b/src/conf/node_device_util.c @@ -182,8 +182,7 @@ virNodeDeviceDeleteVport(virConnectPtr conn, goto cleanup; } =20 - if (virAsprintf(&scsi_host_name, "scsi_%s", name) < 0) - goto cleanup; + virAsprintf(&scsi_host_name, "scsi_%s", name); =20 /* If at startup time we provided a parent, then use that to * get the parent_host value; otherwise, we have to determine diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index f9fbca3c07..2c53e9d764 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -618,10 +618,7 @@ virDomainSnapshotDefAssignExternalNames(virDomainSnaps= hotDefPtr def) if ((tmp =3D strrchr(tmppath, '.')) && !strchr(tmp, '/')) *tmp =3D '\0'; =20 - if (virAsprintf(&disk->src->path, "%s.%s", tmppath, def->parent.na= me) < 0) { - VIR_FREE(tmppath); - return -1; - } + virAsprintf(&disk->src->path, "%s.%s", tmppath, def->parent.name); =20 VIR_FREE(tmppath); =20 diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index f212eefe25..ec9db7edb0 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -953,11 +953,9 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) * path and permissions */ if (!(options->flags & VIR_STORAGE_POOL_SOURCE_NETWORK)) { if (def->type =3D=3D VIR_STORAGE_POOL_LOGICAL) { - if (virAsprintf(&target_path, "/dev/%s", def->source.name) < 0) - return NULL; + virAsprintf(&target_path, "/dev/%s", def->source.name); } else if (def->type =3D=3D VIR_STORAGE_POOL_ZFS) { - if (virAsprintf(&target_path, "/dev/zvol/%s", def->source.name= ) < 0) - return NULL; + virAsprintf(&target_path, "/dev/zvol/%s", def->source.name); } else { target_path =3D virXPathString("string(./target/path)", ctxt); if (!target_path) { diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 1d02a4ad66..204813c5fd 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -88,12 +88,10 @@ static char *virChrdevLockFilePath(const char *dev) ++p; } =20 - if (virAsprintf(&path, "%s/LCK..%s", VIR_CHRDEV_LOCK_FILE_PATH, filena= me) < 0) - goto cleanup; + virAsprintf(&path, "%s/LCK..%s", VIR_CHRDEV_LOCK_FILE_PATH, filename); =20 sanitizedPath =3D virFileSanitizePath(path); =20 - cleanup: VIR_FREE(path); VIR_FREE(devCopy); =20 @@ -135,8 +133,7 @@ static int virChrdevLockFileCreate(const char *dev) =20 /* ensure correct format according to filesystem hierarchy standard */ /* http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES */ - if (virAsprintf(&pidStr, "%10lld\n", (long long) getpid()) < 0) - goto cleanup; + virAsprintf(&pidStr, "%10lld\n", (long long)getpid()); =20 /* create the lock file */ if ((lockfd =3D open(path, O_WRONLY | O_CREAT | O_EXCL, 00644)) < 0) { diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index e7017bffa9..852c0a5e43 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -1627,7 +1627,7 @@ virNetworkObjGetPortStatusDir(virNetworkObjPtr net, const char *stateDir) { char *ret; - ignore_value(virAsprintf(&ret, "%s/%s/ports", stateDir, net->def->name= )); + virAsprintf(&ret, "%s/%s/ports", stateDir, net->def->name); return ret; } =20 @@ -1739,8 +1739,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net, if (!virStringStripSuffix(de->d_name, ".xml")) continue; =20 - if (virAsprintf(&file, "%s/%s.xml", dir, de->d_name) < 0) - goto cleanup; + virAsprintf(&file, "%s/%s.xml", dir, de->d_name); =20 if (unlink(file) < 0 && errno !=3D ENOENT) VIR_WARN("Unable to delete %s", file); @@ -1900,8 +1899,7 @@ virNetworkObjLoadAllPorts(virNetworkObjPtr net, if (!virStringStripSuffix(de->d_name, ".xml")) continue; =20 - if (virAsprintf(&file, "%s/%s.xml", dir, de->d_name) < 0) - goto cleanup; + virAsprintf(&file, "%s/%s.xml", dir, de->d_name); =20 portdef =3D virNetworkPortDefParseFile(file); VIR_FREE(file); diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c index 459384611c..09bd25a9ef 100644 --- a/src/conf/virnetworkportdef.c +++ b/src/conf/virnetworkportdef.c @@ -428,7 +428,7 @@ virNetworkPortDefConfigFile(const char *dir, { char *ret =3D NULL; =20 - ignore_value(virAsprintf(&ret, "%s/%s.xml", dir, name)); + virAsprintf(&ret, "%s/%s.xml", dir, name); return ret; } =20 diff --git a/src/conf/virnwfilterbindingobj.c b/src/conf/virnwfilterbinding= obj.c index 48d53fafb1..0066faadd8 100644 --- a/src/conf/virnwfilterbindingobj.c +++ b/src/conf/virnwfilterbindingobj.c @@ -142,7 +142,7 @@ virNWFilterBindingObjConfigFile(const char *dir, { char *ret; =20 - ignore_value(virAsprintf(&ret, "%s/%s.xml", dir, name)); + virAsprintf(&ret, "%s/%s.xml", dir, name); return ret; } =20 diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index a4fd330663..15c5f2624d 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -1229,8 +1229,7 @@ matchFCHostToSCSIHost(virStorageAdapterFCHostPtr fcho= st, */ if (!fchost->parent && (conn =3D virGetConnectNodeDev())) { - if (virAsprintf(&scsi_host_name, "scsi_%s", name) < 0) - goto cleanup; + virAsprintf(&scsi_host_name, "scsi_%s", name); if ((parent_name =3D virNodeDeviceGetParentName(conn, scsi_host_name))= ) { if (virStorageIsSameHostnum(parent_name, scsi_hostnum)) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list