From nobody Mon Feb 9 00:06: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-delivery-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=1571752771; cv=none; d=zoho.com; s=zohoarc; b=jpGcKW3ZlQVgxAXZffjJqUnaphV6dCJY1i4QYx85Z67LLrfecG3H1/dbfSQbu1wrqf1BDyLjNV1JxHgmDFjMwVmDmPmhkCNoJ6UiEcK2DosKMvrlrVwsSFXPjA+AzWz20PK75p/b9tSYedR3pOzIP5vNqKgd6ATYsnZMONunuZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752771; 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=z3cqFSBUSdCvsBFzJ9CGpdHr/UurnSmdE2RVTLiScL8=; b=aJH2u9Yc53x1t6cgM4TocLirIDYlTrsdgfZm0aMnTqPvBe5x/7AGdNNGiv7PpdnlJLXvYL8JCdXJcB5z3oUrgIZylKuxpeK9FL5JqLKSQFbNRKWAcPe7NbjwMTSrI3K+o4ZEUHgTT+vyh+tlLNV9277kktbvxZJ6B6CLPPX/cXo= 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571752771636907.4966775572427; Tue, 22 Oct 2019 06:59:31 -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-156-Y4izShtzOXaXENtLjiSi2A-1; Tue, 22 Oct 2019 09:59:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C36ED1800D6A; Tue, 22 Oct 2019 13:59:23 +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 863636CE66; Tue, 22 Oct 2019 13:59:23 +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 441E0180BAAB; Tue, 22 Oct 2019 13:59:23 +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 x9MDxMmB002024 for ; Tue, 22 Oct 2019 09:59:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id A58386012D; Tue, 22 Oct 2019 13:59:22 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DA416012C for ; Tue, 22 Oct 2019 13:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752770; 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=z3cqFSBUSdCvsBFzJ9CGpdHr/UurnSmdE2RVTLiScL8=; b=fGXiIIt2KcLvoFE5O0pdrpM/yuft74j7CEMfFSmIP/CUX4oCRtpoHOTEb+xP1CpdDJ52j7 z2EEaXSyC8SqMwayjbMMUqlTC+hdmJbZ6O4YHDVEZEipGTSaTnhexqcN157gAxRqWdywnk acBNHOQFNvG5nhVjDyJcgOhqAgtxqi0= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:32 +0200 Message-Id: <6a557f3300724eb1e3e30d7b2445f086f8e4fcea.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 28/75] vmware: 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.12 X-MC-Unique: Y4izShtzOXaXENtLjiSi2A-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/vmware/vmware_conf.c | 31 +++++++++---------------------- src/vmware/vmware_conf.h | 4 ++-- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 8707f842ad..1e836ec7ed 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -275,18 +275,15 @@ vmwareExtractVersion(struct vmware_driver *driver) =20 switch (driver->type) { case VMWARE_DRIVER_PLAYER: - if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer") < 0) - goto cleanup; + virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer"); break; =20 case VMWARE_DRIVER_WORKSTATION: - if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware") < 0) - goto cleanup; + virAsprintf(&bin, "%s/%s", vmwarePath, "vmware"); break; =20 case VMWARE_DRIVER_FUSION: - if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware-vmx") < 0) - goto cleanup; + virAsprintf(&bin, "%s/%s", vmwarePath, "vmware-vmx"); break; =20 default: @@ -365,19 +362,13 @@ vmwareParsePath(const char *path, char **directory, c= har **filename) return -1; } =20 -int +void vmwareConstructVmxPath(char *directoryName, char *name, char **vmxPath) { - int ret; - if (directoryName !=3D NULL) - ret =3D virAsprintf(vmxPath, "%s/%s.vmx", directoryName, name); + virAsprintf(vmxPath, "%s/%s.vmx", directoryName, name); else - ret =3D virAsprintf(vmxPath, "%s.vmx", name); - - if (ret < 0) - return -1; - return 0; + virAsprintf(vmxPath, "%s.vmx", name); } =20 int @@ -437,8 +428,7 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath) goto cleanup; } =20 - if (vmwareConstructVmxPath(directoryName, vmdef->name, vmxPath) < 0) - goto cleanup; + vmwareConstructVmxPath(directoryName, vmdef->name, vmxPath); =20 ret =3D 0; =20 @@ -477,8 +467,7 @@ vmwareMoveFile(char *srcFile, char *dstFile) int vmwareMakePath(char *srcDir, char *srcName, char *srcExt, char **outpath) { - if (virAsprintf(outpath, "%s/%s.%s", srcDir, srcName, srcExt) < 0) - return -1; + virAsprintf(outpath, "%s/%s.%s", srcDir, srcName, srcExt); return 0; } =20 @@ -495,9 +484,7 @@ vmwareExtractPid(const char * vmxPath) if ((vmxDir =3D mdir_name(vmxPath)) =3D=3D NULL) goto cleanup; =20 - if (virAsprintf(&logFilePath, "%s/vmware.log", - vmxDir) < 0) - goto cleanup; + virAsprintf(&logFilePath, "%s/vmware.log", vmxDir); =20 if ((logFile =3D fopen(logFilePath, "r")) =3D=3D NULL) goto cleanup; diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h index deeed22300..5e0ef3744f 100644 --- a/src/vmware/vmware_conf.h +++ b/src/vmware/vmware_conf.h @@ -71,8 +71,8 @@ int vmwareParseVersionStr(int type, const char *buf, unsi= gned long *version); =20 int vmwareDomainConfigDisplay(vmwareDomainPtr domain, virDomainDefPtr vmde= f); =20 -int vmwareConstructVmxPath(char *directoryName, char *name, - char **vmxPath); +void vmwareConstructVmxPath(char *directoryName, char *name, + char **vmxPath); =20 int vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list