From nobody Mon Feb 9 01:16:33 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=1604305659; cv=none; d=zohomail.com; s=zohoarc; b=LRC98cUiuEzKOJkazVRtB5Qb9lG/Jvpe1F3JL8cJZ5bLCmF8HZ5WSoK2z1Hqr43PkYbgH3tm+AhaTIEKfGRSu4pCeSXRVBPLQB91bCroXaVuSZV7xd5iuZkWUUXkn7fTKWOWdGvr5Rz+gAEEyjEKSi2+SXUW8YC5GpG9v4aJTGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305659; 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=VkFTm8GTbbRCUVE4t/FmklN8lLdgYqWvJtLflfvrr4A=; b=L56lj06DSFLXfp/764Bla6gOzBNBrxTF0vHMOtePypyb7x9lShClBGNv2KiprayPt1Biuhu5jZ3Wdu6wGJnMdErTz07R/9dbZpMrr2wPWn4jZLHvwDSCxRQ9Gi93q/WnHCbNheFEbT0qo1lainv1G8w9ryQwu7Sa6/V3xaYdA4A= 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 1604305659208221.7759567028611; Mon, 2 Nov 2020 00:27:39 -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-62-hXdYiV50Mpaa6dQ41Yec-A-1; Mon, 02 Nov 2020 03:27:35 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 020BF1006CB0; Mon, 2 Nov 2020 08:27:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0CE3672CF; Mon, 2 Nov 2020 08:27:29 +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 9BDF58C7CB; Mon, 2 Nov 2020 08:27:29 +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 0A28RRFi031421 for ; Mon, 2 Nov 2020 03:27:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8FDAD205F389; Mon, 2 Nov 2020 08:27:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89DC62086F64 for ; Mon, 2 Nov 2020 08:27:24 +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 50B2A185A79C for ; Mon, 2 Nov 2020 08:27:24 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-RONwkDh2NgGCr_gGKopJtQ-1; Mon, 02 Nov 2020 03:27:22 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-e0CETeGtOX24hn8iuwdQNg-5; Mon, 02 Nov 2020 09:27:18 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:14 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:14 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:12 +0000 X-MC-Unique: hXdYiV50Mpaa6dQ41Yec-A-1 X-MC-Unique: RONwkDh2NgGCr_gGKopJtQ-1 X-MC-Unique: e0CETeGtOX24hn8iuwdQNg-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/19] virsh: Add signal name completion to send-process-signal command Date: Mon, 2 Nov 2020 16:26:19 +0800 Message-ID: <20201102082621.13228-18-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) 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: 9f23769f-feec-4fcb-0e74-08d87f091a0f X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: 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: iFE8VBLiLF5K/e5VnEg5ABjhfLRZVWiI49seZAjFpCpU+zHUVakmIhT5XTsI2HWW1ku4+yGRk5a/jrdn07xnnVFuKqacoUNbfM+lQH/rxcPm2fHRHhlpaYQR67ouGk6wsOWhYd0Ef42AaOspvw2rAYYk/FPq/xg1gq0pQACrQqFNqP+aF7sfqG3jULKMU3N8iDZGpzKgXcfSbu6y5gEc8g8SjPs6laF0NounsJ0/neckVOwqHnEflcxaDIHKj4lfw52yDg25JSo0jmJu1i2QmIkVqDuJuhINNvzjBQ/lLIec2eUOBJYhnZw2OsF6kFNV 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:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(5660300002)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: /IJhzG4zsvbFqYgciZMfE/H7FZNi6tM+1l/6znea1GK/M0rBwkJmrgl+wiC1nYYScKq3dQluD53kjGTf3LkGqbE5wp5NLalmBOZ+I3ehpyeozBVZJp2YkVGG19ElJpKU4JVa3TjhJkTf1N1h+a/9V2n+Dkm22tcLPkCFi0rz0CNkuQnFjINjvxtyOBviTI6/JeOt0XteU31Y2mNMem2gMsbzEbtKBD0LrBAh/t4kAHUMLRsm52loguWReJ32XfweeU5hrFgehh9eUScarc2y1Siah67t5gouI4yhWN6WSf9Ch6EEEndKntQv1bXxx+TqvENkUwA434vzgSDM86MeJFyh4PsVK8jWDxljOujByKeRKSlYFU7nCVc6Z30nNc5wgfSBuXpvV+ZrksT5ZKobea7gYwmqXl6BFsNoaenS1WHuBnfqR6VjX/IHEw7vZ/twVOPpP0kzV547z3B7qps7k7eV1Sefn7TK+oiaz+JfhIq1+W7iSKbvEv3QGcckdLRXXO90JUaKvybABe/yDD7Vdj1KTWikpX6241rsCTMNRzAY5yKXaUSF6xtXUHDh+7WoCL5PbVZyyKQ6BJXSE9c0z1q6niURgnkeEE8wOgbRG7R/oGkNSAeRQir3rW7mEAuKWpFcWXuXNUHB0Kju6NySRw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f23769f-feec-4fcb-0e74-08d87f091a0f X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:14.5860 (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: Y05zaE6xzpqtN7uUEtU/bKVnyMWGjmPHmnaadVaRQTCav/BwramC6FNsMzKOsMP3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 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 0A28RRFi031421 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.79 on 10.5.11.12 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 305711151f..c1151764ff 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -672,3 +672,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 65bbb6c646..f69fbe41a5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8895,6 +8895,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