From nobody Sun Feb 8 23:06:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566852329; cv=none; d=zoho.com; s=zohoarc; b=kp6hbawixhC6bOa3+KwHYhaVCrzFk62hMj4h4kf84hkw1VFgPHe8ZXLTbLn4FhratGm2d7x0VbwsJ1wxLOVlaloac0+LWvUppXyWOVsbRZFUnIBRtra0Yq1Si355kYX/gSlXwFlOrH8ruAj9c6iNZrKfak4N2HXwvBiOUxG3t74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852329; 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:ARC-Authentication-Results; bh=/5NRUwCeD4j8tWD+GPKO20WLnsgLJwTS5m79ZOiwihA=; b=aLmDOtU8iuwCWcANLn5yQcPAbIXrcMIjITx1Xb13jtSTOqhS65IlGkxQejn4yMHEFSBUL3p/LPfx1JBMPJwcQWBsKEqCx46+lWNVJi/xXHw08bVaiFZ9XhYj9vVn3lR2lXfDbvodiC56r1APshSpt/+ToyaBDMnfs0BcaFFWKTI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852329932229.03652505884565; Mon, 26 Aug 2019 13:45:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99E7410576DE; Mon, 26 Aug 2019 20:45:28 +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 71D895C22F; Mon, 26 Aug 2019 20:45:28 +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 2A8E9180BA9C; Mon, 26 Aug 2019 20:45:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjNRP020230 for ; Mon, 26 Aug 2019 16:45:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3E883783; Mon, 26 Aug 2019 20:45:23 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CD2860F86 for ; Mon, 26 Aug 2019 20:45:21 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:54 +0200 Message-Id: <2c28a914903a93614074db2403c2ad0a4ef91d43.1566852239.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] qemuBuildMemoryBackendProps: remove useless cleanup label 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 26 Aug 2019 20:45:29 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 43 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bd6beb0e52..262f4d0594 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3429,7 +3429,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, useHugepage =3D false; } else if (useHugepage && pagesize =3D=3D 0) { if (qemuBuildMemoryGetDefaultPagesize(cfg, &pagesize) < 0) - goto cleanup; + return -1; } =20 if (!(props =3D virJSONValueNewObject())) @@ -3441,70 +3441,70 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, if (useHugepage && (virJSONValueObjectAdd(props, "b:hugetlb", useHugepage, NULL) = < 0 || virJSONValueObjectAdd(props, "U:hugetlbsize", pagesize << 10,= NULL) < 0)) { - goto cleanup; + return -1; } =20 if (qemuBuildMemoryBackendPropsShare(props, memAccess) < 0) - goto cleanup; + return -1; =20 } else if (useHugepage || mem->nvdimmPath || memAccess || def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) { =20 if (mem->nvdimmPath) { if (VIR_STRDUP(memPath, mem->nvdimmPath) < 0) - goto cleanup; + return -1; if (!priv->memPrealloc) prealloc =3D true; } else if (useHugepage) { if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &memPath) <= 0) - goto cleanup; + return -1; if (!priv->memPrealloc) prealloc =3D true; } else { /* We can have both pagesize and mem source. If that's the cas= e, * prefer hugepages as those are more specific. */ if (qemuGetMemoryBackingPath(def, cfg, mem->info.alias, &memPa= th) < 0) - goto cleanup; + return -1; } =20 if (virJSONValueObjectAdd(props, "B:prealloc", prealloc, "s:mem-path", memPath, NULL) < 0) - goto cleanup; + return -1; =20 if (!mem->nvdimmPath && discard =3D=3D VIR_TRISTATE_BOOL_YES) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FI= LE_DISCARD)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this QEMU doesn't support memory discard= ")); - goto cleanup; + return -1; } =20 if (virJSONValueObjectAdd(props, "B:discard-data", true, NULL) < 0) - goto cleanup; + return -1; } =20 if (qemuBuildMemoryBackendPropsShare(props, memAccess) < 0) - goto cleanup; + return -1; } else { backendType =3D "memory-backend-ram"; } =20 if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0) - goto cleanup; + return -1; =20 if (mem->alignsize) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_A= LIGN)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("nvdimm align property is not available " "with this QEMU binary")); - goto cleanup; + return -1; } if (virJSONValueObjectAdd(props, "U:align", mem->alignsize * 1024,= NULL) < 0) - goto cleanup; + return -1; } =20 if (mem->nvdimmPmem) { @@ -3512,10 +3512,10 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("nvdimm pmem property is not available " "with this QEMU binary")); - goto cleanup; + return -1; } if (virJSONValueObjectAdd(props, "s:pmem", "on", NULL) < 0) - goto cleanup; + return -1; } =20 if (mem->sourceNodes) { @@ -3523,17 +3523,17 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, } else { if (virDomainNumatuneMaybeGetNodeset(def->numa, priv->autoNodeset, &nodemask, mem->targetNode) <= 0) - goto cleanup; + return -1; } =20 if (nodemask) { if (!virNumaNodesetIsAvailable(nodemask)) - goto cleanup; + return -1; if (virJSONValueObjectAdd(props, "m:host-nodes", nodemask, "S:policy", qemuNumaPolicyTypeToString(m= ode), NULL) < 0) - goto cleanup; + return -1; } =20 /* If none of the following is requested... */ @@ -3553,19 +3553,19 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-file object")); - goto cleanup; + return -1; } else if (STREQ(backendType, "memory-backend-ram") && !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY= _RAM)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-ram object")); - goto cleanup; + return -1; } else if (STREQ(backendType, "memory-backend-memory") && !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY= _MEMFD)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-memfd object")); - goto cleanup; + return -1; } =20 ret =3D 0; @@ -3575,7 +3575,6 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, &props))) ret =3D -1; =20 - cleanup: return ret; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list