From nobody Sat Jul 12 09:57:51 2025 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1530671532499574.2896435550289; Tue, 3 Jul 2018 19:32:12 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id DC316356C0; Wed, 4 Jul 2018 02:32:10 +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 8DAA660BE4; Wed, 4 Jul 2018 02:32:10 +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 254EA18037F0; Wed, 4 Jul 2018 02:32:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w642W7n6014415 for ; Tue, 3 Jul 2018 22:32:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id C63991001643; Wed, 4 Jul 2018 02:32:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAE2B1001642 for ; Wed, 4 Jul 2018 02:32:04 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 454D330001DE for ; Wed, 4 Jul 2018 02:31:53 +0000 (UTC) Received: by mail-qk0-f171.google.com with SMTP id t79-v6so2145741qke.4 for ; Tue, 03 Jul 2018 19:31:53 -0700 (PDT) Received: from localhost.localdomain ([186.212.94.231]) by smtp.gmail.com with ESMTPSA id b62-v6sm2033363qkj.48.2018.07.03.19.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 19:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IAcITLrQZ5HqdgFz+nxxhhZULEeHWu/R2sWhaYYGnPg=; b=FxgonVoSLmFxgzAO5mkwKOa6dt22BzMrFyAmYAwd4JGxITeJ+OPPEIph2Xww6ZJg7O zs0BVr0hOcm6SlZdUXxEKPiHmRL0s4ljoyu/yWCsIbn+fr5m46PtywmHY80pIRehQABU wYdKCGq57ZPzvjtrae1FYTU6FelukSRCO00nxEyjnYEO60LzW47rhm9+hVdbSIBDLvTJ 7WmHl3R6dJXydn7u1Ho/hNKKTsywGZkGd+lKAW75mOILvlO70Ry+xQ0WLT119xtESFFk 9UdZfjzX155zI3COJmLI9lIgFRYTHaSchFlJEDBDU3bOL65SlqNImV0z9c/Z5iZoZ95U ycaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IAcITLrQZ5HqdgFz+nxxhhZULEeHWu/R2sWhaYYGnPg=; b=jH2KitiYs2+731+wVnvVDtA3zHBjonR8oRZDSIp3r59aUtkc9aKnEwrx3MOkPpBtnH G4eLe8wPB3lH1rzihQrsxH1yX5HhEyM6MUQX6SmByKp2TF+4cK4QJDnoPei+QJst63/P NJwMYbYZAZjG1RFW8UMgfBlrlhhiXXfbBlQ7HRHTcaqLWTf9mrhKyJyyFlrY8aTee7Wh jHSKDWw3+aAKWv3lNSFWXGQrObw025prqCsYa0rNnYrHTTAbSbqfHD5OxIEUVAjd51of CDTZImWEvwZef+Bz8yO+USYR83sMvwwACmsjHgQdazvLlBZeMDPHmUlTFPxDIwah/E7g T0/A== X-Gm-Message-State: APt69E2oUgMRmSS1mxnkLhYKOGBRlCjWRueExKKyVIwNl4N0s3zfdbWK 35FSepNexmqU0u65JitDvNPQmg== X-Google-Smtp-Source: AAOMgpdTFGpy0Xz5t3qh2rvGrCB1usVTbMN3WegS4FHyEaHNf8/z1+krtMalAAx+QOxMdbKITONGkw== X-Received: by 2002:a37:c44d:: with SMTP id h13-v6mr122574qkm.422.1530671512104; Tue, 03 Jul 2018 19:31:52 -0700 (PDT) From: Marcos Paulo de Souza To: libvir-list@redhat.com Date: Tue, 3 Jul 2018 23:31:22 -0300 Message-Id: <20180704023123.8271-2-marcos.souza.org@gmail.com> In-Reply-To: <20180704023123.8271-1-marcos.souza.org@gmail.com> References: <20180704023123.8271-1-marcos.souza.org@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 04 Jul 2018 02:31:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 04 Jul 2018 02:31:53 +0000 (UTC) for IP:'209.85.220.171' DOMAIN:'mail-qk0-f171.google.com' HELO:'mail-qk0-f171.google.com' FROM:'marcos.souza.org@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.3 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.220.171 mail-qk0-f171.google.com 209.85.220.171 mail-qk0-f171.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Marcos Paulo de Souza Subject: [libvirt] [PATCH -v2 1/2] esx_util.h: Add ESX_VI_CHECK_ARG_LIST macro 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 04 Jul 2018 02:32:11 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This macro avoids code duplication when checking for arrays of objects. Signed-off-by: Marcos Paulo de Souza --- Changes from v1: * Change VIR_ERR_INVALID_ARG to VIR_ERR_INTERNAL_ERROR (Michal) * Change esxVI_checkArgList to ESX_VI_CHECK_ARG_LIST (Matthias) src/esx/esx_util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h index c6f14bb2d9..63602bf3cb 100644 --- a/src/esx/esx_util.h +++ b/src/esx/esx_util.h @@ -26,6 +26,14 @@ # include "internal.h" # include "viruri.h" =20 +#define ESX_VI_CHECK_ARG_LIST(val) \ + do { \ + if (!val || *val) { \ + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argume= nt")); \ + return -1; \ + } \ + } while (0) + typedef struct _esxUtil_ParsedUri esxUtil_ParsedUri; =20 struct _esxUtil_ParsedUri { --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list