From nobody Thu Apr 25 10:26:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1669082407; cv=none; d=zohomail.com; s=zohoarc; b=Yyup9LWFn1xwIk9vTl+ncl+cbtCnEhjfxYI9DW0Z82IjPUbIi6D5oSG22+mR0MO6c0ryp9j/xi/9QYG4JBcn7IexH5xkjRduiwIoJNyUU4hbENjyihaPJECs27eXeLh1J3lcnYey+0QIThZYmpS1fYg5mrW+pqo7f6jYFhtPL+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669082407; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=gqsPr5mpp6ubeIRWiTVO4H/oCua4CxTuGkHamfgK7/E=; b=Si0npYrPjgyeSpJSHXbCs+3EzTV5hEwoEicb8AGdreXnjirkOxiZBngma+IGVY4EpmDImm7l50EHD2QPqW3UTs0Lr+TTBXSyZq2zst+GHi771wNfODVFwEg85GCkUnvu6lLwQnettsE7wti1qC9Jjl1x+o6LXmCmUNghVhkEfzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1669082407307911.4245308717789; Mon, 21 Nov 2022 18:00:07 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-356-cW8xZOU6Owi5zgZvayIfpQ-1; Mon, 21 Nov 2022 20:59:58 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C738A811E87; Tue, 22 Nov 2022 01:59:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D3D71415121; Tue, 22 Nov 2022 01:59:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 18E3C194658C; Tue, 22 Nov 2022 01:59:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 67E151946588 for ; Tue, 22 Nov 2022 01:59:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2AF5E492B18; Tue, 22 Nov 2022 01:59:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 239DE492B16 for ; Tue, 22 Nov 2022 01:59:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0483E1C05AB3 for ; Tue, 22 Nov 2022 01:59:52 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-211-6D6mNdgXMISYflbPt-DDPQ-1; Mon, 21 Nov 2022 20:59:49 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NGS6R4DyqzFqZg for ; Tue, 22 Nov 2022 09:56:31 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 09:59:45 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669082406; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gqsPr5mpp6ubeIRWiTVO4H/oCua4CxTuGkHamfgK7/E=; b=fNxyIrwskl7mg2TRPNkvDj+5cGExNQcCMlTh/7AeQKjhBQEwReh4awEKOBD9XsasmPvd+X VoedsysyV9g5re8gyE35uucDRdfqpWJuRbtiZUu/500RGS9s7O1EfFiF/Mvp5Tak/XLoUZ JHI8aHqJ1PeKc5K2nd8Bk80FetJVnl4= X-MC-Unique: cW8xZOU6Owi5zgZvayIfpQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 6D6mNdgXMISYflbPt-DDPQ-1 From: Jiang Jiacheng To: Subject: [PATCH v2] coding-style: Use the same style in the 'struct option' Date: Tue, 22 Nov 2022 09:50:01 +0800 Message-ID: <20221122015001.2303883-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669082407753100001 Content-Type: text/plain; charset="utf-8" Use same style in the 'struct option' as: struct option opt[] =3D { { a, b }, { a, b }, ... { a, b }, }; diff to v1: * use the same style in all the 'struct option' Signed-off-by: Jiang Jiacheng Reviewed-by: Michal Privoznik --- examples/c/domain/domtop.c | 10 +++++----- examples/c/domain/suspend.c | 10 +++++----- src/locking/lock_daemon.c | 12 ++++++------ src/logging/log_daemon.c | 12 ++++++------ src/remote/remote_daemon.c | 14 +++++++------- src/security/virt-aa-helper.c | 22 +++++++++++----------- tools/virsh.c | 24 ++++++++++++------------ tools/virt-admin.c | 14 +++++++------- tools/virt-host-validate.c | 8 ++++---- tools/virt-login-shell-helper.c | 6 +++--- tools/virt-pki-query-dn.c | 6 +++--- 11 files changed, 69 insertions(+), 69 deletions(-) diff --git a/examples/c/domain/domtop.c b/examples/c/domain/domtop.c index 5228445b7c..dd35ec8661 100644 --- a/examples/c/domain/domtop.c +++ b/examples/c/domain/domtop.c @@ -86,11 +86,11 @@ parse_argv(int argc, char *argv[], unsigned long val; char *p; struct option opt[] =3D { - {"debug", no_argument, NULL, 'd'}, - {"help", no_argument, NULL, 'h'}, - {"connect", required_argument, NULL, 'c'}, - {"delay", required_argument, NULL, 'D'}, - {NULL, 0, NULL, 0} + { "debug", no_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "connect", required_argument, NULL, 'c' }, + { "delay", required_argument, NULL, 'D' }, + { NULL, 0, NULL, 0 }, }; =20 while ((arg =3D getopt_long(argc, argv, "+:dhc:D:", opt, NULL)) !=3D -= 1) { diff --git a/examples/c/domain/suspend.c b/examples/c/domain/suspend.c index 3ff24f6861..6e0bbd5597 100644 --- a/examples/c/domain/suspend.c +++ b/examples/c/domain/suspend.c @@ -76,11 +76,11 @@ parse_argv(int argc, char *argv[], unsigned long val; char *p; struct option opt[] =3D { - {"debug", no_argument, NULL, 'd'}, - {"help", no_argument, NULL, 'h'}, - {"connect", required_argument, NULL, 'c'}, - {"seconds", required_argument, NULL, 's'}, - {NULL, 0, NULL, 0} + { "debug", no_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "connect", required_argument, NULL, 'c' }, + { "seconds", required_argument, NULL, 's' }, + { NULL, 0, NULL, 0 }, }; =20 while ((arg =3D getopt_long(argc, argv, "+:dhc:s:", opt, NULL)) !=3D -= 1) { diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index c997d327c4..5eed6b7c26 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -809,14 +809,14 @@ int main(int argc, char **argv) { int rv; =20 struct option opts[] =3D { - { "verbose", no_argument, &verbose, 'v'}, - { "daemon", no_argument, &godaemon, 'd'}, - { "config", required_argument, NULL, 'f'}, - { "timeout", required_argument, NULL, 't'}, - { "pid-file", required_argument, NULL, 'p'}, + { "verbose", no_argument, &verbose, 'v' }, + { "daemon", no_argument, &godaemon, 'd' }, + { "config", required_argument, NULL, 'f' }, + { "timeout", required_argument, NULL, 't' }, + { "pid-file", required_argument, NULL, 'p' }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, - {0, 0, 0, 0} + { 0, 0, 0, 0 }, }; =20 privileged =3D geteuid() =3D=3D 0; diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 00fc4148fd..9b70ffad2f 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -613,14 +613,14 @@ int main(int argc, char **argv) { int rv; =20 struct option opts[] =3D { - { "verbose", no_argument, &verbose, 'v'}, - { "daemon", no_argument, &godaemon, 'd'}, - { "config", required_argument, NULL, 'f'}, - { "timeout", required_argument, NULL, 't'}, - { "pid-file", required_argument, NULL, 'p'}, + { "verbose", no_argument, &verbose, 'v' }, + { "daemon", no_argument, &godaemon, 'd' }, + { "config", required_argument, NULL, 'f' }, + { "timeout", required_argument, NULL, 't' }, + { "pid-file", required_argument, NULL, 'p' }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, - {0, 0, 0, 0} + { 0, 0, 0, 0 }, }; =20 privileged =3D geteuid() =3D=3D 0; diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index f369d09d35..dd9344168b 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -807,17 +807,17 @@ int main(int argc, char **argv) { mode_t old_umask; =20 struct option opts[] =3D { - { "verbose", no_argument, &verbose, 'v'}, - { "daemon", no_argument, &godaemon, 'd'}, + { "verbose", no_argument, &verbose, 'v' }, + { "daemon", no_argument, &godaemon, 'd' }, #if defined(WITH_IP) && defined(LIBVIRTD) - { "listen", no_argument, &ipsock, 'l'}, + { "listen", no_argument, &ipsock, 'l' }, #endif /* !(WITH_IP && LIBVIRTD) */ - { "config", required_argument, NULL, 'f'}, - { "timeout", required_argument, NULL, 't'}, - { "pid-file", required_argument, NULL, 'p'}, + { "config", required_argument, NULL, 'f' }, + { "timeout", required_argument, NULL, 't' }, + { "pid-file", required_argument, NULL, 'p' }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, - {0, 0, 0, 0} + { 0, 0, 0, 0 }, }; =20 if (virGettextInitialize() < 0 || diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index a15971b9bb..53a1cd1048 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1337,17 +1337,17 @@ vahParseArgv(vahControl * ctl, int argc, char **arg= v) { int arg, idx =3D 0; struct option opt[] =3D { - {"add", 0, 0, 'a'}, - {"create", 0, 0, 'c'}, - {"dryrun", 0, 0, 'd'}, - {"delete", 0, 0, 'D'}, - {"add-file", 0, 0, 'f'}, - {"append-file", 0, 0, 'F'}, - {"help", 0, 0, 'h'}, - {"replace", 0, 0, 'r'}, - {"remove", 0, 0, 'R'}, - {"uuid", 1, 0, 'u'}, - {0, 0, 0, 0} + { "add", 0, 0, 'a' }, + { "create", 0, 0, 'c' }, + { "dryrun", 0, 0, 'd' }, + { "delete", 0, 0, 'D' }, + { "add-file", 0, 0, 'f' }, + { "append-file", 0, 0, 'F' }, + { "help", 0, 0, 'h' }, + { "replace", 0, 0, 'r' }, + { "remove", 0, 0, 'R' }, + { "uuid", 1, 0, 'u' }, + { 0, 0, 0, 0 }, }; =20 while ((arg =3D getopt_long(argc, argv, "acdDhrRH:b:u:p:f:F:", opt, diff --git a/tools/virsh.c b/tools/virsh.c index b37d2ce12f..5696941550 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -638,18 +638,18 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) int longindex =3D -1; virshControl *priv =3D ctl->privData; struct option opt[] =3D { - {"connect", required_argument, NULL, 'c'}, - {"debug", required_argument, NULL, 'd'}, - {"escape", required_argument, NULL, 'e'}, - {"help", no_argument, NULL, 'h'}, - {"keepalive-interval", required_argument, NULL, 'k'}, - {"keepalive-count", required_argument, NULL, 'K'}, - {"log", required_argument, NULL, 'l'}, - {"quiet", no_argument, NULL, 'q'}, - {"readonly", no_argument, NULL, 'r'}, - {"timing", no_argument, NULL, 't'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "connect", required_argument, NULL, 'c' }, + { "debug", required_argument, NULL, 'd' }, + { "escape", required_argument, NULL, 'e' }, + { "help", no_argument, NULL, 'h' }, + { "keepalive-interval", required_argument, NULL, 'k' }, + { "keepalive-count", required_argument, NULL, 'K' }, + { "log", required_argument, NULL, 'l' }, + { "quiet", no_argument, NULL, 'q' }, + { "readonly", no_argument, NULL, 'r' }, + { "timing", no_argument, NULL, 't' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; =20 /* Standard (non-command) options. The leading + ensures that no diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 11ba242742..85b010b95f 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1318,13 +1318,13 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **a= rgv) size_t i; int longindex =3D -1; struct option opt[] =3D { - {"connect", required_argument, NULL, 'c'}, - {"debug", required_argument, NULL, 'd'}, - {"help", no_argument, NULL, 'h'}, - {"log", required_argument, NULL, 'l'}, - {"quiet", no_argument, NULL, 'q'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "connect", required_argument, NULL, 'c' }, + { "debug", required_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "log", required_argument, NULL, 'l' }, + { "quiet", no_argument, NULL, 'q' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; =20 /* Standard (non-command) options. The leading + ensures that no diff --git a/tools/virt-host-validate.c b/tools/virt-host-validate.c index 4dae97910a..52ca729f85 100644 --- a/tools/virt-host-validate.c +++ b/tools/virt-host-validate.c @@ -73,10 +73,10 @@ show_version(FILE *out, const char *argv0) } =20 static const struct option argOptions[] =3D { - { "help", 0, NULL, 'h', }, - { "version", 0, NULL, 'v', }, - { "quiet", 0, NULL, 'q', }, - { NULL, 0, NULL, '\0', } + { "help", 0, NULL, 'h' }, + { "version", 0, NULL, 'v' }, + { "quiet", 0, NULL, 'q' }, + { NULL, 0, NULL, '\0' }, }; =20 int diff --git a/tools/virt-login-shell-helper.c b/tools/virt-login-shell-helpe= r.c index 3f8757e496..8feeb8f0fe 100644 --- a/tools/virt-login-shell-helper.c +++ b/tools/virt-login-shell-helper.c @@ -179,9 +179,9 @@ main(int argc, char **argv) bool autoshell =3D false; =20 struct option opt[] =3D { - {"help", no_argument, NULL, 'h'}, - {"version", optional_argument, NULL, 'V'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", optional_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 }, }; if (virInitialize() < 0) { fprintf(stderr, _("Failed to initialize libvirt error handling")); diff --git a/tools/virt-pki-query-dn.c b/tools/virt-pki-query-dn.c index ee3783c1b2..2d7849feb7 100644 --- a/tools/virt-pki-query-dn.c +++ b/tools/virt-pki-query-dn.c @@ -61,9 +61,9 @@ main(int argc, int rv =3D 0; =20 struct option opt[] =3D { - {"help", no_argument, NULL, 'h'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; =20 if (virGettextInitialize() < 0) --=20 2.33.0