From nobody Mon Feb 9 02:12:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1605001930; cv=none; d=zohomail.com; s=zohoarc; b=NL03mDZspZLYGoYiuuvHKsVGacLc8M6d9g6jADysR3Uh+OxlZzFFllpGHpDRgZlJNn7RvK2ruyhegKVMw7+wYmFdzkPK+Uk2WWahcTmJ6AwDPfVPNvtWnxByIZ30dm2MGfCBCgJqhjeyQO2bvJdpgJnyvbcCO9esgMe3TzJJiIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001930; h=Content-Type:Content-Transfer-Encoding:Cc: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=On4QOEnL8BzqYR7eS3pxuLxJyRQCR7ea5zrjqDeoDZw=; b=n8cA9cfiDTOCiTnKgcTyx7QyEA76yj5kpUXDl91/RyE2knYIAKnb91HXG/Thfq0C3EvPU6MfBzctHnOpbh4RtJbRR16CZQs4LDiLKDI4B1Qrx9e2Os5DTyzrF4LG6E2pdBxIMoqeEGc4a6GU+TugORhRXqO8LuJ0xFxomzkVVUY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1605001930294940.4715514834985; Tue, 10 Nov 2020 01:52:10 -0800 (PST) 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-576-94r6NUJoPiuddl2BRrlaqQ-1; Tue, 10 Nov 2020 04:52:06 -0500 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 E07D88030A8; Tue, 10 Nov 2020 09:52:00 +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 B660D2634B; Tue, 10 Nov 2020 09:52:00 +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 816D8181A07C; Tue, 10 Nov 2020 09:52:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pxFb006701 for ; Tue, 10 Nov 2020 04:51:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 89342200E206; Tue, 10 Nov 2020 09:51:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A12A205F386 for ; Tue, 10 Nov 2020 09:51:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D316F1021F87 for ; Tue, 10 Nov 2020 09:51:56 +0000 (UTC) Received: from de-smtp-delivery-52.mimecast.com (de-smtp-delivery-52.mimecast.com [51.163.158.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577--wP_TMMLOEuDZDcgIa2E1Q-1; Tue, 10 Nov 2020 04:51:54 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2112.outbound.protection.outlook.com [104.47.17.112]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-E2cZUTNjMMeoJEmSk5Dkbw-7; Tue, 10 Nov 2020 10:51:51 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7928.eurprd04.prod.outlook.com (2603:10a6:20b:2af::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Tue, 10 Nov 2020 09:51:48 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::8945:92d8:e72a:6245]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::8945:92d8:e72a:6245%6]) with mapi id 15.20.3541.025; Tue, 10 Nov 2020 09:51:48 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM4P190CA0015.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Tue, 10 Nov 2020 09:51:46 +0000 X-MC-Unique: 94r6NUJoPiuddl2BRrlaqQ-1 X-MC-Unique: -wP_TMMLOEuDZDcgIa2E1Q-1 X-MC-Unique: E2cZUTNjMMeoJEmSk5Dkbw-7 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/13] virsh: Add signal name completion to send-process-signal command Date: Tue, 10 Nov 2020 17:51:02 +0800 Message-ID: <20201110095104.10783-12-lma@suse.com> In-Reply-To: <20201110095104.10783-1-lma@suse.com> References: <20201110095104.10783-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM4P190CA0015.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::25) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e878d3b-280b-44dc-3ea9-08d8855e3da2 X-MS-TrafficTypeDiagnostic: AS8PR04MB7928: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: YbqCuYwNpa/+L9T8TCmGzRS3kZposMBfzIynq7/EaArcbKV/6+lG0jOV4f5L5vMEWkJB2k4kGySL3cfazYbEgBJf+fhSa9NUmNWjqS83ee54tV59wx9g6+E/2lSUDuEOgijOA0NHShoEJ/76UNRTffZkj9D8ssx/YtonKEfJzos7Ueyaa43ZU8ozFHAB4J0CDT/msURPERVcsX1pHlh1M4KLICzpLFlHsxrSzH9YZFygj3CoyQZAoCSWCPpfh2WTimqvZh3H4DIagnKRsQedyhENjeLpjk6aNKnnzplcH8AT5kdLClwCI+s8K5Jdd8xS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(396003)(376002)(366004)(39860400002)(6916009)(66476007)(66556008)(316002)(66946007)(107886003)(52116002)(86362001)(450100002)(8676002)(5660300002)(8936002)(1076003)(6666004)(4326008)(2616005)(55236004)(956004)(478600001)(16526019)(186003)(26005)(6506007)(36756003)(2906002)(6486002)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: Im74pzPj7oP763dzgyP0Q4O621YTb8EDmb8/YpjFB5k+zb9OYqkg27aQaLzaJnxD6LqRH7UL4ZspCYLSmM+uJkSnw7fn8zCW/CKC0k+bZY+/0J7RxocHbco+JTl49hVaeG1EJPIUXNIWAfkKND94SD441lKBg2H/FbRXOtNNkFcgiun+C6m2CejAVAWAD0J2UJE3+3BTmtwuLCxPchMeioShgz6UoS7AsVI4ss2UqBA5AznbwNZ5qDul8vqE9nHUiGTefFtvEJAbaWcbQkNJuPnZPXyssPELIDO1hVV9O2gv4HPWmO5OFkoby1o4Mq6cztknH6szyfr9jACn8anzP6o040Qn1TUihJ7Kz43RWwMdYdDyWrdl+kHj21aV4ie4SozMPyQrehfK+xCtkrsIHCitrl/pAlxbwIZhjfc43cdBG+5gD7PNDMIIgKYY75OE6cAVGU9OX4Zbg2np/L5Pl9277T6SXknnwTp8/RiuFvkSJZTv7F8cSDy3ZJOfxAGIOD9yYb6Z2tdBIDFU5AXIZ4KBABtD8sGpeni657+wS9NqLAQJYjsqRN2Mu6J8V9ClFDdqC8unxdz+aUTUnWUC1uRSiVebnAOOfmW8d+h4ZsiixlmnYnDgxllusegK/7r/pYUj/3tCfHV3tdI/JADR+JDnv4x4YkSVkPAKPNidU046FkYGmxB32eEnGInae0uwLmSCr5sNSTSnnIdxmhgnXinJfBMTUBlW4+8+5NgYINSNa0vZAaLsUWQ2TouSzkB9VgbH9W2Odcvd1zX5KkhMRodm5vRQCYdo4JjD+DuRN5MBUdmslFJEL1iJbxBOWn8maS83mchLwNSRUBRXBQMaKQddkfupzDA2LbCpK+Q+TaN8Gcq/0d2N5rh7mvG6EEqkdREuCoAu5qu08tTozHbG/w== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e878d3b-280b-44dc-3ea9-08d8855e3da2 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2020 09:51:48.3956 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BQs34qNQo9BbSigluI0btW3IG/Pwck6FwAELXU/kLCzKD9a0B7P2pdswnm+I8AN/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7928 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 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pxFb006701 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-completer-domain.c | 20 ++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++++ tools/virsh-domain.c | 1 + 3 files changed, 25 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index dc66317561..b8b6c74f8b 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -711,3 +711,23 @@ virshDomainConsoleCompleter(vshControl *ctl, =20 return g_steal_pointer(&tmp); } + +char ** +virshDomainSignalCompleter(vshControl *ctl G_GNUC_UNUSED, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + size_t i =3D 0; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + tmp =3D g_new0(char *, VIR_DOMAIN_PROCESS_SIGNAL_LAST + 1); + + for (i =3D 0; i < VIR_DOMAIN_PROCESS_SIGNAL_LAST; i++) { + const char *name =3D virDomainProcessSignalTypeToString(i); + tmp[i] =3D g_strdup(name); + } + + return g_steal_pointer(&tmp); +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 02fea2fe94..cdec66f23e 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -98,3 +98,7 @@ char ** virshDomainVcpulistViaAgentCompleter(vshControl *= ctl, char ** virshDomainConsoleCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainSignalCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 472b510a6b..1406bb4583 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8905,6 +8905,7 @@ static const vshCmdOptDef opts_send_process_signal[] = =3D { {.name =3D "signame", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainSignalCompleter, .help =3D N_("the signal number or name") }, {.name =3D NULL} --=20 2.26.0