From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001911; cv=none; d=zohomail.com; s=zohoarc; b=iNpbPrFO/zI5WeStXe2nlX7kcx8bkJKY/k7823u5swyS7PIpblc779bhgi98LY8urnCk9sOxnTcN3cYDTCADWJCSOTBaAb59sxPpY0gpRM5NdtTpChU/gQ+j+N5EppJxjqwDLr5wNGLPz1+Jrzb2UJuijypB8DOLq3NREGrNoas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001911; 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=Iy4nG+sdHxcgKDJVoP3uHZIJLTI+A4fQX/OtSKfu9fE=; b=V1oshdnEtBBZens/bzUDus9vH5jPXRBp5bepaRrAsOxDhAA6GhFk2m4Yshf6DlWGO38MwPL995WLtq47U+3nz2XjbN4M3kCN3pxWzfscLPAqZ1M9oPYvz1E8WJMJh0owPK6RotBMKPOE5njIkgm6SXC4ElCR9V/PrL8H4k7mZ64= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001911795189.88176124865095; Tue, 10 Nov 2020 01:51:51 -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-367-HW3fEwvaMyuFq0KZo49pGg-1; Tue, 10 Nov 2020 04:51:47 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A2631006CA2; Tue, 10 Nov 2020 09:51:42 +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 47AD810013DB; Tue, 10 Nov 2020 09:51:41 +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 B44A918095FF; Tue, 10 Nov 2020 09:51:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pcMH006566 for ; Tue, 10 Nov 2020 04:51:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id C4B0D94585; Tue, 10 Nov 2020 09:51:38 +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 BD8BF946A0 for ; Tue, 10 Nov 2020 09:51:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 61D271021F89 for ; Tue, 10 Nov 2020 09:51:36 +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-476-5RPVs6FtMTimqwWwYHBEtg-1; Tue, 10 Nov 2020 04:51:32 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2055.outbound.protection.outlook.com [104.47.13.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-kql-9m4TM3KUddZjPpcnAA-3; Tue, 10 Nov 2020 10:51:29 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7734.eurprd04.prod.outlook.com (2603:10a6:20b:2a6::8) 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:27 +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:27 +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:25 +0000 X-MC-Unique: HW3fEwvaMyuFq0KZo49pGg-1 X-MC-Unique: 5RPVs6FtMTimqwWwYHBEtg-1 X-MC-Unique: kql-9m4TM3KUddZjPpcnAA-3 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/13] virsh: Add vcpu list completion to guestvcpus command Date: Tue, 10 Nov 2020 17:50:52 +0800 Message-ID: <20201110095104.10783-2-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: 190873e6-2c85-4496-60f1-08d8855e30f3 X-MS-TrafficTypeDiagnostic: AS8PR04MB7734: 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:4125 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 2STMKbhyrg9LDmcS4J2Cz9ERvpP24QTffWNl1Z9kYukygiXFL7W2lpAtWUd6uoJTJJBvU7lL7FS9vXLpW8fkHwjTLhn2mFKlsSOSMEF/63wK4FtzpFakD0Dj5sggImadzEgUxMRatKMVf84Fu2AYhJBGBcd/Bu2fpKT7+9RH3YrUL7ou1xVji4DW/TYNBaZXztWaTAjMBKyteAs1jgYdZFKdpZnS+gOspww/30zk0G9v96lF6CtyU1cOYPMrCvuI9JwCcbKxKP0T2EghJOrgP9wcAzCnaTGcV+leMI/EZaYLsmkxVAOeJmrMXVz8m6Wa 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:(396003)(39860400002)(346002)(366004)(376002)(136003)(8936002)(2906002)(8676002)(66556008)(6666004)(2616005)(52116002)(107886003)(55236004)(6506007)(956004)(83380400001)(4326008)(6512007)(86362001)(36756003)(5660300002)(316002)(1076003)(66476007)(66946007)(478600001)(450100002)(16526019)(6916009)(26005)(186003)(6486002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: rZdhMYVs0pRTzGcxvfJfA1Ujc7bHCHYocXPWWigscDhXlGM1XCUcT4JxaXzDYBVNA4Jt4AXmhI7u+jO/DTq6K3M2go6pUBTFL9JtSRlMx6xUbHPEtQ5UEh9tCxLI84RUqG2XpB4OoXLUm5kGYRsypi51lXT5GtDOQMq1Z8O0Iz7mDBw3mn4qRQNDjuBkwMNzSeoQcLDk9EDTDeDsoq/EXJI4z5Waf1zmDCkg9Gg0Az3DQ+tTquVTCBcDvu82CRSVfLZxcw0zvKg9xKsDns0AHxkxF7wFLIcwBr1+z+BJSxROyuBE7u+OMf0tLpUIya8gnKTVu5y+fMnztkWiJJb41TyA+/qkTVxgysei02kW/k8c1CSx+pzyfAVnFYvw7SvLQP6CjR2zkqqV6sNMLjaYtUNSwZABtC7dRNMNDDpt1WuJQIfYRXhGKTaQ1PH1pEBrhDbQBElec+OzKGVDzz3DyjcIav+OdFT2RCLdo4r139SRNW98/YSu+X1xGVLI5UFUz5PM1gOVn+99fBA48Y9GwIkui+cCzGMBgPIJSqCKBxZU0PQjdy3stc1HDtfCFjLRNtDZ1UycTPik+DmnJ0TCpnFMrCPn+b6A01wtLyG0zx/ifrRGicGFzIpVzP4nGoBi870tUs9OidC7Ch0LOEEcbDzg9j8a0n91PhczHHrU6ewzSCOJF7bn24yq0X3bJVb4q6Ea5Vr8HaAVr4PleYj/3v1srT0bPPadBG5tEfQTmdAwSqX5BEaM6RvkAB6EfXq0UTD/GizHWJd5SIQtd/G94dSBf6HUO7ck/nzbF9tOlCa5bZPFcudIrjIwAFJ2lbJzN6A9mdgOua8WxS5NFyEaWaZsZhf/+KBxAek6THt99e6Mt+GUaarfZHb3FmuXaMNDKt7OO/j5lQOcchnax53Cmw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 190873e6-2c85-4496-60f1-08d8855e30f3 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:27.1539 (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: nIb1dyKRJv6cYN4ob3mOc6UcPROFjOnLVm4qr2xfvAhknRROfw4bGHKZ1KwD6kUE X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7734 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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pcMH006566 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.22 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 Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 75 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++ tools/virsh-domain.c | 1 + 3 files changed, 80 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index c657627ac1..f653471b89 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -30,6 +30,7 @@ #include "virstring.h" #include "virxml.h" #include "virperf.h" +#include "virbitmap.h" =20 char ** virshDomainNameCompleter(vshControl *ctl, @@ -581,3 +582,77 @@ virshDomainCpulistCompleter(vshControl *ctl, =20 return virshCommaStringListComplete(cpuid, (const char **)cpulist); } + +char ** +virshDomainVcpulistViaAgentCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virDomainPtr dom; + bool enable =3D vshCommandOptBool(cmd, "enable"); + bool disable =3D vshCommandOptBool(cmd, "disable"); + virTypedParameterPtr params =3D NULL; + unsigned int nparams =3D 0; + int dummy; + size_t i; + size_t offset =3D 0; + int nvcpus; + VIR_AUTOSTRINGLIST cpulist =3D NULL; + g_autoptr(virBitmap) vcpus =3D NULL; + g_autofree unsigned char *vcpumap =3D NULL; + g_autofree char *onlineVcpuStr =3D NULL; + const char *vcpuid =3D NULL; + char **ret =3D NULL; + + virCheckFlags(0, NULL); + + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) + return NULL; + + if (vshCommandOptStringQuiet(ctl, cmd, "cpulist", &vcpuid) < 0) + goto cleanup; + + /* retrieve vcpu count from the guest instead of the hypervisor */ + if ((nvcpus =3D virDomainGetVcpusFlags(dom, VIR_DOMAIN_VCPU_GUEST | + VIR_DOMAIN_VCPU_MAXIMUM)) < 0) + goto cleanup; + + if (!enable && !disable) { + cpulist =3D g_new0(char *, nvcpus + 1); + for (i =3D 0; i < nvcpus; i++) + cpulist[i] =3D g_strdup_printf("%zu", i); + } else { + if (virDomainGetGuestVcpus(dom, ¶ms, &nparams, 0) < 0) + goto cleanup; + onlineVcpuStr =3D vshGetTypedParamValue(ctl, ¶ms[1]); + if (virBitmapParse(onlineVcpuStr, &vcpus, nvcpus) < 0) + goto cleanup; + + if (virBitmapToData(vcpus, &vcpumap, &dummy) < 0) + goto cleanup; + if (enable) { + cpulist =3D g_new0(char *, nvcpus - virBitmapCountBits(vcpus) = + 1); + for (i =3D 0; i < nvcpus; i++) { + if (VIR_CPU_USED(vcpumap, i) !=3D 0) + continue; + + cpulist[offset++] =3D g_strdup_printf("%zu", i); + } + } else if (disable) { + cpulist =3D g_new0(char *, virBitmapCountBits(vcpus) + 1); + for (i =3D 0; i < nvcpus; i++) { + if (VIR_CPU_USED(vcpumap, i) =3D=3D 0) + continue; + + cpulist[offset++] =3D g_strdup_printf("%zu", i); + } + } + } + + ret =3D virshCommaStringListComplete(vcpuid, (const char **)cpulist); + + cleanup: + virTypedParamsFree(params, nparams); + virshDomainFree(dom); + return ret; +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index d38efd5ea8..d5021f6aa6 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -90,3 +90,7 @@ char ** virshDomainVcpulistCompleter(vshControl *ctl, char ** virshDomainCpulistCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainVcpulistViaAgentCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1ae936c6b2..675d96440d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7436,6 +7436,7 @@ static const vshCmdOptDef opts_guestvcpus[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "cpulist", .type =3D VSH_OT_STRING, + .completer =3D virshDomainVcpulistViaAgentCompleter, .help =3D N_("list of cpus to enable or disable") }, {.name =3D "enable", --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001921; cv=none; d=zohomail.com; s=zohoarc; b=C/aPQ9punuvjPqIr5oE+Kw3Sk6DY9PsXxcTM4cohdxUIVB7AUo+Qc5ZcvEqmRxVbVv2YMCO+zQcuENN2GgCQY5sKdwHNhU3fDYgD7C4GQ8xWDrp13qQ2ryg1khQhQ8sW+yVmVG1oNSuLMB8eL4DZ3+k3KuXXazV4gqk38F/7Qvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001921; 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=mdLtNJYaozG32ggm4jKva9Tv1c0INsjG0+qampaLNvY=; b=l2ObKOZt2XKcOTffayql7txoFbImwgNg7ewckQGQDyRWcomNo4lU17VKbNqMYIGmsHk0j9OOHYqzVX0NwjB7fRnNEHC3Z8bRVbY/tspx81XEXPBWkCm6muER7Qce5e3UH2UwLeZvh5pCxnU7hnuN4R7nAhAFBmBaemK5JLXswvg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001921064746.7638758165684; Tue, 10 Nov 2020 01:52:01 -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-505-V3a7zGTSN4CYJVGFcFRowQ-1; Tue, 10 Nov 2020 04:51:57 -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 DAAE7107B472; Tue, 10 Nov 2020 09:51:51 +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 B664F5CC26; Tue, 10 Nov 2020 09:51:51 +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 83C1758116; Tue, 10 Nov 2020 09:51:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pbFE006559 for ; Tue, 10 Nov 2020 04:51:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7E8AE2156A49; Tue, 10 Nov 2020 09:51:37 +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 7828F2156A3A for ; Tue, 10 Nov 2020 09:51:37 +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 5F8421021F8C for ; Tue, 10 Nov 2020 09:51:37 +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-465-CNqiOMyZPlCvYo6IpNtrig-1; Tue, 10 Nov 2020 04:51:34 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2055.outbound.protection.outlook.com [104.47.13.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-KOarS7KuMayAW7da8doU_A-5; Tue, 10 Nov 2020 10:51:31 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7734.eurprd04.prod.outlook.com (2603:10a6:20b:2a6::8) 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:29 +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:29 +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:27 +0000 X-MC-Unique: V3a7zGTSN4CYJVGFcFRowQ-1 X-MC-Unique: CNqiOMyZPlCvYo6IpNtrig-1 X-MC-Unique: KOarS7KuMayAW7da8doU_A-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 02/13] virsh: Add logical CPU IDs completion for nodecpustats command Date: Tue, 10 Nov 2020 17:50:53 +0800 Message-ID: <20201110095104.10783-3-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: 497580e0-841d-4a7b-8705-08d8855e322d X-MS-TrafficTypeDiagnostic: AS8PR04MB7734: 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:1013 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 6I/Rwp/JTZo31rZqqLwb3ruQ/lTqoDfQbevBwomPK/pcG/xEJ3Hp7uo0uWYQ7tSqYxdOTmgL5FujDwGe1KBkZBWkdVKtH8EhgIACnA+2Q9V3budGjPX7OoD9Lh4YFgIH8egbHHPt/mvIVhs9F/LNZw9H0ebAz6s0Pp/t7J0XGm4gHR2cAcQLwFQoIOJUmn7ydZFpFBgGfi1tXeRav/nhpYsMzLQyzAkT/5oRtebjxk18HPkmitpj7N8xKDB9cP3qCvskkV9YcpP+tklvcN00GUmCamiNAerKy43yJD9YZ64AjclZ0qMK7yemZ60d2iRZDZNzKVJBgLhPl36jJ/UUlg== 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:(396003)(39860400002)(346002)(366004)(376002)(136003)(8936002)(2906002)(8676002)(66556008)(6666004)(2616005)(52116002)(107886003)(55236004)(6506007)(956004)(83380400001)(4326008)(6512007)(86362001)(36756003)(5660300002)(316002)(1076003)(66476007)(66946007)(478600001)(450100002)(16526019)(6916009)(26005)(186003)(6486002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: oeZv6kwfVpcE0h7qTIPvplg4OMC4K3JDzdDcx2XO42YL7Qv8iQhdWsX9rRepZZ0cRGFogfbmxa8lJiQOw2/DiCeV91ivWwxiFJd2Cpxbc43yh1OibfBGeGXXDfEJSooRLVFBM4fDx3NAo+MJDUVzXG5+pYQzPF7lxFVq3nSl6ybsHKN7kEAjw7UDXM3LcVeNlT2pa2DURToDzk+P2oTBgyvBR2z2JF9/dINFGc8/bhhhfWydYARsph0UFYAvpZMyo9Ie0llgJetCqYdT0vz0Zu3G6y47R1PMk5UlqFLDpxVNKFirbC5njuULeCZ6OM0hozxFhvnFiU212Swu4bqMe4KgrHSkjUoGZseJ/+66BJT7NaLIDQmGCVpJP9Uhrgg5ff/zZgVmLgRVe/x2OVosgW4Ab8dcjVFK8538t5Ywuaxk5pWxINeIO+qzBGN1r/sbXq0MSydtN6ll5t4alPnPhHef5p61ozMbmIbcaf10I0ZaiWtd+Wb0WF0g2wJepce3K1tzj0kD1Jsx00YQMz3R/u0LycogDWrZp0OnA6sBpCQHjJMPfm+vkB+1Jgq2mP8n9kj9TzlTzNPumX9BQvsXFqlXBCpkmShPpILrTXVdAcTMWkXzomBdpViJ2izo02YCyXvNRNBKWe5Yk3aue1Am/xsDdtnTU6MebfgqikKE+Phlb2vxNhEcjXBzyNoiVkQu/ZBDwMRQIHpXymwzfHaUwUJ7Gv/bQNHPZPa42i1bS8LOJROs/KLXfrIWcaaQMdC7HAIZb2kjZRLsePv/De94cX9WkBNP5i4s9F60EQD4+sYmyHF2XF92AHfjMdUNfda/iXojpYFquY1mpXpvX8YkDV/GP8JTnDQL04wShz+ADcs6S2NJc3Fs51eTpkbYhJWC5JNqn3saE8Mb+1XnUdepmA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 497580e0-841d-4a7b-8705-08d8855e322d 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:29.2347 (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: dw6mIPULQaLBFpJOwAufBdSfCbrBJnmssbaW9I6fhx1IHCxmiBC6RO209yeWBCw6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7734 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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pbFE006559 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 Reviewed-by: Michal Privoznik --- tools/virsh-completer-host.c | 31 +++++++++++++++++++++++++++++++ tools/virsh-completer-host.h | 4 ++++ tools/virsh-host.c | 1 + 3 files changed, 36 insertions(+) diff --git a/tools/virsh-completer-host.c b/tools/virsh-completer-host.c index 339390aa00..685fa23fd4 100644 --- a/tools/virsh-completer-host.c +++ b/tools/virsh-completer-host.c @@ -136,3 +136,34 @@ virshCellnoCompleter(vshControl *ctl, =20 return g_steal_pointer(&tmp); } + + +char ** +virshCpuCompleter(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + virshControlPtr priv =3D ctl->privData; + VIR_AUTOSTRINGLIST tmp =3D NULL; + size_t i; + int cpunum; + size_t offset =3D 0; + unsigned int online; + g_autofree unsigned char *cpumap =3D NULL; + + virCheckFlags(0, NULL); + + if ((cpunum =3D virNodeGetCPUMap(priv->conn, &cpumap, &online, 0)) < 0) + return NULL; + + tmp =3D g_new0(char *, online + 1); + + for (i =3D 0; i < cpunum; i++) { + if (VIR_CPU_USED(cpumap, i) =3D=3D 0) + continue; + + tmp[offset++] =3D g_strdup_printf("%zu", i); + } + + return g_steal_pointer(&tmp); +} diff --git a/tools/virsh-completer-host.h b/tools/virsh-completer-host.h index 921beb7a2d..777783b908 100644 --- a/tools/virsh-completer-host.h +++ b/tools/virsh-completer-host.h @@ -29,3 +29,7 @@ char ** virshAllocpagesPagesizeCompleter(vshControl *ctl, char ** virshCellnoCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshCpuCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-host.c b/tools/virsh-host.c index cda2ef4ac1..4774f76ed8 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -751,6 +751,7 @@ static const vshCmdInfo info_nodecpustats[] =3D { static const vshCmdOptDef opts_node_cpustats[] =3D { {.name =3D "cpu", .type =3D VSH_OT_INT, + .completer =3D virshCpuCompleter, .help =3D N_("prints specified cpu statistics only.") }, {.name =3D "percent", --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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=1605001911; cv=none; d=zohomail.com; s=zohoarc; b=PipAoY9ZmvR2dt1ahTXPFRWaj/kxOL6ndrPONAjYQLEEp285yI9qQISsEaQilUvz1pcIkV/EmaCXf6J92MpLK6j43x5VGIGJC8O2Ekkj1iUfxvQsSbJyEeL7XHsUVW0b1yUI9tQdRoiL3dWBrKGnoPlh9dS7WNdM8kcQ7TNjNLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001911; 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=Dd5iRBSB7nKYYIYyXv+fJ2Tfq2HTJKpdKUXCrBXQAKc=; b=NzK5+lwih9semV3wcTPvaZQyWb2rzD8wh/Spj2+4LNoyNlOo2bjeV2+aHnQxuCQHhIJvVXBHaPNxGg361CD5M8Lj1hdjlxHC89ldxN1VbhpiqvjPfm6CZVb1PWYvhPD+cbgDSuFqdMOguqkzBMHVZ6jk5xqHzHv138jBgZI+Usw= 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 1605001911910272.98055365569826; Tue, 10 Nov 2020 01:51:51 -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-52-I0V2ixB6OiqntqyywAiOlg-1; Tue, 10 Nov 2020 04:51:47 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3785A107AFDF; Tue, 10 Nov 2020 09:51:42 +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 00E1B5DA6A; Tue, 10 Nov 2020 09:51:41 +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 4DDD31800B72; Tue, 10 Nov 2020 09:51:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pd1u006572 for ; Tue, 10 Nov 2020 04:51:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 29BDC2156A3A; Tue, 10 Nov 2020 09:51:39 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 238AD2156A36 for ; Tue, 10 Nov 2020 09:51:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 03D538007D9 for ; Tue, 10 Nov 2020 09:51:39 +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-48-2Qu3G60qP66zXuSKz00kkg-1; Tue, 10 Nov 2020 04:51:36 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2055.outbound.protection.outlook.com [104.47.13.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-C3-N3QYnMhyC5BrnjW7vPw-7; Tue, 10 Nov 2020 10:51:34 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7734.eurprd04.prod.outlook.com (2603:10a6:20b:2a6::8) 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:31 +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:31 +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:29 +0000 X-MC-Unique: I0V2ixB6OiqntqyywAiOlg-1 X-MC-Unique: 2Qu3G60qP66zXuSKz00kkg-1 X-MC-Unique: C3-N3QYnMhyC5BrnjW7vPw-7 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/13] virsh: Add serial/parallel device name completion to console command Date: Tue, 10 Nov 2020 17:50:54 +0800 Message-ID: <20201110095104.10783-4-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: 2f3d2b9c-4a40-492f-5a91-08d8855e3369 X-MS-TrafficTypeDiagnostic: AS8PR04MB7734: 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:1013 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: CKne/2xrAE1jZCXAvuHYlo0mhi2BqtWaM9gYuQlLsE0YSkKHWf8WTod/RDqJ+pfV1hhNlxuI7KB46iPkLfXTieoihwcSZwryBDZ+W4Ql6sv8dG048AyyEqE9/8nK0zB9ARdRPwy/1BQ9z5D4w71I+lRse0jQ0XtYfq9rcMj21VnvUwDMhuHHvaUQhWBUipj4Z8lHj8bKszPe7RbcgqTYOF8yF2dII4prcNGoh9/fZk6vtsgMFGWcefzAz8pisH/a2AUgnWpmwMH/vvSPDwaItlVzkvRZB2OcKvKqGuu15j036ZAaFer+NBW8ACxTp6Hw/Q/zrBGEMCMwyTDcHwq0gg== 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:(396003)(39860400002)(346002)(366004)(376002)(136003)(8936002)(2906002)(8676002)(66556008)(6666004)(2616005)(52116002)(107886003)(55236004)(6506007)(956004)(4326008)(6512007)(86362001)(36756003)(5660300002)(316002)(1076003)(66476007)(66946007)(478600001)(450100002)(16526019)(6916009)(26005)(186003)(6486002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: HCC/JJV8aObxrGfIRwFyfzm4ao7613kjmBbM+M5LIKgDTFEcja0VTGNwIwcuaI2fotq2G+ky0PFRQhuT+2BbfLe1lGBuUT3Mm1Q+ZjszCVwgG5d6g/ztn4YNqV7f+BPXaJBNBnb88+kPo/EbIRFFjWkhRBowvmiLsfwQxNmZjax+Nc8mh1dCQdrkUXsKnW8bEegWGA47WPv2ww1yEioSRtetzji8Z/Cti42t/vs2nHWAaeppTJsNPPyGS4WvdEtzoyUFMM2m0sFpgDaWCcS1eIZ0zIN5w45geEeD9MBKbl+EJU3S9G9Z0IlEBfOyUEeigg69AwfOp31vbit601Co2330BVGpPiHVhHO5muUM3czqGCweEiNy23YFZyI6vAz165ApClMB5znNrsr3CQPHKFTVHmOBWGOMW1Jie9yBwXLqCYuRtK1lkUKgFV190iU6qR3iTlYpGZPZ3dGA1lxMrwtF6gW1Zi1QxjqvZSmP3wUuciC34CTtrlD6CeeFpl1h4sVRO6hUkDEX9ilcUsEud7grhgMZAALRt6zP+lOknSJAs87LA+dTVIszRxMYVgMo6xaA42oQPut/w6ypQOS43Ipn/m41+2rRc3Ck5PuE50+X8OsMv9f7PPnpPlA8ZREFbu4M/liWBRzrHkJAjt+IL0zNxWGmJQs4k8jw6C6mUYgRwflR8Pg/aZCtd9sLUbiR5HpQo5FwqxZytCuPLBrTcDsh1KxgszqC26L0tNjWFSicctcHPeb7eIJ0rW0CJaIGmIV6AMOlboX7wxbbHZ9gjkbqK+FSlrGAuoGzTOXHa4FAu3sdpJYJXEyvHMnKsskIuoYETEtubHhQ4Wsbaacg5WVbq7+M29afxd9uHFFrfZSaPMYQ+QFlzqQx/WEXa5SRIAAEGjd0avvF42xR3eutmg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f3d2b9c-4a40-492f-5a91-08d8855e3369 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:31.2665 (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: UZZv4HpGo4BOxGWcl67H/pOoYMBzoFNwtBrdfBcpPOWU41DgMsZBKGtERhwxbOvp X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7734 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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pd1u006572 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.14 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 Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 55 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 +++ tools/virsh-domain.c | 1 + 3 files changed, 60 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index f653471b89..dc66317561 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -656,3 +656,58 @@ virshDomainVcpulistViaAgentCompleter(vshControl *ctl, virshDomainFree(dom); return ret; } + +char ** +virshDomainConsoleCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virshControlPtr priv =3D ctl->privData; + g_autoptr(xmlDoc) xmldoc =3D NULL; + g_autoptr(xmlXPathContext) ctxt =3D NULL; + int nserials; + int nparallels; + g_autofree xmlNodePtr *serials =3D NULL; + g_autofree xmlNodePtr *parallels =3D NULL; + size_t i; + size_t offset =3D 0; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) + return NULL; + + if (virshDomainGetXML(ctl, cmd, 0, &xmldoc, &ctxt) < 0) + return NULL; + + nserials =3D virXPathNodeSet("./devices/serial", ctxt, &serials); + if (nserials < 0) + return NULL; + + nparallels =3D virXPathNodeSet("./devices/parallel", ctxt, ¶llels); + if (nparallels < 0) + return NULL; + + tmp =3D g_new0(char *, nserials + nparallels + 1); + + for (i =3D 0; i < nserials; i++) { + ctxt->node =3D serials[i]; + + if (STRNEQ(virXPathString("string(./@type)", ctxt), "pty")) + continue; + + tmp[offset++] =3D virXPathString("string(./alias/@name)", ctxt); + } + + for (i =3D 0; i < nparallels; i++) { + ctxt->node =3D parallels[i]; + + if (STRNEQ(virXPathString("string(./@type)", ctxt), "pty")) + continue; + + tmp[offset++] =3D virXPathString("string(./alias/@name)", ctxt); + } + + return g_steal_pointer(&tmp); +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index d5021f6aa6..02fea2fe94 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -94,3 +94,7 @@ char ** virshDomainCpulistCompleter(vshControl *ctl, char ** virshDomainVcpulistViaAgentCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainConsoleCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 675d96440d..022dbdca3c 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2960,6 +2960,7 @@ static const vshCmdOptDef opts_console[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "devname", /* sc_prohibit_devname */ .type =3D VSH_OT_STRING, + .completer =3D virshDomainConsoleCompleter, .help =3D N_("character device name") }, {.name =3D "force", --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001922; cv=none; d=zohomail.com; s=zohoarc; b=XP4J8P/LigdpreANevYkqF5h/AORYgby2H3kdRFfQZxzzjgEgqDcSrYAXqElB8AILOmhW9aAre6EyYmqDmJsPfGPubW8aJTmDVKa9RywLUrmbq7h9q0tAzroijj6qK96a6gAYwlqhaV04GctJT/apDXPNB3NVr+ziAszyxzOYN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001922; 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=T+soLsPhwexDbA9tOv+9eXivcc/4O0rBBGRuisIDkxQ=; b=KFBKxpcAmwWt7NuaLkiAlSsTQ1KVIPjhYKMhfV6BuZGbuFBGfYUiSC+hqambLAFXGcjN4bRgzvqkAhUEkA/E5FY3ihI1bgwqXo03gKXA36iooDmlGLGoaDZKC/5ZOGzO+NSdp0JqKP2hYHDIXzYms4/952M+OEVY52WYNBZ7cxI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001922046409.6773226400916; Tue, 10 Nov 2020 01:52:02 -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-159-x0jkjzQ1N4SZ-nKy41mEKg-1; Tue, 10 Nov 2020 04:51:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 588D38030CB; Tue, 10 Nov 2020 09:51:52 +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 31B6D5C5BB; Tue, 10 Nov 2020 09:51:52 +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 F23401800B72; Tue, 10 Nov 2020 09:51:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pkci006608 for ; Tue, 10 Nov 2020 04:51:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id D424D110F740; Tue, 10 Nov 2020 09:51:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF772110F73F for ; Tue, 10 Nov 2020 09:51:44 +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 63B70800186 for ; Tue, 10 Nov 2020 09:51:44 +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-295-qwec30-EOjq2bKAVWYshIA-1; Tue, 10 Nov 2020 04:51:40 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-WQj_4bitOzqLFwxQpSRO5g-2; Tue, 10 Nov 2020 10:51:37 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7734.eurprd04.prod.outlook.com (2603:10a6:20b:2a6::8) 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:33 +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:33 +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:31 +0000 X-MC-Unique: x0jkjzQ1N4SZ-nKy41mEKg-1 X-MC-Unique: qwec30-EOjq2bKAVWYshIA-1 X-MC-Unique: WQj_4bitOzqLFwxQpSRO5g-2 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 04/13] virsh-interface: Add a static helper virshInterfaceStringHelper Date: Tue, 10 Nov 2020 17:50:55 +0800 Message-ID: <20201110095104.10783-5-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: 2463c825-a6dd-408d-b0a5-08d8855e349f X-MS-TrafficTypeDiagnostic: AS8PR04MB7734: 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:2803 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: yA/v8dOcGFAmejhYGquvnzqmayFOx/bTmi2YpOQa3EAhlpo3QLiaF7yWko9px+ljXqCCS+mAeYjNXoR1BdY5SathUElfYp+o+cwpJrt5VI7SMjw8qPmMiw5YDfwcxRQQfLBpIXokeM2Qwq79/DkTewX8D9WMArZvTG6YdM+BgOogET02rGd0Ns4uq0eUWjbDYAddjdslPbFKVnUAM3ddV9mt1ROKNfSrwRYU3dQzsOdIlq0BqcvGB8jFZGzZaokWcYGjxgJPzf54kEFgS10TtAqGiNJvI+X70a5OEg+vpm27PK8sfJp9+z3cmWS4E0Gt1JOXqY+W6s2uJoqirpQgcBnJ4u6602nL8aoyxrdT5JV6k+q8BrjxPNvfpdbF4g++exTDoo52NCl53dUPIkbiGA== 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:(396003)(39860400002)(346002)(366004)(376002)(136003)(8936002)(2906002)(8676002)(66556008)(6666004)(2616005)(52116002)(107886003)(55236004)(6506007)(956004)(83380400001)(4326008)(6512007)(86362001)(36756003)(5660300002)(316002)(1076003)(66476007)(66946007)(478600001)(450100002)(16526019)(6916009)(26005)(186003)(6486002)(145543001)(145603002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: wcQ6qre0BGCk5n1U+j1dOWTZ8PDty9azuLSXPUqlueG3d6Wgwpv7wOMFYJ0O2O1r1DwZcFOKl0ZV4nhUbMDNoYYuH6fWMFceSH9bQI867y4C/o2KcKWh1SDZOE8uWu6vAFab2k3nRAlqI+9c5RRcFJUg/zoiSwJIw9FoaDKNiE56v2DnpHaQPUfinCwjT2pKvsM+QQCJg6sRSzi80C+Wz0huIniKlRan234FvhrxqGom1NLq4PKigFmjV/2HCjPAwC+0wZsaRlYmm+IC3JBja9SEl+rx3RpOE1F0WQE6c8g6NTqkND9qTk9qw5lvPvGdqEXJw65DhuR4BQFflx7qniQf5dcGX95nDury8PnhzZXVSv6g80iu/MyvmDMuPr3ClJ4I5QABcFFHXvFmipqfkHll2ais5Q+djaGkHVpsjlN0Kn/ts5F4kn6fltp5+fKk43KOKhnsYAoj/0Hi/xDb9yz7U9eSh6f1NuMCV1h8BJ8E5illw9EtVcUeEpsNdO47wv6P2iYfosJtbGrPWBdQwoKo3rDAovaa3FkfzuTqFa1HKKODdfUEKiXbpJgOFiliQeD4LtQjhHQBKGqpWxfELQiq2zCILZXnJNQJpGyrGGbarIEwsxr4iYsMz0uzLU9TD/mr/OSMKPT/PGTf+Z42giq8Nz1CPVZzBuSxKSiQegzhX++WYc+XL21JiNOZgkIzQEcM3VeGZNXxKnnjW37vvFHzv+fTkeYPZgyk59Zcioj54IHzhRM0nnKkOfthWMrRz4zdsGK5YjK6SbJQWRL2dm1NXpntLFVqeNbzn+dWYKk1jqMPMCjzhO8GKrz597AZlkI5bk3+wx2YajAa9BVtwwR1ItPzKrHpA56njzhYu0ZGTIELsmL8nYEUKDG3UR8quH0aYYEPzaLWXmNXGocTqw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2463c825-a6dd-408d-b0a5-08d8855e349f 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:33.3033 (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: lmqIXKyoOqze4kLqbY92ZzQ5OQ2x4aoFmkWMmUaXRzKzA9f1Gf9+nWk8am9blgle X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7734 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.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pkci006608 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.16 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" It will be helpful to get the desired string of interface name/mac in a consistent way. Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-interface.c | 25 ++++++++++++++++--------- tools/virsh-completer-interface.h | 3 +++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-inte= rface.c index 8028db8746..407021485f 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -25,16 +25,16 @@ #include "virsh.h" #include "virstring.h" =20 -char ** -virshInterfaceNameCompleter(vshControl *ctl, - const vshCmd *cmd G_GNUC_UNUSED, - unsigned int flags) +static char ** +virshInterfaceStringHelper(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags, + virInterfaceStringCallback cb) { virshControlPtr priv =3D ctl->privData; virInterfacePtr *ifaces =3D NULL; int nifaces =3D 0; size_t i =3D 0; - char **ret =3D NULL; VIR_AUTOSTRINGLIST tmp =3D NULL; =20 virCheckFlags(VIR_CONNECT_LIST_INTERFACES_ACTIVE | @@ -50,15 +50,22 @@ virshInterfaceNameCompleter(vshControl *ctl, tmp =3D g_new0(char *, nifaces + 1); =20 for (i =3D 0; i < nifaces; i++) { - const char *name =3D virInterfaceGetName(ifaces[i]); + const char *name =3D (cb)(ifaces[i]); =20 tmp[i] =3D g_strdup(name); } =20 - ret =3D g_steal_pointer(&tmp); - for (i =3D 0; i < nifaces; i++) virInterfaceFree(ifaces[i]); g_free(ifaces); - return ret; + + return g_steal_pointer(&tmp); +} + +char ** +virshInterfaceNameCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + return virshInterfaceStringHelper(ctl, cmd, flags, virInterfaceGetName= ); } diff --git a/tools/virsh-completer-interface.h b/tools/virsh-completer-inte= rface.h index 893dee5a6b..32da01e766 100644 --- a/tools/virsh-completer-interface.h +++ b/tools/virsh-completer-interface.h @@ -22,6 +22,9 @@ =20 #include "vsh.h" =20 +typedef const char * +(*virInterfaceStringCallback)(virInterfacePtr iface); + char ** virshInterfaceNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001920; cv=none; d=zohomail.com; s=zohoarc; b=iRNO8/kWtSW24ASLEo+ffFtDUEyuhFwDPx9DjyLTNnIkOyH6aWFFjqMFM+hmqB97bgosRx8l74ONb8ODyv15aVMKOguMsRLyOo1TrakMAq+l/prh90dXxJkHUDidem+loMd5r3Pn0gB3rPJ9zDl/ltGH/5hTSnRveixhuq3nptM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001920; 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=axFzy9wHaX9jVIQCq6QewvWc5idWSfM/2qG4GMOp6xU=; b=XS2Yy8wd1AYyyZ/pfFDn4Wp+ixiMwgli8pM7BODgqdvQmagL0q8V1Okt6+6rZlnMvuZX61EcwfrPWDstQd0OZ9mxKN4CZmDXrCbO5j3ZVfEh6aim5Oua7MJfToZm5HjEXGKUsmnUgdsD+jcBCrQJQw4RgjFhKacvb646smOfbuo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001920871308.62537782311017; Tue, 10 Nov 2020 01:52:00 -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-1-33ddzeNWN0qTXQy3uaNBFQ-1; Tue, 10 Nov 2020 04:51:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1948185A0E1; Tue, 10 Nov 2020 09:51:51 +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 BA5712CFC6; Tue, 10 Nov 2020 09:51:51 +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 873A85811A; Tue, 10 Nov 2020 09:51:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pjtx006598 for ; Tue, 10 Nov 2020 04:51:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1F7662166BDB; Tue, 10 Nov 2020 09:51:45 +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 191002166BD9 for ; Tue, 10 Nov 2020 09:51:45 +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 0078C185A7A1 for ; Tue, 10 Nov 2020 09:51:45 +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-87-7YHV3se9O9ac7rpMZGyWLw-1; Tue, 10 Nov 2020 04:51:43 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-hvwSwZh0MAOcXGNjRZ-6Gg-4; Tue, 10 Nov 2020 10:51:40 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AS8PR04MB7734.eurprd04.prod.outlook.com (2603:10a6:20b:2a6::8) 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:36 +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:36 +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:33 +0000 X-MC-Unique: 33ddzeNWN0qTXQy3uaNBFQ-1 X-MC-Unique: 7YHV3se9O9ac7rpMZGyWLw-1 X-MC-Unique: hvwSwZh0MAOcXGNjRZ-6Gg-4 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 05/13] virsh: Add interface mac completion to iface-name command Date: Tue, 10 Nov 2020 17:50:56 +0800 Message-ID: <20201110095104.10783-6-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: 4604346a-9fa3-4fde-9e6d-08d8855e35d8 X-MS-TrafficTypeDiagnostic: AS8PR04MB7734: 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:296 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: EVSyOlmdsltB1jl9BIoVe1NRFeJEJDzi6dgJRdEXKJPMxI/6hhESnYiovm7aqMhX7RsgclRx1zEMy1ZPXuytORBeMFlNyKbjNWotQocB+WZclBIJyiVbk/5KwDrAMtd0E6akeSbX4ZfvDQphiqovDAJBlrguiiaFlT4Zn28YkDYPkdI/oBC4zwY4Lq9Tlt/iknctmXx2UC6zs0RDSsV29jlROcG/JFM0syP0BrufjZ+qYBkhySTedOgcHMaiiRWkpggc4oepBJFi/Ey6Ao9W+eDoUZcYy+5zIlt1gYDCwhEO0M5RY76wb1goVWuE9G8AKyLAUGVcbtDMlOzATta5eQ== 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:(396003)(39860400002)(346002)(366004)(376002)(136003)(8936002)(2906002)(8676002)(66556008)(6666004)(2616005)(52116002)(107886003)(55236004)(6506007)(956004)(4326008)(6512007)(86362001)(36756003)(5660300002)(316002)(1076003)(66476007)(66946007)(478600001)(450100002)(16526019)(6916009)(26005)(186003)(6486002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: tNM8ZMvs0RkRLfzZ6LfjopHWyKjrrLvsfxZL6TDC1w3PohX6xMcimv5ArM4joDse+uAlmoZCh+KvGktY4YXtAdnT7ZARs6PvFzA5UYCgNj+UXARWdd1gzteYNVHnRu5jJ7oDO69Ojc+xBH/1SSfNNmgNjlAaZdvlaQghAYqnt4OsaQSrRxlzWg/ELW7iWNpKIcRfpI1QWBVOy9uqelE2ORG5KWcsd4giobptuQ//JusnaMMPRY5yre37rmQVxNHAgfNxf/mouWRGsTaMnyL+mRpK5UOZg/OUaZQQsYyYX7b5r89OBqblLRvYrCnk9QzoUhbXdVcUGND5omdHkMWU0WYzEm4QtXYSHoWHebpMnQ6McD+rRW53v5JB3L0+/99eGQL+kNk8Rb2vysnl2ERnzHqH3ew0lwd6Y5imNulMdnpHS8Xo6mkfF3mlcuY77xhv1WxZZnUW4AQF5eE2xZANFQHgBvKehWxaxJblhSe2dBftIVAHTn0HHNdp9wZFdBS8JVn1gBSrT4BLmizitA6wnq4NJzwq+qmmAJYCXNzFWiZHqElqqrm6Z5InFQ/Kt/mjXvvxGm05R3GCoypgElY+XhfbUPWIWgXEbHcpAbKRzBhkHkwGCt9ATxAKeoa3RTq6tpDTMDnJdIL7oDgRMvWsTeTW3edN8tikL33bon7dRiCFKFU22TqAGfIq9ToSjEs/S0q5AJx0J3e8W+pkOdFZBjp6P2snpW3e0QDgjrT0bzn9+9WqV6cqXXvdGmke2tsBNfTlpp55TttDsa84r/QGPjN1e2TCUYABcEV1iMEhTVS8Z6FEyORyOz0ACexVBGgYlCX8ItVbcrAsJJvTDChRJ5K8yk+xhCSbdK1QrdmU0wYAr7fF5DYI8fUUAGvf3mS1HCEq206ZtuOnwcJ0CmfkxQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4604346a-9fa3-4fde-9e6d-08d8855e35d8 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:35.9638 (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: d9BB+7P00zljM8z6+Ix8IBderVvODQA/tpoNeXaQ8sNeF4hLGkefp7dowv2dtdck X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7734 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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pjtx006598 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.16 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 Reviewed-by: Michal Privoznik --- tools/virsh-completer-interface.c | 9 +++++++++ tools/virsh-completer-interface.h | 4 ++++ tools/virsh-interface.c | 1 + 3 files changed, 14 insertions(+) diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-inte= rface.c index 407021485f..dea8d645cd 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -69,3 +69,12 @@ virshInterfaceNameCompleter(vshControl *ctl, { return virshInterfaceStringHelper(ctl, cmd, flags, virInterfaceGetName= ); } + +char ** +virshInterfaceMacCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + return virshInterfaceStringHelper(ctl, cmd, flags, + virInterfaceGetMACString); +} diff --git a/tools/virsh-completer-interface.h b/tools/virsh-completer-inte= rface.h index 32da01e766..b48ded6a12 100644 --- a/tools/virsh-completer-interface.h +++ b/tools/virsh-completer-interface.h @@ -28,3 +28,7 @@ typedef const char * char ** virshInterfaceNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshInterfaceMacCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 8cdbc6e85f..ae2b52bfc3 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -404,6 +404,7 @@ static const vshCmdOptDef opts_interface_name[] =3D { {.name =3D "interface", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshInterfaceMacCompleter, .help =3D N_("interface mac") }, {.name =3D NULL} --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001925; cv=none; d=zohomail.com; s=zohoarc; b=eFvVIGk9pYFfem25QzmEVS5hIhNZzgdAscq6xkTm6loq4+ubZ2iWGIWjezcDoOqJslTSwgae1bF+fE1wJP7xMThc4KyG9Q0BCxh1YTiBGt4HmT2s2TRNR2G7pUl4qorqHQCQqdn+kog/ZgsS5i7mkqlqaRInhwY2ti0Ea8JZZdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001925; 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=t0cKbhV3pmL+bYnoXJZL757AV3hcV/JhGMj/5tqv1nU=; b=FaMfjR0tv5TeswnmJ4TVYhfITNvjJqSulC7xTnLtajswGf/3eSBcEksP9sbOcLaxo8W0j9WAirwajFu2/LkX6O2M2edIKCBIR8lWSIrYlN3q3i+J6Vc/j73Qio0Q9/UZU0j6aKaSFZ3zoEDXbmOH4dPWayAHUK8Ex0PZ22QZKac= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001925676703.7709259891918; Tue, 10 Nov 2020 01:52:05 -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-25-drwZRxRmN_mh-Nz1oV9d4w-1; Tue, 10 Nov 2020 04:52:02 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BEE457088; Tue, 10 Nov 2020 09:51:56 +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 DC6D56EF43; Tue, 10 Nov 2020 09:51:55 +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 A8FE558116; Tue, 10 Nov 2020 09:51:55 +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 0AA9plbE006619 for ; Tue, 10 Nov 2020 04:51:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9DC63200E1F0; Tue, 10 Nov 2020 09:51:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9799D2011559 for ; Tue, 10 Nov 2020 09:51:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 4F1988582B1 for ; Tue, 10 Nov 2020 09:51:45 +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-205-O9A6WT_RMCGFKiBdpxmljg-1; Tue, 10 Nov 2020 04:51:43 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2052.outbound.protection.outlook.com [104.47.14.52]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-15-YcChL3mYMJaZaoIjo-szAg-1; Tue, 10 Nov 2020 10:51:40 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3399.eurprd04.prod.outlook.com (2603:10a6:209:7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.25; Tue, 10 Nov 2020 09:51:38 +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:38 +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:36 +0000 X-MC-Unique: drwZRxRmN_mh-Nz1oV9d4w-1 X-MC-Unique: O9A6WT_RMCGFKiBdpxmljg-1 X-MC-Unique: YcChL3mYMJaZaoIjo-szAg-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/13] virsh: Add interface name completion to iface-bridge command Date: Tue, 10 Nov 2020 17:50:57 +0800 Message-ID: <20201110095104.10783-7-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: a4cbb4ab-eb6b-41af-ed6c-08d8855e3771 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3399: 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:296 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: j6+BmfQ1OZac0n2wjyrXkJX1eB+xGXUUSmbxiFbrzk0ZdPYe9nFdkto9noGmkfKbD1MjKxMqjT5ltrmNabXOOW5/ZirHGUGXqbLVoYMf5CU4NOcQ0MMuIpQij7XiMKJG0ib97V75ty0fCC0Q0gUbzmvNWfKIp262BwZTTBrGy2EBvab7qaJpFc/lJrG656KAclpKExy5jDzR28fDp8eUH7pMux4cBo1aH1gdFkKLNmBLoLN+Wwv33Z9PXr1ATbL2MtPHPfIWvNlACJh35Iwcx/8e+9BrKBI/W2BsUfXguulfl+UN2w0kjx4E77+tyKTJPsvL2S2JUwwG2bdMhSo78w== 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:(396003)(346002)(376002)(366004)(136003)(39860400002)(2616005)(1076003)(956004)(107886003)(26005)(55236004)(6506007)(186003)(16526019)(52116002)(6666004)(6486002)(4326008)(5660300002)(66556008)(66946007)(66476007)(8936002)(2906002)(6512007)(8676002)(450100002)(36756003)(316002)(6916009)(86362001)(478600001)(4744005); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: 90m0MocIcUQZgjXWTafKyAVITQXM/dAAeumyLfq5x0m8vZRj9FV9vT5nf/+rGsKnRUs/jrt8jGb689rohgEndXJVw8NkSXo9bGaKEsCWYxY4yZDJMDVQlNGwpv+5idGc7SryRx0PE2pd09l3SddXySL8Mt+8Cb6p5OgRZAxdn2z9vrafG7Hh3BqkltCvgS8/Veki74TZl/oAeraoe7bCmVymufX5PQCcGYvW9Y+QMiNJCzeTmoZvOoCM16IyPckEJZ7OKuWOCsiOD94iT/Lyk7W2DekqAiH0To3NYQwvvXrFq1WiSrQpdJlCG0QgTnscCkQ8sqwbkgQjs+BjVdQ89kgHk5XQp7hRy7+DNxlHBiAZIcemlP2YtAPStEnaeuoPrphFcF2tzICfsiZWmD3v0KBuWo2nCraLHcO35ME3vj5u9akUdcstd52j4D/zR1Qa7dHRZJIeUnYtQe4fy1MFgQwUVZhp9wg3F9IEOoejEAxNJfJIMJhXb485vhR1j7cqiSDUBCiiLY5q1XX+H/WyVW13pC8giFuGrkNR/ARkmkqksZoaDhC2YM6VjTSp7U87pAmn40YSA4t0zAQu4huuSEk0sHASHDVxHD6/k1rE9Cm6joKJwRNjNPmaEOLEW53IMqyfEmIZ9JOTvZIJiA0mpbK/3B+gx6CR9nvhgbILAtDFZKKpRA93G2HORjMILMPMVwwTLEMlkPRqD9r1H3OOT0ZZmnxF9+JjywOd2R4kEYOov35tvUbgKQgmFYuygrA0c2B9EJirPebDyxeMzO4R8meWabJlYxQoxAm1NKdzMbJiV/2cM+Xa5KmTD/vs5lxZzqN1L0DIcymaPJSayLBywB7irxRGEeNRjA+ToqIlycAfj3QYYFg0TWvYOObcqNGP9ER7nfsuwcrh7D9ZHOv5og== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4cbb4ab-eb6b-41af-ed6c-08d8855e3771 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:38.0436 (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: YFFd1uYiDs6A6eaACcufJUyhzdRHi8I6QGWNVaHqXX4dLfWaV7yh1qp1WqccU+2B X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3399 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 0AA9plbE006619 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.13 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 Reviewed-by: Michal Privoznik --- tools/virsh-interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index ae2b52bfc3..ae234e1e22 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -786,6 +786,7 @@ static const vshCmdOptDef opts_interface_bridge[] =3D { {.name =3D "interface", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshInterfaceNameCompleter, .help =3D N_("existing interface name") }, {.name =3D "bridge", --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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=1605001925; cv=none; d=zohomail.com; s=zohoarc; b=KQF1r2V+3Ohgd1EFew6nejqCQXthVLTDVJNY2kuyB9Hh4c1oHdfeTBdUjDzwLCuwoWPmU7pXM9w5DERqtP84RepDOwbE0hxvu/XIGvyN6QH4jeKCz4+QI1pj2c0s+C/qDI0Ouov40Lo0u0OgYW7gjsmC5GmLzfPr8PYBbOKrxfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001925; 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=aWzbVTRiTGeCRnVe2AutFKyEvZBmYeoTf+IleUTNw5E=; b=FRiku/YuC5YlZjsvG1WaWqfoeMKEpmQP+eWBX+Ij3vND70HvYxNwuihG1h3iis6Nq5avMF55jSKD5XUQLkWr5//akghVyJEakRzh6kdvnl/Xjsp5JEzXav9X89nNEfmvcA8RDLZhxXwAS0MclN1fZxs2YqckNNasGuXcU6nJW3k= 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 1605001925408216.2109374683149; Tue, 10 Nov 2020 01:52:05 -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-302-BGxJ1WlAMpi6Ss6HKovk7w-1; Tue, 10 Nov 2020 04:52:02 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6BC4186842C; Tue, 10 Nov 2020 09:51:56 +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 B020D5C1C4; Tue, 10 Nov 2020 09:51:56 +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 7D3F8181A06B; Tue, 10 Nov 2020 09:51:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9plfO006618 for ; Tue, 10 Nov 2020 04:51:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 70D821004036; Tue, 10 Nov 2020 09:51:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AAF1110F750 for ; Tue, 10 Nov 2020 09:51:47 +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 52A6689C5E5 for ; Tue, 10 Nov 2020 09:51:47 +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-329-a54JfCkMOyWkZyvuCGUbWQ-1; Tue, 10 Nov 2020 04:51:45 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2054.outbound.protection.outlook.com [104.47.14.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-27-_AL-YtEaNna8Df2qG1X28A-2; Tue, 10 Nov 2020 10:51:42 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3399.eurprd04.prod.outlook.com (2603:10a6:209:7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.25; Tue, 10 Nov 2020 09:51:40 +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:40 +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:38 +0000 X-MC-Unique: BGxJ1WlAMpi6Ss6HKovk7w-1 X-MC-Unique: a54JfCkMOyWkZyvuCGUbWQ-1 X-MC-Unique: _AL-YtEaNna8Df2qG1X28A-2 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 07/13] virsh: Add interface name completion to iface-mac command Date: Tue, 10 Nov 2020 17:50:58 +0800 Message-ID: <20201110095104.10783-8-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: 27c76418-ec15-4cda-24d8-08d8855e38ad X-MS-TrafficTypeDiagnostic: AM6PR0402MB3399: 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:296 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: FOkG064e5v7XB4bDZOhet++U7L91+hPUI1UCW6AprEU32QMhZ7qOpjD3m+ptLtph7cQUfefinS+G7I84iygfqo5mb5eYu1XtVjUr9Gx63tQdRmQTdXHSyoI1ojZMnhrRtw+jF2Qnw1VPA3RigYPFUDTFh7pmzCbVIqltttOMlAbsPKlc+KOZOtksEmWLJHbt3/2iDHz57TlXfQqWSc8NEbIZ+sQU+eaNSTBjy8hIY2AyCVbr9jzwWePCNJ8EP/tau5sxfvCD+ymCbIcazvAihp6x8oN5zTsa5yK/31HTNPDHNxuumFpHbmC8SZ9W4VWziLL7DFpHfnS0mun1Av0pGg== 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:(396003)(346002)(376002)(366004)(136003)(39860400002)(2616005)(1076003)(956004)(107886003)(26005)(55236004)(6506007)(186003)(16526019)(52116002)(6666004)(6486002)(4326008)(5660300002)(66556008)(66946007)(66476007)(8936002)(2906002)(6512007)(8676002)(450100002)(36756003)(316002)(6916009)(86362001)(478600001)(4744005); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: bTXtBbC/ujIuzbEdBvg0fbMTcnpZYt/Xh+QMEBgFbXeS11TQXfZqU7FZaAtXMCKDT1FxiSJGH2fDVKsRMzwQb4fTZGz2SFyOCPTQfOa7wqFRdBWIjvws3m6n7ndXW3BT1We4PgVJffhw7C7nsB1+o3ti0iE6zPCddUX6LbOJ4L/PfzRkILgPq51SvrJFvwtRXx4EmBMlY4F4V9l5VChaE3t2b+D37sr3Ldn1T2EbByeVYcaUMC2N9bilw+QTW52vz9eKCkhsXvu1+lWgW+0ZJ6uIKtWzrpOnfOcKUDgdT9YedfEaAdr/v3PwxUYM5Ekwclz7Aw0LAt0C261J+kKQ7CjYun5HjfpZg4LnVPR1Yr6g8/qyF80Eedm6CvcmRxdwStEDKdsfnXsyJWH3gUqZnwPlr7JwbEwGgkF89jhVczlxUG/zi2WD+ay7m6B6U6mbkKw6L47Ne1wYtbK9HaZ6JSL4pnE732OtY6ysZ0VsQcA4q693JzawRkFVnmfBUNXcUJKP/lmRhxV6rAtf4gdD90PoMAHeVpPjWJsgq4SMFZjwpdATL3D3L/WBrukIRxn12dNQLmEJVBE9AcyGgOc2rQW8jOSh173Xieyyai7IA4ZGDJcIcgtKI446gPQFcXBtUbDoOdrHz7BHkMB7GisgunhFdq4XzngpadJMDdIELiJ9yNnRAkldaWVSd78Vk5rHM+d94GYsC1iwO6DVX404EVcdoK93OI8cksgBfjjlrQ7tY2tw/MbMEFRJbS4woUQP4y1HVsDHt+eSumI+K9iJJT9F37CrcEMpXRb5jOWKsVsopwiY+GD3eGg8UGXZL2Uqg2kl5Gba8UFNSID+1LhrCEdlutHWMMFdAH6YMoeBEg0yYn/ONNpnr+9o+g0BX0RztPgFpuFdqPdIOttlllIv+w== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27c76418-ec15-4cda-24d8-08d8855e38ad 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:40.1374 (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: oNrQf3uZj9J+Rd6Dol+6hJux9Wwmv7S8ATrewl77ZQBQibh9veUsrN61YPlzJfBe X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3399 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.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9plfO006618 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.16 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 Reviewed-by: Michal Privoznik --- tools/virsh-interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index ae234e1e22..858052d341 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -441,6 +441,7 @@ static const vshCmdOptDef opts_interface_mac[] =3D { {.name =3D "interface", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshInterfaceNameCompleter, .help =3D N_("interface name") }, {.name =3D NULL} --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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=1605001929; cv=none; d=zohomail.com; s=zohoarc; b=lYIGuAEVMKJv1FmJUSto+vJ4aJPNjcxa0+vVP+b+DQZDlHDaewOLGQI83e/WA1UkFB44TaDl99heyFrn6Np9/E3HF+7l6hNDby9wHQ5RY9ZEaxJNKialg6CMHba5z6uZmBZYqZlNWuWjLqhYEqhLjSF/3Klo+aYB3LVXLdEER3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001929; 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=pggPFSjE6h3uHUfrADjf9i42GoMhtF84xOD+rBq03ug=; b=H95oL1jHP4piRvVnp0jGFtFPhIkrlNNHEPXgUa3RsdYJsjoBN9Rtm8w7VCJPj+Iv97GMVFRod88o4dfzBxcEz8Q+LCGV2Jzs5oPy+rL1VmQK9rp/OiEWy/Ii6peCsPRh/Sekuw29XAG/zj716RoxZi6hFXiUY2YiFQjK4jQ7vlM= 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 1605001929850230.29613142226515; Tue, 10 Nov 2020 01:52:09 -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-478-c6ll0OsQNm6uQVzYQ-A0Zw-1; Tue, 10 Nov 2020 04:52:06 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D53BE1074654; Tue, 10 Nov 2020 09:52:00 +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 B09285D9D2; 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 7C16258100; Tue, 10 Nov 2020 09:52:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pnRd006640 for ; Tue, 10 Nov 2020 04:51:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 087762156A3D; Tue, 10 Nov 2020 09:51:49 +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 025FA2156A36 for ; Tue, 10 Nov 2020 09:51:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 DCE841021F88 for ; Tue, 10 Nov 2020 09:51:48 +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-111-uS1GA5vRPMiKIgGZazPbtQ-1; Tue, 10 Nov 2020 04:51:46 -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-9kF5kKugNhON5cMxWG8XiA-1; Tue, 10 Nov 2020 10:51:44 +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:42 +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:42 +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:40 +0000 X-MC-Unique: c6ll0OsQNm6uQVzYQ-A0Zw-1 X-MC-Unique: uS1GA5vRPMiKIgGZazPbtQ-1 X-MC-Unique: 9kF5kKugNhON5cMxWG8XiA-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/13] vsh: Fix completion error in case of multiple mac addresses Date: Tue, 10 Nov 2020 17:50:59 +0800 Message-ID: <20201110095104.10783-9-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: b3e4926b-2f95-4bb5-fce2-08d8855e39e6 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:4303 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: WsCjYzXZy5yD1weccXEFutjfSmaoeDsvjbKeatxe9lPDZ9OY5gaBNLPey9a1W52IQ8xhXNBl7URK7G04Hg/BTn1ZMh1uG/qJNm6bPVK31iqNv8DuynoC8o6ojmfmIJymxgTwStpqY9JXQ/4s1P6HoR1A1Ovi5G2GJdUNXhCkE2txuUS5mU8ORb/OsCaKL3N16wD3VWmFTzDd32DFs6V1atEBOs0RJuw65yiGBLn6/s6wrFXEiYgrb6ln73HgIv2XTvWwxIK+TAT5HSjuBKgyw5tuMeaJU2xQpZplyEYvlG33TDSIJT+PtTF5XT1Kwr+Zc2MUGPl2MKl4QY+76j/vkw== 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: h8Q6KH8glQ5yMMbstCxkz0GslP4Ha/swte9nFCjahX58gqPBgLWhRPl2hSUucqjnyjjqgy287kXMVcDQcqz20D08/ReLl5VzEnZFjm/c3k8u51SKjLsTo0bISBAxR2e1zKZj5z90nAkf9h1UsCiJPm7OK/ju/4LSy/n/KkOcLf1NTahrwGUXbWBpCwEfYVBHO2FkOFAJP6BsPxSsvXmvDEdCxyR+7kNYLFdqFGmH4vSzu7/rYeeuaRGRlXwfFNeVpqcfmM2PmDf8ZLJ9+FqrVjK+RWNYgd9S7soUXd2GWMqedCfguVADfxV5LOQmu/+q3M9titRDUUzJT0vOvFu/0QGJaF4EEh08qsmjOsDbaIFxh0aHLVbI2t5SdXfPLpnx86BUR7hSc20LPDWkTEglx18imDwH8vauAacTPz3nUhN/WPzBy/pvEeJ5ZaS2LFB7wqCo6VsS/JBnQqVdQG4pTZk6Tym0EZubiEZ8sWGH0UyMFmx0fqh+zIQGkXaisals7VfqdbYhM8qACI4HcgbDX6Q3koaIGpaMOvMzwwrDSP7QG2WBGess0f73g8KTpfst9tUapq9nr19I6FUtlWyXuFGRd0h/P+49tUE4T2oTeQVjdNPLQjFvKTgaEGMw9cRqG5Y3fJTozMKT6ChLFeH8fzsFdWsS6GIsdNO4N0hREpyWT9I+fvsZ74VvLeLeuOaJcGGW0gMJJ3hj4R/0UwV8JDOUNNSBE+49uezg13Hh0e7GP6xzUWJlIGkva3/BajkeHOD5IQafC5EaEM/L5qLLQ8SSuoRu8hLsbZvvxdJvJPRoCEZYpKzgbKUF6abDayQZbuxFNoh3Y/dFkImuL8QaD7DzKh8e9ubaRz3sye0PrJ21TVyfTh/iOTAYp4uyWZ6Bgk3rS8QodgMsbTMLDwAhiQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3e4926b-2f95-4bb5-fce2-08d8855e39e6 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:42.1982 (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: 6r+NjXFGisqWqVFjkA/lKfcWZMRqYWIhtKhKVgHQHJOE50uYk2MRb88a2s+iS1jz 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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pnRd006640 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.14 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" We know that the bash completer automatically handle colon by preceding it with an escape character backslash. While our bash autompletion file vsh completes multiple items, In case there're multiple items which have same prefix and the content of completion items contain colon(say mac address), The vsh needs to correctly hands the backslash which are added by bash completer, Otherwise the completion won't be successful. This patch fixes this problem. e.g.: # virsh domiflist --domain VM Interface Type Source Model MAC Reviewed-by: Michal Privoznik ------------------------------------------------------------- vnet0 network default virtio 52:54:00:fb:7b:f5 vnet1 bridge br0 virtio 52:54:00:80:1b:21 Before: # virsh detach-interface --domain VM --mac # virsh detach-interface --domain VM --mac 52\:54\:00\: After: # virsh detach-interface --domain VM --mac # virsh detach-interface --domain VM --mac 52\:54\:00\: 52:54:00:80:1b:21 52:54:00:fb:7b:f5 # virsh detach-interface --domain VM --mac 52\:54\:00\: Signed-off-by: Lin Ma --- tools/bash-completion/vsh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bash-completion/vsh b/tools/bash-completion/vsh index 8493cad28b..fb38e8616f 100644 --- a/tools/bash-completion/vsh +++ b/tools/bash-completion/vsh @@ -39,6 +39,7 @@ _vsh_complete() fi =20 INPUT=3D( "${COMP_WORDS[@]:$i:$COMP_CWORD}" ) + INPUT[-1]=3D${INPUT[-1]//\\:/:} =20 # Uncomment these lines for easy debug. # echo; --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605001929; cv=none; d=zohomail.com; s=zohoarc; b=KvOcgsFv0dJRreuPdO4iUqX4KRWn6Fd9miv+3T4RNN50CsG09yiBGf//LOPcdjfUJWVb8+OMxJ/e7/OBZzZ6kaiLnWF2SwMDADsoPAenVX8QzY2m4GR4yVEjmNZSli7Qekp1ynEfUeIcWrNrQJnhP+/qNSX0dGcubeGRAX8W+1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001929; 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=u3tgWQvmSC5b1JYmptTvIgVe+IXmWdKAh1m1Q6I/NOA=; b=aeQRxmqj15l6fNUXR7V5UeQ623ZKjKUcM53RbvSdmiyceowBFn7+DxZ3ti5OzFYXd09cgRuXEctPaXEJKaUVhEMg5GE6fB0CncwDIbmw9tW8hLFP5RsipuvxdJe8SwdlODGLIKY342xvVd2G1KRdZANOKZXTe90zLJ5l4Tj8tW4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605001929325598.8406386777465; Tue, 10 Nov 2020 01:52:09 -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-543-X7fNMzv8OBSIdB-vHkX6Dw-1; Tue, 10 Nov 2020 04:52:06 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FF4A804755; Tue, 10 Nov 2020 09:51:59 +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 1CCBD75141; Tue, 10 Nov 2020 09:51:59 +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 D8B03CF7F; Tue, 10 Nov 2020 09:51:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pujj006672 for ; Tue, 10 Nov 2020 04:51:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id DFC982166BD9; Tue, 10 Nov 2020 09:51:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0D042166BA3 for ; Tue, 10 Nov 2020 09:51:51 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44604811E97 for ; Tue, 10 Nov 2020 09:51:51 +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-343-g3fZ52FoPhqaaLQ2RDC5LQ-1; Tue, 10 Nov 2020 04:51:49 -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-sXeJOYlPNXG_KIcbMR0yOA-3; Tue, 10 Nov 2020 10:51:46 +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:44 +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:44 +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:42 +0000 X-MC-Unique: X7fNMzv8OBSIdB-vHkX6Dw-1 X-MC-Unique: g3fZ52FoPhqaaLQ2RDC5LQ-1 X-MC-Unique: sXeJOYlPNXG_KIcbMR0yOA-3 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/13] virsh: Add mac completion to net-dhcp-leases command Date: Tue, 10 Nov 2020 17:51:00 +0800 Message-ID: <20201110095104.10783-10-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: 6ea2b8b7-434d-4f86-7971-08d8855e3b26 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:1013 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: W5nnf0O5WdMeqIN/92NtrxQKsmUMpDfEpLXtiRkIomplYh8BQ57mV6nIoFdHhRrQNLX7VyrMVvf9WMZ8QgL0vvhtL+WshAmZ/Rd4LfeD14Y3kA9UbrxM1tVcDN/ZnL1lfF9wIMfYoxHupddp5i7EwQ+y+S8cOqhwfqRTwvNTboY/mdSTQxC8fuhF7m67pIbp+C64tseiYfMll3wKVaRqDEYGU2o1p5Ju0bKdmAUtJN/dyohDyAtbQY77m4imUik49KizCdZEqGVuMFxfgUBaKjm7d2K/k66q9WMfjHlBF8FYnUmScenvQ/s4xwzq5CdXmFb4gc+AeCCou+Nvl8IZwQ== 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)(83380400001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: KB4GXs5ds+3Vtb9DIaEgIPBwDjZntudPvpgH5UDIjwXoyv9lv6JsDkjYqZ3dKrS8i+huGmP3brwYP9e2F1nZg3zagAf6+xsNj4uClgeSq1UWfvMVo/1UuKxCp89T57BWwLwpxoFZdjcctw5ePRasJe67ZkGvqbM1DTItwDsZQ9l1RmWbYTQn/6lhCHnCWRCdh09CdxHP8dk8E7+yZTkIDtsd+eUZ4Uj8BwIhuI615jrguky/LsNdaCF9YmnxxbXLvw0DW8VlnNVfshU9kFhP2lyyUgre4/tkoKMFrdf6ZSbNkPomRYLIK7AmNeVHYy++GbzDT1swd+h6UfDtD/7yyAN1DjUhgOFSXmK9RQkpDYp/FrfLeZztPFuMthDdLDta8xu6ZxMVPFOU0cBjd3CIY348AUUkc+9wEag0UB5+wDsoybIywY76rFQYm0LlrDtI3xMyrOrEtnx1ol5JqXrBWlS93En/cYpMcWnRNhteScvCZzkOM5kPxEJERHnMej3aVA5LjL0yH5+0jsbMHtRRrVgGQ0j9CpC0fvXwBE0NsKdZj+I7zZOuzPFloZEaM40VvP1MocbC+Edzl/U5hIMjbxpDAbkz3AFpX+k9SKtwFPL/aigjExbVojj7GA/bFIm6fZEfvF+7lnOceR/O/BCCybUFAh0E/QaD1iOTE7ndSQSvmXV+UTJ96eJ36rDLnftN4kBVdMt056AQ9dfnABwIWQd4OzMduJvPttdfZXhhqAEPIKYTjeUApUkfd6vAEQ3UbgLoRraiOMbQg5aETnThhLDHdbU1NDEOtpWEATNOdlLaOjtmse5WeuL4Xf5GtTkWC1uAKTDyC9PJuNMuy0qOqb3K2yUgMWnz9nTDduS7pH3Ow37Kr2gjGdeQbqyWOYUZ4/EuaAuMMkr08OgY8XuqNg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea2b8b7-434d-4f86-7971-08d8855e3b26 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:44.3049 (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: B6eGj8PW0K1RWb6niUe7t9lDon8JmEJWe0u1e5HPngbz7T01zZY8evrEdoRMs8+U 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.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pujj006672 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.15 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 Reviewed-by: Michal Privoznik --- tools/virsh-completer-network.c | 44 +++++++++++++++++++++++++++++++++ tools/virsh-completer-network.h | 4 +++ tools/virsh-network.c | 15 +++++++---- 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-networ= k.c index 73f7115ab2..3094b9d5d6 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -174,3 +174,47 @@ virshNetworkUUIDCompleter(vshControl *ctl, g_free(nets); return ret; } + + +char ** +virshNetworkDhcpMacCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virshControlPtr priv =3D ctl->privData; + virNetworkDHCPLeasePtr *leases =3D NULL; + virNetworkPtr network =3D NULL; + int nleases; + size_t i =3D 0; + char **ret =3D NULL; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) + return NULL; + + if (!(network =3D virshCommandOptNetwork(ctl, cmd, NULL))) + return NULL; + + if ((nleases =3D virNetworkGetDHCPLeases(network, NULL, &leases, flags= )) < 0) + goto cleanup; + + tmp =3D g_new0(char *, nleases + 1); + + for (i =3D 0; i < nleases; i++) { + virNetworkDHCPLeasePtr lease =3D leases[i]; + tmp[i] =3D g_strdup(lease->mac); + } + + ret =3D g_steal_pointer(&tmp); + + cleanup: + if (leases) { + for (i =3D 0; i < nleases; i++) + virNetworkDHCPLeaseFree(leases[i]); + VIR_FREE(leases); + } + virNetworkFree(network); + return ret; +} diff --git a/tools/virsh-completer-network.h b/tools/virsh-completer-networ= k.h index 8910e4525c..80df5c468e 100644 --- a/tools/virsh-completer-network.h +++ b/tools/virsh-completer-network.h @@ -37,3 +37,7 @@ char ** virshNetworkPortUUIDCompleter(vshControl *ctl, char ** virshNetworkUUIDCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshNetworkDhcpMacCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 745afc537d..30b231f7d6 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -61,6 +61,15 @@ .completer_flags =3D cflags, \ } =20 +#define VIRSH_COMMON_OPT_NETWORK_DHCP_MAC(_helpstr, cflags) \ + {.name =3D "mac", \ + .type =3D VSH_OT_STRING, \ + .flags =3D VSH_OFLAG_NONE, \ + .help =3D _helpstr, \ + .completer =3D virshNetworkDhcpMacCompleter, \ + .completer_flags =3D cflags, \ + } + =20 virNetworkPtr virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, @@ -1373,11 +1382,7 @@ static const vshCmdInfo info_network_dhcp_leases[] = =3D { =20 static const vshCmdOptDef opts_network_dhcp_leases[] =3D { VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), - {.name =3D "mac", - .type =3D VSH_OT_STRING, - .flags =3D VSH_OFLAG_NONE, - .help =3D N_("MAC address") - }, + VIRSH_COMMON_OPT_NETWORK_DHCP_MAC(N_("MAC address"), 0), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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=Y3YU1/LZXONR1bBhjLXv8IpTrYz98saKQ5niTaGHlaTgXF7e8B+Lzg1GMo9lZwr422coWCR5k48qDVYLPrhH/TFG7mdrkKBFmFlLU9QUV50LOoxk8hlcgkcimrMbaFB+dlubsjVf8+7uo7PyJo0XnM+iWj/FGll6HT2bXVoBe3Y= 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=OfBv3sqWLwfj9Gb7klzdcrq+25f4R0RlM2LNn+4pyTQ=; b=TK62EK6+4+ksl3+G66tWx56d09zxwSi0X99JItx0NKWgik4nVS0HIJrIebQXGEiU+7y2+v/Z4Pawq5QFXTfgZXKdEsgeqGlUeSoJYNWdtL/VGq1FNWnSrSifCoh+piKuutr/t16frgXVZV2JMyT0Yu+ghf/N5cBuKiwt15+DSDM= 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 1605001930500491.09350439129537; 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-590-FR_1FaAaOXKPyXdu8Xg5zg-1; Tue, 10 Nov 2020 04:52:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20FA6186DD37; Tue, 10 Nov 2020 09:52:02 +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 ED52C5C1C4; Tue, 10 Nov 2020 09:52:01 +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 B1670181A07E; Tue, 10 Nov 2020 09:52:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9puJP006678 for ; Tue, 10 Nov 2020 04:51:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 784AA94655; Tue, 10 Nov 2020 09:51:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71BF394585 for ; Tue, 10 Nov 2020 09:51:54 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 286C4800186 for ; Tue, 10 Nov 2020 09:51:54 +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-539-S3Cqq4SZPrGm9PKesqsiKQ-1; Tue, 10 Nov 2020 04:51:52 -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-hCNLlxdHNEmdQXu9_JUepA-5; Tue, 10 Nov 2020 10:51:49 +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:46 +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:46 +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:44 +0000 X-MC-Unique: FR_1FaAaOXKPyXdu8Xg5zg-1 X-MC-Unique: S3Cqq4SZPrGm9PKesqsiKQ-1 X-MC-Unique: hCNLlxdHNEmdQXu9_JUepA-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/13] virsh: Move/add some of function declarations to virsh-domain.h Date: Tue, 10 Nov 2020 17:51:01 +0800 Message-ID: <20201110095104.10783-11-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: 4e1da28e-1430-4970-9ee7-08d8855e3c69 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: d8E3U1hR/n/ein7A9wMoEcS1nBpgScaFc0HykdfakCD+YrwtThfWJfqcd0Q5a7aHnB9o5EQlgZTSNfJiLt4pmnWnL/Wf3aQH5F8l1Z+9dbnDaweYilwNnmshVYjs0I6wgrxhVlGPXhS2Oy5bSNwSFcwz/Yu9t/bJcZbNcoAw61ozGNQUUMVnAxxFZ4DacLZgbN4+dhO2XfTd2EH+g7Y6MuXKCClBaassm+I8HbF9FZzUr4j7yiJqs/MSIAeXEbDJIImIXbbOHq6Ffk0xgAApqG3vbHsLQszP7RebzyoZC7RG4C7QcgXkOVpMEyJ1/s88WaHaH8XVuPzuooesSAqUkw== 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)(83380400001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: MG/M+mARCuuBL3s4CP+gpTYVUsLJjk9skVCr/GXFp01XXImGYjM6ToEsYPCZVu5Ey6D7ttaf/KnFPi4tEWCc998bc4b1pk4uAFJpeX7XWiHt/BL9hi6LuaEXNChfQI/eRytsD2zP0MSVQ2SSNa4JejrpbudDlfTUSXCe4uNDXE3Z9+bjUqSvtGIB2JgZD+yAAEDu7R51QKIkoBW+Pk57cyxF4LWReHbfSrPHY6eNNXsG87zvibl2jtWUNJuwaQJ8J7oqLg33pYPGSJozuna4nk46q9qla6cBBTBrWHDhgoWoLkB6fiXqOn4UsEkIN7HwyksPrynw5x61K4PFkU13L9IgH5X3t6T9dl1/eZ9Uh6Gu3Fi9cBJ52lgSlRBV1DxePrSLRBVKuJ8516MppN7SsY15DkVhsKNn2wjKpX9CtoZRbvcHfsY4Z4+AnnxsgobaK0I6y6UEqkSYE8zFwLeZcgNLzAUxqhIg1zwTbB4jMhNZMF4WQC9IZTaF5PGBLS38UJ/RkzGsRfeiafUxOsix/285076wzKuoJ+D117mfoyowRRzUUn+InT3i57hR7kDUdAzgZs8AZsK+X0cYiS/5IXAf4q3cA8mNy8GcSug/841xILY48x6ep9PL5wKyVJtf3spIL8NG0hh1SulKh1vDrq7XaWRnCeNb3dSKksl708wjDVqVgp2kGaBcJAJz+He2DNU7m6GTZ3C7spoMGSwJdWJBtf8/3WWrsxYUvmUO7AAgZo6nooNnLEOr6i+x60wZzvczFfpEp2cs6QsCUawoaEMitXV4w9Pk4+WQdgV0SrJfiCD0Hbg8zj8InjtqUGYtoe52uD9Gs5G22OtX/nb7FyC8lSFmkv4cDJ75BYQkOwHoevUyR+wsu4UcHImLv0wMsVyASGlvieB4Uk7Ads7lHQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e1da28e-1430-4970-9ee7-08d8855e3c69 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:46.3548 (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: vGBrzkNGnS7hCge4tTxWsCsnQ1MKKX2bauQ4rhnvnx51Zdj1MU/cO34ISeU/Aevk 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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9puJP006678 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.16 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" The upcoming patches introduce completers into virsh-completer-domain.c, They will invoke the functions which are defined in virsh-domain.c, So these functions need to be declared in virsh-domain.h. Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-domain.c | 1 - tools/virsh-domain.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 022dbdca3c..472b510a6b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8910,7 +8910,6 @@ static const vshCmdOptDef opts_send_process_signal[] = =3D { {.name =3D NULL} }; =20 -VIR_ENUM_DECL(virDomainProcessSignal); VIR_ENUM_IMPL(virDomainProcessSignal, VIR_DOMAIN_PROCESS_SIGNAL_LAST, "nop", "hup", "int", "quit", "ill", /* 0-4 */ diff --git a/tools/virsh-domain.h b/tools/virsh-domain.h index 0d59c579d4..70e2aba1b1 100644 --- a/tools/virsh-domain.h +++ b/tools/virsh-domain.h @@ -39,3 +39,7 @@ typedef enum { VIR_ENUM_DECL(virshDomainHostnameSource); =20 extern const vshCmdDef domManagementCmds[]; + +VIR_ENUM_DECL(virDomainProcessSignal); +VIR_ENUM_DECL(virDomainLifecycle); +VIR_ENUM_DECL(virDomainLifecycleAction); --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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 Reviewed-by: Michal Privoznik --- 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 From nobody Thu May 2 15:37:56 2024 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=1605001932; cv=none; d=zohomail.com; s=zohoarc; b=Y5Fuz+6r8A/c+RHJkmi9LKaOTo3t7PtmoL11fAtoKLKwSvnMiraPx6eMzMz4pGXgflaoG3jGtpFydFMk31K/pvOW/S14esDX/pEVCLDKPhVTHZ379pPfk4+Z3HV5XNCsVg2jnC1AQoxsEc6z0lCgX2qCVuGZia3aZKsHqBqA0CA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001932; 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=fi9aT+bsAMZbea9xGjOg6WT7DxuyNb7QZLrpIwr9apE=; b=ZMMaFsWLL6+FTgch2lCn/K0+WfWOzr7nIw5YY3YS7z0m0hKQDDB29vvS+pUedxnnsfQmvyi8Eg1IM6onAt4BxAzcTd3xVL0jriWDKdLHyEEU8osePzhkbStobXAEEUoeahY3NhYYlSKBTTqJhLcUtnPfM6PSbrG7yiU4gGr0o6I= 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 16050019324121021.0291226957607; Tue, 10 Nov 2020 01:52:12 -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-82-ueR06djFOn2-eAHIi0nVFg-1; Tue, 10 Nov 2020 04:52:09 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A03C3186DD2E; Tue, 10 Nov 2020 09:52:03 +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 776035C1C4; Tue, 10 Nov 2020 09:52:03 +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 3BD2D922F8; Tue, 10 Nov 2020 09:52:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9pxj8006696 for ; Tue, 10 Nov 2020 04:51:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1275F94655; Tue, 10 Nov 2020 09:51:59 +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 0C3767AFD for ; Tue, 10 Nov 2020 09:51:59 +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 E88D31842082 for ; Tue, 10 Nov 2020 09:51:58 +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-481-UBVYDUhaMa-M-aOyz1hQtA-1; Tue, 10 Nov 2020 04:51:56 -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-nqsSXdWvPROU5rtpy146pg-9; Tue, 10 Nov 2020 10:51:54 +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:50 +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:50 +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:48 +0000 X-MC-Unique: ueR06djFOn2-eAHIi0nVFg-1 X-MC-Unique: UBVYDUhaMa-M-aOyz1hQtA-1 X-MC-Unique: nqsSXdWvPROU5rtpy146pg-9 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 12/13] virsh: Add lifecycle type completion to set-lifecycle-action command Date: Tue, 10 Nov 2020 17:51:03 +0800 Message-ID: <20201110095104.10783-13-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: 79e0a57d-794c-40e4-357a-08d8855e3ed7 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:923 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: /4U0BsCLQPIXmQxfbULHKWdhjmC8k6FVzB4fVf302C/nry/oAknNjhgd1tptMhtqwgI1zWXvt55vvViBv1iHDwQrIWY9W7JSOaUwxtu8Ykk+XUopnznWhe8CHS0pHK9mMSUhIcv7eh8L5FGl79lBPDKKhIIDnPxE3LLvtiBh2zt9+laWONgTCM+WMzQL5ELCcLMJ4dN6fkjvfjDhXvWTiYlE2ZTnk8VlpNprRboCcKFVdGgyypYzirDcs3vPPdtqkUW+Z02kS8YYY0KHy4TiYc1Wg1gmMOfb5omhkrht6SQb/iH8eHrzewXMSL9mp3SA+D0hnxmYiWqYeg7z7TTgYw== 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: lzIlvlTme0O3TouLS9TpRcVP7LVgSsnSH9Hc51FxqHSHoUQ+QJTU0Dn6wUUppT0gkCxOkI9PmB4747VXjkvY3zx981DDbiEm7V/4WR9CHI4WqMcoYjAUIRqOA2YeDGoNHy50UCWaNu1dncRTwd6BBS2abLr8BDUwZ9phleKa8NXMkkS/d7JszIT4LnX6CvPA5rHa/TAeoVJ8dNWFQ5O/lPYP+sxwOq7Qheg8G8Mj6gUs6J5vEXKGx24oEZo1ZSqAqabeYjhRV5guJohuZ2886SbZ2JeZJGb+233COKLPuGcCKRScnjaj3oJU35xd6GJi0Zy6bPostXp2SYC40/cmmvQuwZXi3XC7S5+dxJkOBezvNo6z7lhv5cEVm7WoDUOwOyfJSvZPJ+FI1SzwDMMh2gH70bwvoFwOFsmCUFFqUB99c0xxsMTUWlhIH+HuPqZYfVxnbxB5QCdNq+iwD1QOCrb/4QvQftzSg2g4P5EYzkcVmF071ef7v3hFdwm7qYismLsRitLf7isJSGwRK6c1cU1l2sQg3Bo+9U+blERrjWbApnyHvu2/alyfjQ8piiHkw3Bxlk+WWCk69UBN6inq66k5thSGDoyRNme/mNsZbEaQVdtPdY7O0ZW4XEZ1pLBxp5y+C2XRJby66SeSEgK+ovXo0Yyum2zT93l9ssDCWkZJWUHkscSUHdo0/qL0D9IpuWjBY9Im585fSDEXrg6S0tsOdFMW1M9GyYmhdhDAWNUPvjhg/1Z5RJGwDUPyILKGMeTGtvu2ThVmEHw9gjIdEQmYZczUcbKaYI7xahtuf+Yw5DwBpXU9aztbQDijANKXvNUtrUkvKcVYceo1FecfPgkZgGPmb7RS+Yd8WdE8iR2NhkHgmeJW/URcYLh7/i8Q5QFfCSXV8jGd/1Jr3omvuQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79e0a57d-794c-40e4-357a-08d8855e3ed7 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:50.4384 (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: 2R/12LMhRXtLpz50fXPo5bPYal5ESMb/6qcm0JyhrJcgEDlpZJYCqbsQRN+tvEkQ 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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9pxj8006696 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.16 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 Reviewed-by: Michal Privoznik --- 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 b8b6c74f8b..b1b670ffc5 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -731,3 +731,23 @@ virshDomainSignalCompleter(vshControl *ctl G_GNUC_UNUS= ED, =20 return g_steal_pointer(&tmp); } + +char ** +virshDomainLifecycleCompleter(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_LIFECYCLE_LAST + 1); + + for (i =3D 0; i < VIR_DOMAIN_LIFECYCLE_LAST; i++) { + const char *name =3D virDomainLifecycleTypeToString(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 cdec66f23e..70f6e30947 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -102,3 +102,7 @@ char ** virshDomainConsoleCompleter(vshControl *ctl, char ** virshDomainSignalCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainLifecycleCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1406bb4583..be91bd48fc 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5717,6 +5717,7 @@ static const vshCmdOptDef opts_setLifecycleAction[] = =3D { {.name =3D "type", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainLifecycleCompleter, .help =3D N_("lifecycle type to modify") }, {.name =3D "action", --=20 2.26.0 From nobody Thu May 2 15:37:56 2024 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=1605001935; cv=none; d=zohomail.com; s=zohoarc; b=EnMo+SxyR029xJoY6AcNjGG/C8Sa9zTtsuH4axzLumkEKXFbPn/LByzAvbW7AnQ9F0tb3kHdVccUjKADi7gYulpaY6soPS85Kz7T62lj6exmOv4bs+ahjKaceS23J2/N5BqYRHfr6x/B7W1drnG8G5xzKMd1VxxJ6+U0HBGR/Jw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605001935; 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=3KzmvLw7AwRuQ+1L/xRQmyVgPU0V7Znj+lxx3d9fRqw=; b=GbEY2shXI1ut4Z5bEQiQDxkYy4rOY+gxHMbeWsKQ+Vhq5N8qFjmJoy6UIqaCjZ0CZyCzJbBHKrXntYQ7PN7kXyRNyHtF59ILlRaXn9Gqo1rFx5jfcVgpHdO76z4bgWqtN35odFoSW6jlBjz18t3s2ayY6lnqFSI52UoH5FVML6o= 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 1605001935812525.6431787157513; Tue, 10 Nov 2020 01:52:15 -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-204-ophqkxTiN5yTJIkI5XKmCA-1; Tue, 10 Nov 2020 04:52:11 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D17C804751; Tue, 10 Nov 2020 09:52:05 +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 E9DAF73672; Tue, 10 Nov 2020 09:52:04 +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 59855181A2E5; Tue, 10 Nov 2020 09:52:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AA9q1L1006725 for ; Tue, 10 Nov 2020 04:52:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id CFD9694585; Tue, 10 Nov 2020 09:52:01 +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 C92399465C for ; Tue, 10 Nov 2020 09:52:01 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B12BA1021F85 for ; Tue, 10 Nov 2020 09:52:01 +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-283-OPqudUgNMcO6BINorQhCwQ-1; Tue, 10 Nov 2020 04:51:59 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2109.outbound.protection.outlook.com [104.47.17.109]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-5-2ME548qMMd65VUDRQ1z5Lg-1; Tue, 10 Nov 2020 10:51:56 +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:52 +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:52 +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:50 +0000 X-MC-Unique: ophqkxTiN5yTJIkI5XKmCA-1 X-MC-Unique: OPqudUgNMcO6BINorQhCwQ-1 X-MC-Unique: 2ME548qMMd65VUDRQ1z5Lg-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 13/13] Add lifecycle action completion to set-lifecycle-action command Date: Tue, 10 Nov 2020 17:51:04 +0800 Message-ID: <20201110095104.10783-14-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: 5862ed2b-4be2-46bf-f3f6-08d8855e400a 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:923 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: nd2/HXzC3UESUlw4T6s2CpdZcNtDsUMJubUZKb5mvK4uifEZxDF4oJg9cfiBSqK2KuITHYz0tuQDnqQ/8UkGWkotOlxTxMyev3x5JIWj1GUdf6Tn9C5LcvGf/t4vZ6OAdLzsnOituvFixNI+y7lcPlRSAMRED/BzR34AZUCo0fIwvWp/ATybFJecJbgk1Iq7cy4lP3objKE6YFSxHoA+Wg3LaMrz2OpFctKbJ6sBByhYOylBpJeAP2cW9rLf2Zbc3s9Cw4cDYAmeOMSxlkE16P0hftkIn2XQYOTQCCLB4etSmQHPL4ahQp8CJCykXNs0A0d8Z67Xf1+BcMhMMZgYdA== 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: 11+730gXmHrD2xaQz7wNiQ2eVtbB65sEy3Vxkxhyx3xIW2FiRcwrlfGNCucBOGQTLAGBf8QBRaAV3IaNaIbTqiwLTNzsyINC+2s97jLjnjknoEbQcKxFdk8bCHqjAHDZ8WOcbqrnShPwD26nlUc2Nt20tnWil88qmYsCYhPc3oQq5GuxmtrXcMGhH3mJalf3FR9XUCerYYH0ZigtNf0U/soIzpJU2H6CMFQxkhhDbeG9WdbBbJ61zJegi1Bu9LIIIHwN8TVMW9Z2YHaldt5RD6dUY3CQdG83yWJhC0V5qwI7Kh69mkzzDnLFcGJWLWWxj9oFI2w/79A4XhpGDXaQoQs9jXPHTvi+3YBL2IeIQhhqBAAur//xcl2wnzYLMqyoQxJyuM9g8nURq1IJJiIfac51y1s5VS+HTycCSStCpmCeItJR3EFDYaEf5JH4ZDE4joyNhYqp3p8orjqb7VD+p0ItO4Xt1BIWHfpW3vb9YHiHR+VOGT7+GegQghPg0STzqY3EnSplFroGL9EHi3sJoIZb4ee2lHyBL/7N0uqf+9TqGX1XJ9pM1mpwlwQ2TYg5kZ1hQpUtzbDgDz9vk1ynWaSz259Ez3+u6/Pd0rV2xCUlZNMpWx88DkiHjNmZQB956rjUXU5NEeWmjHEn7ew+1dT2bUdBr81xTQS294U2LaieWtTdSDQCIYTnyi0EsN6P4gKgRcirv5epyh3wBSYr21ZBISUNiEUoTjtVBnL2v1P+E8cT1JXyZYRdivkqwYb44U7IJADkLe4rtgpMz+8va3hsIXYVti002g3FBv8gxn0MWqT/Yri7vNbkGNfLtJD79r1/Grw+4uIOYDCZTngyE7pr1rXeg6yPxiNA4SsJsOESPkhKQ+Aed6tUBJ9YaWVRpyQHRloKNIgr55JGJISRRw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5862ed2b-4be2-46bf-f3f6-08d8855e400a 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:52.5552 (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: I1ZubIPYobnoJFsLT3pCNA0ryCmB5t58iUVKOyic8k6CgGnUhWDo8lefciG6xdYd 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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0AA9q1L1006725 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.13 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 Reviewed-by: Michal Privoznik --- 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 b1b670ffc5..a44ee65642 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -751,3 +751,23 @@ virshDomainLifecycleCompleter(vshControl *ctl G_GNUC_U= NUSED, =20 return g_steal_pointer(&tmp); } + +char ** +virshDomainLifecycleActionCompleter(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_LIFECYCLE_ACTION_LAST + 1); + + for (i =3D 0; i < VIR_DOMAIN_LIFECYCLE_ACTION_LAST; i++) { + const char *action =3D virDomainLifecycleActionTypeToString(i); + tmp[i] =3D g_strdup(action); + } + + return g_steal_pointer(&tmp); +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 70f6e30947..92c57bce75 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -106,3 +106,7 @@ char ** virshDomainSignalCompleter(vshControl *ctl, char ** virshDomainLifecycleCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainLifecycleActionCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index be91bd48fc..12b35c037d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5723,6 +5723,7 @@ static const vshCmdOptDef opts_setLifecycleAction[] = =3D { {.name =3D "action", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainLifecycleActionCompleter, .help =3D N_("lifecycle action to set") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, --=20 2.26.0