From nobody Sun Feb 8 19:35:48 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=1571752735; cv=none; d=zoho.com; s=zohoarc; b=HVcz8BI3xLCATNFlmLUI6RfmAou6PhMHbbxc3yWENY2lE3wVbBJAip5kWPM0kAcsXHFNXzcaZGW5CJed697txtg6K5z4N1vLXRoGLKXZ/3QxbPuOvoMvNt/AHe5w7cBvjFvv2yMDME5O1gxgTd2pL8g+A/Z+vig+Ea6PbWeKK+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752735; 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=ScFue3VBVi1YN23YUpbap+T0zFv0mb3EBIAFMj2UHIk=; b=TbgcBVF286CrIPrmBN/p+kUiDw1/hGQjHcbcFaqD5dOAD75rQJrwkEzwzraWw+ByGnRimUPzqNUgZvxbCeU38I0l6L4zfzzWOz3gMT+G8VQV11wCQxcxnGVrLPYfU2x4s9QFl0+PBsMnAXU4AtmaYPBJIhURpY9Hv/pZauwIc/k= 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 1571752735180909.6554299580057; Tue, 22 Oct 2019 06:58:55 -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-204-I-B0l3xbOByD8_95iBdOHg-1; Tue, 22 Oct 2019 09:58:52 -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 892A25F5; Tue, 22 Oct 2019 13:58:47 +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 5F1A2194BB; Tue, 22 Oct 2019 13:58:47 +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 1B109180BA9B; Tue, 22 Oct 2019 13:58:47 +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 x9MDwhT2001676 for ; Tue, 22 Oct 2019 09:58:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 940966012C; Tue, 22 Oct 2019 13:58:43 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BFD060161 for ; Tue, 22 Oct 2019 13:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752734; 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=ScFue3VBVi1YN23YUpbap+T0zFv0mb3EBIAFMj2UHIk=; b=eh8y+slRpXYQeL0G314LTT5YUUq/ET/6MG6aMZBznKrMZcDc3LIthOFhTe6IFJz3IZcuWx 1QHW/pqwLQu8wSbkAW5zxMbZvTF1GilAMDtwNEjYamq+6jS2YwO+m83WyZa2foRkATXGmJ WliyWkzrEMSNghEPw/2mTQ6SxDoNNVE= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:21 +0200 Message-Id: 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 17/75] openvz: 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.84 on 10.5.11.23 X-MC-Unique: I-B0l3xbOByD8_95iBdOHg-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/openvz/openvz_conf.c | 18 ++++++------------ src/openvz/openvz_driver.c | 7 +++---- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 4646308c48..cb64ed57f0 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -362,8 +362,7 @@ openvzReadFSConf(virDomainDefPtr def, if (VIR_ALLOC(fs) < 0) goto error; =20 - if (virAsprintf(&veid_str, "%d", veid) < 0) - goto error; + virAsprintf(&veid_str, "%d", veid); =20 fs->type =3D VIR_DOMAIN_FS_TYPE_MOUNT; if (!(fs->src->path =3D virStringReplace(temp, "$VEID", veid_str))) @@ -534,8 +533,7 @@ int openvzLoadDomains(struct openvz_driver *driver) def->id =3D -1; else def->id =3D veid; - if (virAsprintf(&def->name, "%i", veid) < 0) - goto cleanup; + virAsprintf(&def->name, "%i", veid); =20 openvzGetVPSUUID(veid, uuidstr, sizeof(uuidstr)); ret =3D virUUIDParse(uuidstr, def->uuid); @@ -626,8 +624,7 @@ openvzWriteConfigParam(const char * conf_file, const ch= ar *param, const char *va char *line =3D NULL; size_t line_size =3D 0; =20 - if (virAsprintf(&temp_file, "%s.tmp", conf_file)<0) - return -1; + virAsprintf(&temp_file, "%s.tmp", conf_file); =20 fp =3D fopen(conf_file, "r"); if (fp =3D=3D NULL) @@ -823,9 +820,8 @@ openvzCopyDefaultConfig(int vpsid) if (confdir =3D=3D NULL) goto cleanup; =20 - if (virAsprintf(&default_conf_file, "%s/ve-%s.conf-sample", confdir, - configfile_value) < 0) - goto cleanup; + virAsprintf(&default_conf_file, "%s/ve-%s.conf-sample", confdir, + configfile_value); =20 if (openvzLocateConfFile(vpsid, &conf_file, "conf") < 0) goto cleanup; @@ -855,9 +851,7 @@ openvzLocateConfFileDefault(int vpsid, char **conffile,= const char *ext) if (confdir =3D=3D NULL) return -1; =20 - if (virAsprintf(conffile, "%s/%d.%s", confdir, vpsid, - ext ? ext : "conf") < 0) - ret =3D -1; + virAsprintf(conffile, "%s/%d.%s", confdir, vpsid, ext ? ext : "conf"); =20 VIR_FREE(confdir); return ret; diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 017eec3081..463751ec86 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -702,7 +702,7 @@ openvzGenerateVethName(int veid, char *dev_name_ve) =20 if (sscanf(dev_name_ve, "%*[^0-9]%d", &ifNo) !=3D 1) return NULL; - ignore_value(virAsprintf(&ret, "veth%d.%d.", veid, ifNo)); + virAsprintf(&ret, "veth%d.%d.", veid, ifNo); return ret; } =20 @@ -729,7 +729,7 @@ openvzGenerateContainerVethName(int veid) } =20 /* set new name */ - ignore_value(virAsprintf(&name, "eth%d", max + 1)); + virAsprintf(&name, "eth%d", max + 1); } =20 VIR_FREE(temp); @@ -2207,8 +2207,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, } } =20 - if (virAsprintf(uri_out, "ssh://%s", hostname) < 0) - goto error; + virAsprintf(uri_out, "ssh://%s", hostname); =20 ret =3D 0; goto done; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list