From nobody Fri May 3 01:38:44 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1560867908; cv=none; d=zoho.com; s=zohoarc; b=Tn8irT4twCI+aErmHwaLxTzBsuMWTMpEcl2uXdTfiOBRoE3ksdgpvL9S9KVBek7dHSdDdLV80rYr8DH+WsoH4p455RUUGMnjJxjLsoayrnG/Vz29RbwdV2udFDqrn8K6+z/Uaz3I1mEznuIg/yatFNQipFkk6KITVnTpanCXf4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560867908; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=JOYPZ+rqLNaPIltCFLZJe7hcM4OFvallUsccEe6UpU0=; b=Qg9SAmhIkIBpgHpLmX82Pa0E/WgFhTnQGoWt4K2RtiQDGPsdWyhaELX6ajbFzrlvsb0ummf7WS8DeHbsFl2z9o7cocbFmwOTZcmRypXoXKrJKrLMEjavclulEZeN9a5M2Uj0A9DqUfyzIMkfldWD3A4yhuPDOfVsVCeYgJdTTts= ARC-Authentication-Results: i=1; mx.zoho.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 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 1560867908713367.1800875127552; Tue, 18 Jun 2019 07:25:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79D20307D860; Tue, 18 Jun 2019 14:24:41 +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 03FA6608A7; Tue, 18 Jun 2019 14:24:33 +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 A41DF1833002; Tue, 18 Jun 2019 14:24:29 +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 x5IEMJ1g001382 for ; Tue, 18 Jun 2019 10:22:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD7DB101E661; Tue, 18 Jun 2019 14:22:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B655E1019613 for ; Tue, 18 Jun 2019 14:22:16 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (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 6757D85543 for ; Tue, 18 Jun 2019 14:22:02 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id s49so22073319edb.1 for ; Tue, 18 Jun 2019 07:22:02 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id p22sm2138857ejm.38.2019.06.18.07.21.59 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 07:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xDR6ZxD36wkKQ+DWZHhTUEekPMlKbKTFc8gW3qi1SIY=; b=H1HwmWNXX79Etcb7598aHBoJ9B4wHLTv830/BYas9DeBcBoeQh1ybG9LCaLt2UDalg 4EYcdBBq6S7BV6Am1PpCAwRGnVDqsdCBoO3ZM1mvy/Ldc83DpeZPtoQZbWiq6ji1ILNJ 9O1FVze2wd5uhffEefbv5zfg+BviB6M/QmKF8h76xjFh5+UievkqKQRfUI5xQ6SYQKmH S28l6dASyn0VlbPA+4cDVT5IQ6NzV//I6fDgbk6NqHeSj7BYMZYZXRpdNXxLciSYvLw8 s47vzt9vFq4jq+ktJGJHR/4iUtJ/RbRJGAsC45BqyRz6e6tmCgb1dMqlzuixCrXq3yRR Dn1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xDR6ZxD36wkKQ+DWZHhTUEekPMlKbKTFc8gW3qi1SIY=; b=GTf3B+zsImp7uVFeSQIi9hLEKMUWOlWPREVvFvZRnmScQ5y/F3etqU6lcRCntAZK4F j7zBfeLKaUhqAtB/1f2dody0Ai/t/gbMz7GQpY+o6YGmS+OFWx2H63NIERstHuHLh2Ga 68OnfDZVbRm3hDlmB9zqOZTO2pBJrV80HROfTUI1YvZL092sjasEyPwElcBAWAxx5PCx sWMRGef99dFiSuLPaTgxI23F5L0Ldu/RmVYziuMu71fB+hRxTtgUcsyq0hmRd9w/SF0s sUetODWY7KkCXEJXiuR1Yc8HZ5xmvPYUp0QfuFYwbZS9eocvVva7TphPzNnSgqrh1Z2f zBZw== X-Gm-Message-State: APjAAAUkRpodkqYGAAeztuFXh1VWzSqqrbpBQ5d4B49RuF2y7IBbsv0+ Uqk5WdS8+m29N/oe1fyojiLvV+jugLvv1g== X-Google-Smtp-Source: APXvYqx0zucMsavxjp6ZTJMbbB8SDBfQqgrjccVO5DOEyY63IzVdSL2++EJCV1AIcWe1qcX0hrkXTw== X-Received: by 2002:a50:8465:: with SMTP id 92mr49847431edp.151.1560867720701; Tue, 18 Jun 2019 07:22:00 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 16:21:57 +0200 Message-Id: <20190618142157.19689-1-stamatis.iliass@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 18 Jun 2019 14:22:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 18 Jun 2019 14:22:02 +0000 (UTC) for IP:'209.85.208.66' DOMAIN:'mail-ed1-f66.google.com' HELO:'mail-ed1-f66.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.108 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_NONE) 209.85.208.66 mail-ed1-f66.google.com 209.85.208.66 mail-ed1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virNetworkGetDHCPLeases: fix docstring format 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 18 Jun 2019 14:25:07 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The docstring of virNetworkGetDHCPLeases is not correctly formatted and as a result the example code snippet appears as normal text under the "Returns:" section. This patch fixes the problem. Signed-off-by: Ilias Stamatis --- src/libvirt-network.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/libvirt-network.c b/src/libvirt-network.c index 6ed32c8ba2..2d7a68eaa1 100644 --- a/src/libvirt-network.c +++ b/src/libvirt-network.c @@ -1156,8 +1156,7 @@ virConnectNetworkEventDeregisterAny(virConnectPtr con= n, * lease info about a specific guest interface with @mac. There can be * multiple leases for a single @mac because this API supports DHCPv6 too. * - * Returns the number of leases found or -1 and sets @leases to NULL in - * case of error. On success, the array stored into @leases is guaranteed = to + * On success, the array stored into @leases is guaranteed to * have an extra allocated element set to NULL but not included in the ret= urn * count, to make iteration easier. The caller is responsible for calling * virNetworkDHCPLeaseFree() on each array element, then calling free() on= @leases. @@ -1167,30 +1166,33 @@ virConnectNetworkEventDeregisterAny(virConnectPtr c= onn, * * Example of usage: * - * virNetworkDHCPLeasePtr *leases =3D NULL; - * virNetworkPtr network =3D ... obtain a network pointer here ...; - * size_t i; - * int nleases; - * unsigned int flags =3D 0; + * virNetworkDHCPLeasePtr *leases =3D NULL; + * virNetworkPtr network =3D ... obtain a network pointer here ...; + * size_t i; + * int nleases; + * unsigned int flags =3D 0; + * + * nleases =3D virNetworkGetDHCPLeases(network, NULL, &leases, flags); + * if (nleases < 0) + * error(); * - * nleases =3D virNetworkGetDHCPLeases(network, NULL, &leases, flags); - * if (nleases < 0) - * error(); + * ... do something with returned values, for example: * - * ... do something with returned values, for example: + * for (i =3D 0; i < nleases; i++) { + * virNetworkDHCPLeasePtr lease =3D leases[i]; * - * for (i =3D 0; i < nleases; i++) { - * virNetworkDHCPLeasePtr lease =3D leases[i]; + * printf("Time(epoch): %lu, MAC address: %s, " + * "IP address: %s, Hostname: %s, ClientID: %s\n", + * lease->expirytime, lease->mac, lease->ipaddr, + * lease->hostname, lease->clientid); * - * printf("Time(epoch): %lu, MAC address: %s, " - * "IP address: %s, Hostname: %s, ClientID: %s\n", - * lease->expirytime, lease->mac, lease->ipaddr, - * lease->hostname, lease->clientid); + * virNetworkDHCPLeaseFree(leases[i]); + * } * - * virNetworkDHCPLeaseFree(leases[i]); - * } + * free(leases); * - * free(leases); + * Returns the number of leases found or -1 and sets @leases to NULL in + * case of error. * */ int -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list