From nobody Mon May 6 15:11:31 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=1604305626; cv=none; d=zohomail.com; s=zohoarc; b=gykfJsMWDB43mN/qmXiW1L2VKQc6jMVh9IxHDRpvkxSkDeasFaPdjWy5Dp36mGv4UJlNJDYqwlJJeQjPdCg44o0/iLL2vNi1j3EkgLAHKAfA8WodPAT+ZP9qoLEIKmUundidQesoRTghAkLy6VKvCphQyTPCdBh/BDp76IDXSFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305626; 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=BIUH9sT9U43o/mqHs3E/jGjnLp+E6J7T6N3vcDRIbqM=; b=QZfnx3N2JLaTgiGPrgH8Qglvi7CWjo4VuV3c5n69dUtwNceKQdYuQ2++RcqFFfRkWb4gcmSyuyopDm2l7GASCJnolmAw+JSF2Mob8w9pdTCQJd/kgcDYf43e/NU6j6meiHeBcvktev0nXetmkz0IL/sSao6iRB5S00sWV6+ucGc= 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 1604305626825894.7158406743879; Mon, 2 Nov 2020 00:27:06 -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-454-yvZPkkqoPxiMjPb-awKTdw-1; Mon, 02 Nov 2020 03:27:02 -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 48B2C185A0E1; Mon, 2 Nov 2020 08:26:57 +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 690DD5D9DD; Mon, 2 Nov 2020 08:26: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 741A78C7A7; Mon, 2 Nov 2020 08:26:54 +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 0A28QqnY031183 for ; Mon, 2 Nov 2020 03:26:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 27BCB47CE3; Mon, 2 Nov 2020 08:26:52 +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 20CAC47CDC for ; Mon, 2 Nov 2020 08:26:49 +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 8A2E6185A78B for ; Mon, 2 Nov 2020 08:26:49 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-258-kwro8gjeOvKqC3rjDDJn6Q-1; Mon, 02 Nov 2020 03:26:46 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-A7BwOp5gNzSO6f-fvyNJ_w-3; Mon, 02 Nov 2020 09:26:43 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:41 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:41 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:39 +0000 X-MC-Unique: yvZPkkqoPxiMjPb-awKTdw-1 X-MC-Unique: kwro8gjeOvKqC3rjDDJn6Q-1 X-MC-Unique: A7BwOp5gNzSO6f-fvyNJ_w-3 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/19] virsh: Add current vcpu list completion to guestvcpus command Date: Mon, 2 Nov 2020 16:26:03 +0800 Message-ID: <20201102082621.13228-2-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d90dbd4a-6d28-4b2e-5872-08d87f090617 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:3826 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: uXOv21TYmYlmEGB0pkCY5WcZIawoep60DSD0X8ygJTbLTIFlOgkwtET+aEV/7AZgkjy1kBwBcGgKJ4tzSw8Dc2rWlGambG2CfdCUhyC2/5OUrPRzJ0wOWs1FY2ZNxr6/wZ/8Ss5nk+9F8c5mJXfEBu/amPTCzJ96VX767MGKRyP0TkXYEwRWSDMwIlxa0OfKvc4j5qL1MKjQOc1+r68offhrwVu05HOSLep3mUVMF5peqrXScBW29qijzNiWPEM2me12wnWElybJ9M4A+y6e+gOIKhre0fTN8CjVdg2hb41FzP1LnCUwAuUj1PSrXSyO 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: X6bG3RA7cnS+g+MLRzJhk46hNtcuV+ZBBP2YPsPxREESeYqjiauJPp6bZJ8mRq8XEpI7YB1zPfXS8z+TCMdy6Q12SIP1/sZlMcOuhPPJP6BBxHTivYoBHM3LRxIkSJDw0QGdkask5f3coAghEG+oYW77+xW2lntIob5JkZTeUY7ANDxEb1qzpzO5r/6Vh+GbxrDJKl/SqLRWaO2F+9oYC9Q2jbosnsmH7JqgW9oJiV8PQttnpsSniC9aIIjPu3NYk23hCf1zLmTda3TmvKYblJCandkPU1sGLleIXnO0gKi33bINykzwaM8UfFU8A1ue4u6SJu0EC0nkGUM7VQhWqt37XD2ps6a3SFHH+USeMwotfhoj0YJYVjz2s13YsucAok0yjhRurivW63MX4zYbiiGU5sI09dEe6Lwm5M2bfSE0s3oID8wJoSqiBUKHU6xIeH0sYJKEpmC1Wvfo5tgo/cUrsDATpB4bQEgBa7eGCnIifNdz9qxXrLrdYPXiTqkCWloaFurshOR0SqctU8wZptS0oUWHo2GJy0wk+lToqIQeznwqlBSoWSj8arpWuzCknsq0hEShNixflFA+tAAVl73AiSGL7ciN2JAdUenwe23n0aiz+i2r5+aflmbTVo1w4vbtGc3ibSD4P8/vScTUFg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: d90dbd4a-6d28-4b2e-5872-08d87f090617 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:41.0639 (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: a6cGc4rrUNYsYuWiHUoWJTvYi66bDcx728eNshjtstH0xUL1Mm2sWkhVJo++4z7T X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28QqnY031183 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" Unlike the setvcpu command, The option --cpulist of guestvcpus command means the current vcpus list, rather than the maxvcpus list. Signed-off-by: Lin Ma --- tools/virsh-completer-domain.c | 36 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++++ tools/virsh-domain.c | 1 + 3 files changed, 41 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index c657627ac1..6f67c91746 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -581,3 +581,39 @@ virshDomainCpulistCompleter(vshControl *ctl, =20 return virshCommaStringListComplete(cpuid, (const char **)cpulist); } + +char ** +virshDomainVcpulistViaAgentCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virDomainPtr dom =3D NULL; + int nvcpus; + unsigned int id; + VIR_AUTOSTRINGLIST cpulist =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)) < = 0) + goto cleanup; + + cpulist =3D g_new0(char *, nvcpus + 1); + + for (id =3D 0; id < nvcpus; id++) + cpulist[id] =3D g_strdup_printf("%u", id); + + ret =3D virshCommaStringListComplete(vcpuid, (const char **)cpulist); + + cleanup: + 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 ef347585e8..c051b047ea 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 Mon May 6 15:11:31 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=1604305652; cv=none; d=zohomail.com; s=zohoarc; b=lhGslodYWfYAQjVreOGN17qeiXopKq3czAx5n1dp3gFOiCIosmOvfgXBNh6/ItWdRag+UjlFwpURwKIMIHrSNfAXKTV8f2oj3mBNiMLH8wwnb9BbLzrTjuq2eQuLfor670NkIC/RRmSytmv4ZutAom8BeXHqKcWXihJaK3Yl6Uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305652; 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=ZDOiF0m7g8qlW1y0EaJlJodUNM41088kchIUZXMlAf4=; b=PoUSmMfBRSCyojje4eJZfk7yYkxMlXgcrBD2og4J8DtEb/qxmnkVhV4pv9W20mdFdESmMhyf6k0+QTNn7KvqQeDQQdXvn2PRdVePnxpPe8jbpO/apGPzJyPQFnNqipj+vtmrX/3J/joL4FCKMgRjOoywQmpq4fy5hymvaCsTBbc= 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 1604305652846757.1189726085177; Mon, 2 Nov 2020 00:27:32 -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-58-ToHYkBQuNVufxuHFs_VNhA-1; Mon, 02 Nov 2020 03:27:29 -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 82F491084C8B; Mon, 2 Nov 2020 08:27:17 +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 5CF096716C; Mon, 2 Nov 2020 08:27:17 +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 264BB8C7B8; Mon, 2 Nov 2020 08:27:17 +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 0A28QvwV031214 for ; Mon, 2 Nov 2020 03:26:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id D1F2B2156A37; Mon, 2 Nov 2020 08:26:57 +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 CB9582157F26 for ; Mon, 2 Nov 2020 08:26:55 +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 8778F811E76 for ; Mon, 2 Nov 2020 08:26:55 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-7LXj4K_tNuix4RNiCWKkqw-1; Mon, 02 Nov 2020 03:26:51 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-diTxNvpdNQiclerCnidd6w-5; Mon, 02 Nov 2020 09:26:46 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:43 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:43 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:41 +0000 X-MC-Unique: ToHYkBQuNVufxuHFs_VNhA-1 X-MC-Unique: 7LXj4K_tNuix4RNiCWKkqw-1 X-MC-Unique: diTxNvpdNQiclerCnidd6w-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/19] virsh: Add logical CPU IDs completion for nodecpustats command Date: Mon, 2 Nov 2020 16:26:04 +0800 Message-ID: <20201102082621.13228-3-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 440b12f6-57a4-4c46-bf90-08d87f09079d X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:200 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 8gHQKWrtkzHgyjxn5U1IS/oq/rixn9CkYWWl3NZVWV1nQ1ohyyXTZQr3EKLREy7FQCiuaYJz7AVuBuh7Iuomu9SVndGFXUWbsNT/N6qtroU5T/4lMv4QsFZSTxPFbkwXoQ3H7AihNb8r1MCcpUhbzR065im1CtS4AkjAzfhJEznkClj2+UrcQAWUzWpNVrz9YYVjON3Kwv1hb5HQAjPSV8PSlANLdGmKZ+h/T+w5fiWOlByNLxVtMgFPILO+V9KZIPQ/8koQfXwQ6DvCs2HnaIJlHTB/j1HrwyXlZmvUQzu5+LniZXOnEDu8Gq4IPMt/XV+Ypf7VngOvd5tY2e+oPA== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: pNvRK8ZigYu1o8y2dzGqU08wI6OKCi/t7HloqQ01pWJmiTASmHwuWMwldb9D/0aTYzEmM9UoqN8UsTrMCbRdQV6ekxnZ+zi3F53rESVXClXdz3dMtbaZHYtgUuyoescRnLRoCjW9eEeKrtu7s6d/YDp6VRuc/ubdx5Mi722tD/sbrO0oFTG5556+1bjoZO6Z1LMpMxLpRZqxnGTzfdKZfwScSEi/QeXm0m1TyeW3LjGoDK7fRvAnXIhs7UTIxcll9SmZLMy+nAie9pqbQT7WSyNUrSLWvFtBNDow7wUxE9Xn8NWlrsRwxsF46XlFVdrVLFgk1dR2Q5Z/1nUb4kxIAjxKfmek1a78olGzBsqVobBF7+JDG94iFda7mkbaNqZeRIxp5TxOIkJHZXDvoJyYqk62wqAAA9n7g72hUZhM0rc4PkunYuuawtiSGScxQiEypLgfROP7dhSanL74aCYTpHv135DYpGBrakH3smB4aDbxQG8q3vZiy24Qp6t9xzgbu2zS2fOoQ2RM1LesxQIrHdNXHNbi+7T1i9WIPht8udqdoaL8aU6bFGkekOWu2QIEHUi9rriFTmkq4fcAwYG6sbqjJRuxbh/69QBgxIOSKTqeoTbgFXZvXc6wVI7Zx8WTOIfupjq6NW+TN6EBdlvJqA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 440b12f6-57a4-4c46-bf90-08d87f09079d X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:43.5864 (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: dw12Dj/JEQMiTlGR3lOIgxrsoV/PxXMQEsGxfq03FFin/49BEBnS37iF+S6leQY0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28QvwV031214 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-completer-host.c | 35 +++++++++++++++++++++++++++++++++++ tools/virsh-completer-host.h | 4 ++++ tools/virsh-host.c | 1 + 3 files changed, 40 insertions(+) diff --git a/tools/virsh-completer-host.c b/tools/virsh-completer-host.c index 339390aa00..a74578d2e2 100644 --- a/tools/virsh-completer-host.c +++ b/tools/virsh-completer-host.c @@ -136,3 +136,38 @@ virshCellnoCompleter(vshControl *ctl, =20 return g_steal_pointer(&tmp); } + + +char ** +virshCpuCompleter(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + int i, cpuid =3D 0, cpunum, offset =3D 0; + unsigned int online; + g_autofree unsigned char *cpumap =3D NULL; + char **ret =3D NULL; + VIR_AUTOSTRINGLIST tmp =3D NULL; + virshControlPtr priv =3D ctl->privData; + + 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, cpuid) =3D=3D 0) { + offset +=3D 1; + cpuid +=3D 1; + continue; + } else { + tmp[i - offset] =3D g_strdup_printf("%u", cpuid++); + } + } + + ret =3D g_steal_pointer(&tmp); + + return ret; +} 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 Mon May 6 15:11:31 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=1604305643; cv=none; d=zohomail.com; s=zohoarc; b=Vj6TL+OsBfYUPfskBsDp1nAdCEgzyL2JXClJnSiltli7q5kdOsYWDJG60xCB3GpTFbVMV3sHACjsfqGahbz8amkSx9gC697zv1moxQM6R1MB1ghHx0xK1qWgndk3Dw4K4pWGXmCV+JAD/ItA6/1Zsjl3IbDY+HyU3/faLRIbYyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305643; 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=RNlTsv9EqxnOQGDEXmJztSFNYXKbrZ9Sbvpjd4TcQXQ=; b=Qx2jNo6sUA7NyeexPvxqIZOs89rzf2Fc9sHSjKuht9Kjm4RfUZLVLd4czqGzsHKJwdSDU8EerjqFRgVwZxDR0WaCgZWYurnUF5RuvPHw+wT8tzqBFG9f/Cg8sFnBJ4h23Z42oFWW8jxgJbK63+PlE4yqA9texmAIA9VuUXA9HW4= 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 1604305643847109.79274852563435; Mon, 2 Nov 2020 00:27:23 -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-207-156hiSG8McKUP0Ez7A11sg-1; Mon, 02 Nov 2020 03:27:20 -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 9C23C809DC6; Mon, 2 Nov 2020 08:27:14 +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 790A76EF7F; Mon, 2 Nov 2020 08:27:14 +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 454D6181A07C; Mon, 2 Nov 2020 08:27:14 +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 0A28QvBd031212 for ; Mon, 2 Nov 2020 03:26:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id B9A44205EB1A; Mon, 2 Nov 2020 08:26:57 +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 B35B0205EB18 for ; Mon, 2 Nov 2020 08:26:54 +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 66C5D8007A4 for ; Mon, 2 Nov 2020 08:26:54 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-PSdMRx4WN7S4gG5wHUJ5HA-1; Mon, 02 Nov 2020 03:26:52 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-Oo3LG4zuOrudtnAcoZWpcA-6; Mon, 02 Nov 2020 09:26:49 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:45 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:45 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:43 +0000 X-MC-Unique: 156hiSG8McKUP0Ez7A11sg-1 X-MC-Unique: PSdMRx4WN7S4gG5wHUJ5HA-1 X-MC-Unique: Oo3LG4zuOrudtnAcoZWpcA-6 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/19] virsh: Add serial/parallel device name completion to console command Date: Mon, 2 Nov 2020 16:26:05 +0800 Message-ID: <20201102082621.13228-4-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ff5c6b8-0ffe-4164-b2b6-08d87f0908d4 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:494 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: Q3q91OY8ykLWvHCEVP/SNzQapYUJIeroZKELN+SI6wsVdD1poPOl6FqSwMJ01j+I+BcRCAN+yW1dCorT8/P3naLvGRrzXt4zf14SBDo1U0FnCvZ86QUmz/nq9LjhoD3jH4p8P3UoswyLSLqvHjF6NKHRbz6V/wxlPx19uxgd5hueu6I09AhUG7+iK7j2KhWRtUr0SN6Fn6BaehxJSQTxP1djuiS605cGb29lza3XOffcKVZbuSd6mEghwhm/QrpzjdKLcOs7hWvGKBsFWIkSUzt3Iqw6Q3TwdkMtuQ5is/dCz3SFt7Jak87DcLOhn4BhXfX7u1HoxsQE10BUusa6qQ== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: sU5GYBL/e0+jZWTbNkKo0bDRnyGw06mJNiCOREFDVYJh3xldoQyMAupScjbdsBDrGOFkELKADmWUwx3TaBx+a2ELgy6jq07G77j91o/yf8JwVf0EJFXTNjmfGe277Qt0wGmVbn5E5wL7eA09F7eZ7Ko+IoMS5Y+9L7NAZQ033aWrY7mfK1THeJ1HKK/TfHiI6T302tuFaehYV7VaYElUrPtI64mpo5cd0TfUSKF3/9WRGWmvC9abJPjSnb2T4imDzlx7Og7UETYTUtkbZX2Dfc8tqc8SnPEiispGjyABSFla6fLeNkFoyaqYTTiM53NRJvimlV5tXbwv5lM+u4xkyY+hnWO6H1tjTYYPpr850033KIWGKj7+6BFLKL8egmVAIvMt0twLppu0436q83ch1JqSQQqGKKhPVM1cR1o2oB28r8wI4mFFb4Ei+9dB8kC5CUuYUlMSP+ho9yg/ZER3KifgwnHdMqijOR05iREuqdD+HG1xTLipz0UqV0DS40Flwo67qJ5kEyeb6VM99xa/NyoqVe6Du/jNcZPiw2zg4b1sstIcxlNgLJ6pZI71KU7b2JScLProIePp4aL4PyYvooConkr/hmYG2cnVUI/3+8HLbam70O2Cxo04KopFCquMEBLcwHznl8UMiZQkBG1tdQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ff5c6b8-0ffe-4164-b2b6-08d87f0908d4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:45.6253 (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: hhUnuk7KMpArDI5kP2e1LZ/vwmbH4f3smoBR2arOx9oFesktRbD7t9/4skQIlAIW X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28QvBd031212 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 --- tools/virsh-completer-domain.c | 54 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 +++ tools/virsh-domain.c | 1 + 3 files changed, 59 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 6f67c91746..ab81a0dcfe 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -617,3 +617,57 @@ 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, nparallels, offset =3D 0, head; + g_autofree xmlNodePtr *serials =3D NULL; + g_autofree xmlNodePtr *parallels =3D NULL; + size_t i; + 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")) + offset +=3D 1; + else + tmp[i - offset] =3D virXPathString("string(./alias/@name)", ct= xt); + } + + head =3D i - offset; + offset =3D 0; + + for (i =3D 0; i < nparallels; i++) { + ctxt->node =3D parallels[i]; + if (STRNEQ(virXPathString("string(./@type)", ctxt), "pty")) + offset +=3D 1; + else + tmp[head + i - offset] =3D virXPathString("string(./alias/@nam= e)", 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 c051b047ea..7189c8c826 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 Mon May 6 15:11:31 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=1604305644; cv=none; d=zohomail.com; s=zohoarc; b=Eco6wLRDw0emjNnGb1Wl6S0D46m3PNlIs4PlW++9p2CxQTXV0plB/r+NHxeKF5oyzSaYE3z5VDxnTQvYCXbdHz8fW34t4qkrt9rzfLjr9hdsv0RLuo7oHzpXixjhKVBdp34XtEo7PvkgJjoKEWZ5VgNBVLXHG9KgWa0ERmnbCEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305644; 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=P2wOQeXibI2JaaTexQMMTRBxNoVCcJi51FJTnCj6w8s=; b=BaABoAdyiH4BjDNYUCHIyIHJWBqDTzTkMu3Jz9MwQ56XgFzE8+cw0kZpd9NeH3I9+t4gtdQPFVaBSg25ARKShd318TafUv9XjQTCLk6ZJ4t5X4NiICtl9LEFXTfHZmahKJZtZ6IZVRo+GwpL6JV4+YPZmp36zw+wO7ljoKzuGJ8= 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 1604305644254623.9066563138606; Mon, 2 Nov 2020 00:27:24 -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-325-gpbtcxyVO2yC2rOggzjw0A-1; Mon, 02 Nov 2020 03:27:20 -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 9DDD6809DC7; Mon, 2 Nov 2020 08:27:14 +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 7BF4D62A14; Mon, 2 Nov 2020 08:27:14 +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 48F31181A07D; Mon, 2 Nov 2020 08:27:14 +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 0A28QvnU031213 for ; Mon, 2 Nov 2020 03:26:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id D1CB62156A36; Mon, 2 Nov 2020 08:26:57 +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 CB8682157F23 for ; Mon, 2 Nov 2020 08:26:56 +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 8B5D2185A790 for ; Mon, 2 Nov 2020 08:26:56 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-559-o9_zzu1EPY6DnWj83AMYTQ-1; Mon, 02 Nov 2020 03:26:54 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-vv2YKATJM0iSUif2tvJmPg-7; Mon, 02 Nov 2020 09:26:51 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:47 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:47 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:45 +0000 X-MC-Unique: gpbtcxyVO2yC2rOggzjw0A-1 X-MC-Unique: o9_zzu1EPY6DnWj83AMYTQ-1 X-MC-Unique: vv2YKATJM0iSUif2tvJmPg-7 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/19] virsh: Rename virshInterfaceNameCompleter to virshInterfaceCompleter Date: Mon, 2 Nov 2020 16:26:06 +0800 Message-ID: <20201102082621.13228-5-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01039335-164e-448a-a5e2-08d87f090a0b X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: OIlckSk/YPttIB8onu85IhQupFvkvr4HXW1fHZn6kZJi9Vo6IGEx/O1nb/48vVWyWJptF4uKePoI4z+tL8C6dSpaD6GeRdSsxNwYGpVVCJfPivQL1hYFqU+94+hkve+XikLHynXfnIp/jpMA0T+qNRHILcG2MT7oXm5qSP00nqnSD0zjAx3YgnTHtLcK3Y5DLFLVFljfZ9AmWPeXV7tNsQ3ucC0guy6J2EH3rzdKcuRgldM86nkxCqPyudD43+RAxSrZS6svu6yBOs0p16ZfP36yTB0OdWGfhzGBBRzXYa6BhyM3Kv0WDwUSVyXxitunOD2qZmQvC695pCuRAUtWDe49gv2gOKwu+NYToDEAHwKJycSOL4/5W3WN6L44/Rmh 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007)(145543001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: wrb9x4rfdqKxV8ua3LH669PCQdKMpmAETKN/G6cYMLXROQ+MnGntKYZ+DasF2DvM5ha7lUh+ydyyjhzaBea1nIFPNR2H1P0Sz3KufH/nRCrt7QwMAh3PCWOGXHtYD4IfKpXs4o835CEkWci2pulmBZEAogJ6cPLRoZE9SVvAz1ejnorKMR5+LjGZvw4jr7F6sK+Bf7x7eoZriT3QpVYS0ssOaAK0cy2QQMfehuVTwy/7uCYadq2L6tlmpJBhKjgj6mCcsHjEthVpVkD+4CPszkNl4cA0qEEesJbv4pccmpxwjQGCPxgmDjq2mImqhwrCw3ZfwwOEgIH1UJXtpqYWC4k/WNmqYaFMVhj1Xl30KXJ+yY+iB8spvZWxCCimG8bWHo76GA4cZIExJAbhBqxg/4ACpa4BpGQ5PhIQ3o2QLZGRpd7fM9wOUjxjKwtShuwQ7UQAGO6Os/XCzs35QXsdG0k4YHJa01xmeajjD4w3rSrNrHPwRu9mbXK46yw4/cfmWaPb4kn7i/LQ+uN0bDRHyAi+zjicGqJ/XikRoCujQQbrkEVSWYRbN451m5kGd41oUMSNigrRqHnyZflg6XRfFDNe8JNfcYc1JP3otXXLWhhBR5LU+tiwWWdMJK+LDvmacIKVUGeRBxf1KbILZ26AaQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01039335-164e-448a-a5e2-08d87f090a0b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:47.6621 (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: b6nHd6e4EQ1+aWMxUcsLrsaRcvRJ4dhyLcfi1ZX8riVy74LazYM805Gtmz1h/g0a X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28QvnU031213 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" Rename the function virshInterfaceNameCompleter to virshInterfaceCompleter to make it a bit more generic. The upcoming patch invokes it for mac completion. Signed-off-by: Lin Ma --- tools/virsh-completer-interface.c | 6 +++--- tools/virsh-completer-interface.h | 6 +++--- tools/virsh-interface.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-inte= rface.c index 8028db8746..777bb22b0b 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -26,9 +26,9 @@ #include "virstring.h" =20 char ** -virshInterfaceNameCompleter(vshControl *ctl, - const vshCmd *cmd G_GNUC_UNUSED, - unsigned int flags) +virshInterfaceCompleter(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) { virshControlPtr priv =3D ctl->privData; virInterfacePtr *ifaces =3D NULL; diff --git a/tools/virsh-completer-interface.h b/tools/virsh-completer-inte= rface.h index 893dee5a6b..2b382222d7 100644 --- a/tools/virsh-completer-interface.h +++ b/tools/virsh-completer-interface.h @@ -22,6 +22,6 @@ =20 #include "vsh.h" =20 -char ** virshInterfaceNameCompleter(vshControl *ctl, - const vshCmd *cmd, - unsigned int flags); +char ** virshInterfaceCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 8cdbc6e85f..bd57648779 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -23,7 +23,7 @@ .type =3D VSH_OT_DATA, \ .flags =3D VSH_OFLAG_REQ, \ .help =3D N_("interface name or MAC address"), \ - .completer =3D virshInterfaceNameCompleter, \ + .completer =3D virshInterfaceCompleter, \ .completer_flags =3D cflags, \ } =20 --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305653; cv=none; d=zohomail.com; s=zohoarc; b=J/CEUZo+0KbHYwh0Yl6m3Q8DMqgmu+W0d6Q4fV7Jb+M0mkC8hQW1p+al5xAFCjGFtVVgcKSmd3wF0u7/gDj8LDkkQfLPI2iysACYauwWVaS8A60+4kcShY468UPni3yyHqLJxs7cp4/eiilRN4xJ7imnXtWQ/v/RjxM14s/shIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305653; 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=Sv75RcRRqL7Y/ELsvjEF32a/wpifvWYdVnISaGDWTmo=; b=S20lu2XEH6Tz5RdtlReWHN7GjiL+EWvyqAc2t+ZRE08YWdOlsbArZJwub8hrCT/3DiL8O+qKhVx914NWSRa8Twq267F1MiYpOP4BQYTYJaYqbZ2UTiFRM9+TmRX9RxNlcyTJAvOY71WJqDPUfQdEYEoCphUL6NvTNaTob1H9iVk= 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 16043056531081014.930372399767; Mon, 2 Nov 2020 00:27:33 -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-284-9SMxZ7gfNZW7HA3f2iIkxw-1; Mon, 02 Nov 2020 03:27:29 -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 C965057087; Mon, 2 Nov 2020 08:27:22 +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 A953C5DA6B; Mon, 2 Nov 2020 08:27:22 +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 7534A8C7C1; Mon, 2 Nov 2020 08:27:22 +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 0A28QxIb031238 for ; Mon, 2 Nov 2020 03:26:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 78E762157F26; Mon, 2 Nov 2020 08:26:59 +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 72E962157F23 for ; Mon, 2 Nov 2020 08:26:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 4C37F800183 for ; Mon, 2 Nov 2020 08:26:59 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-unFK5QSjNh2MUed_PM9JjQ-1; Mon, 02 Nov 2020 03:26:56 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-BPsMvA5qPX6yqNTpF5aXUA-8; Mon, 02 Nov 2020 09:26:53 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:49 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:49 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:48 +0000 X-MC-Unique: 9SMxZ7gfNZW7HA3f2iIkxw-1 X-MC-Unique: unFK5QSjNh2MUed_PM9JjQ-1 X-MC-Unique: BPsMvA5qPX6yqNTpF5aXUA-8 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/19] virsh: create a macro with a _FULL suffix for common --interface option Date: Mon, 2 Nov 2020 16:26:07 +0800 Message-ID: <20201102082621.13228-6-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fe99070-41a9-4a2d-4670-08d87f090b44 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:25 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: kyHNZf1k3JFxtiXUd/TtrPinaZiJ/+pxEp8atBovqOoY6MKWkSZrXBfL5u2BRPNcXDAhaLWBpRD6JZWqYKrgbRLG3napx4fLz0HLzTv1L2Wm8VYRFWEulCcwlsuVjk+NzYJABkaVGUvYqFB0+aoKAwc/xzePsCoQWyqmz9VWddCyfXKopcMfLWtMc8jOV8kfEAImZF52eTRWsy0tQH02rZwiEfAeu8RkYY7GaCNZ4GMsotr4OEhXsECVRwWc7+Vq6t/nyBIVxNSQyzwgoqt1RezylUU9mxrXilQbOmUjepdQbdK+sirna706NlzMRd5b14+9ZESEJaFSViY9X11hOomIRb0OLpOTNWy5DCpzfjBUIxR98mtiZrM7UZH4G1t8rIzh+csEkqf7nhNdyqix9g== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: zqrzMOfp6yLRYOFwFZacI24QLiJZho6Xxh+ApqZWt86hldVjfECI0dbQiPXCghi+iZyr1mcsxqqctiKKXCm/ADMIC4IRd844ddnoKwEWpQOgh2JehfLBP53JW0w2ujqWRJFDgYUOoCeAdrm3ZXcYF7t0h2GL0Zp1ywEBgymr5G8LjSxkpPTrw/fON2tuPmSoKBT0WJlmbylFeOgUk6KEejx/Snt5pe8LUyndMXeVJ/GqvF4dRl51ln/LBBkdn0yv7so9XDVBkaaGKQY+Mf4sMKB4zdCmsgDdewbuGBk5QHfSDCfnwHkRXGXSVxhlQXIECSuXg9TCI9UKx3LWMFYTgLHKJhgX90tp0JbPfE+Rant3GbE6MQUQPDM0mmoJe+BTI1F/EdRYbr2oDy2pAcY/BCZilZuHj4zBnUnLCxEhhTHpbnl5Naumb3gN77QAOCvutFbOESiKWiIjjAaE5oruBaLEz/H6FjhMidyeibgSE9K+TncFSKfFCrkErzGh40AI9D2Fbi2b5+u8RperlPmcw8kii+sLbh5T9gF8jMiFFZ+ba7R0+H5eJgY0ZOrbBdlOM5gLVxir+xx8n0MJ6nm3/UKfOzIYrJuDqrcL78tZozP2xlynm9a/jaQPvsP/Z/hDWTaLi101vU4DZ5fEDM0Xlw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fe99070-41a9-4a2d-4670-08d87f090b44 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:49.7280 (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: axU95ugyhx/0TBJecfwPWuV1pmv5VezSiLqGd/ykRF09ZSWKyE1gsoSTUhLbM8pR X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28QxIb031238 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 --- tools/virsh-interface.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index bd57648779..6c47767754 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -18,15 +18,18 @@ * . */ =20 -#define VIRSH_COMMON_OPT_INTERFACE(cflags) \ +#define VIRSH_COMMON_OPT_INTERFACE(_helpstr, cflags) \ {.name =3D "interface", \ .type =3D VSH_OT_DATA, \ .flags =3D VSH_OFLAG_REQ, \ - .help =3D N_("interface name or MAC address"), \ + .help =3D _helpstr, \ .completer =3D virshInterfaceCompleter, \ .completer_flags =3D cflags, \ } =20 +#define VIRSH_COMMON_OPT_INTERFACE_FULL(cflags) \ + VIRSH_COMMON_OPT_INTERFACE(N_("interface name or MAC address"), cflags) + #include #include "virsh-interface.h" =20 @@ -101,7 +104,7 @@ static const vshCmdInfo info_interface_edit[] =3D { }; =20 static const vshCmdOptDef opts_interface_edit[] =3D { - VIRSH_COMMON_OPT_INTERFACE(0), + VIRSH_COMMON_OPT_INTERFACE_FULL(0), {.name =3D NULL} }; =20 @@ -473,7 +476,7 @@ static const vshCmdInfo info_interface_dumpxml[] =3D { }; =20 static const vshCmdOptDef opts_interface_dumpxml[] =3D { - VIRSH_COMMON_OPT_INTERFACE(0), + VIRSH_COMMON_OPT_INTERFACE_FULL(0), {.name =3D "inactive", .type =3D VSH_OT_BOOL, .help =3D N_("show inactive defined XML") @@ -570,7 +573,7 @@ static const vshCmdInfo info_interface_undefine[] =3D { }; =20 static const vshCmdOptDef opts_interface_undefine[] =3D { - VIRSH_COMMON_OPT_INTERFACE(0), + VIRSH_COMMON_OPT_INTERFACE_FULL(0), {.name =3D NULL} }; =20 @@ -609,7 +612,7 @@ static const vshCmdInfo info_interface_start[] =3D { }; =20 static const vshCmdOptDef opts_interface_start[] =3D { - VIRSH_COMMON_OPT_INTERFACE(VIR_CONNECT_LIST_INTERFACES_INACTIVE), + VIRSH_COMMON_OPT_INTERFACE_FULL(VIR_CONNECT_LIST_INTERFACES_INACTIVE), {.name =3D NULL} }; =20 @@ -648,7 +651,7 @@ static const vshCmdInfo info_interface_destroy[] =3D { }; =20 static const vshCmdOptDef opts_interface_destroy[] =3D { - VIRSH_COMMON_OPT_INTERFACE(VIR_CONNECT_LIST_INTERFACES_ACTIVE), + VIRSH_COMMON_OPT_INTERFACE_FULL(VIR_CONNECT_LIST_INTERFACES_ACTIVE), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305649; cv=none; d=zohomail.com; s=zohoarc; b=Wjk/ijVIKqIoDBYdGyeG89yufHVVGOyOp58DXoMkRs+On9GoHIWWYzQl2eeDgrCsjeGj4Ig5FQOL6mAnMrTL8u6ln4H/KeTJDhXZGgo5rVWxEiB4BvwbdxaBKVwecN92ieyBqr5abepW1bWi/e9L46JBaShCaAhawI4n2YPQR1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305649; 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=/Ta9uQPWTBqDXO4CPGN9GsueV2hcxMZNMXGcUyJWWxY=; b=RtrnVbSO9uD2gyias2he+e1zDCY/YWePsm5l2OieWziYlOAAuedtVqKmvT+e5VZSaKb0wywXSW+cSvrse85reNcBmYykJnj52v9afuQRulJaVgw1W2pJO15azVMbFmo1/E+SBzrxjbVuV8kenNjEMMMkIwhUU/Bo00JmN1LFJPk= 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 1604305649201139.7563474248567; Mon, 2 Nov 2020 00:27:29 -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-167-SGur8Dc6Nk-GDziEOnu5ZQ-1; Mon, 02 Nov 2020 03:27:23 -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 9B1811006CA3; Mon, 2 Nov 2020 08:27:17 +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 75F9B5C5B0; Mon, 2 Nov 2020 08:27:17 +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 41EBC8C7BC; Mon, 2 Nov 2020 08:27:17 +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 0A28R0W0031250 for ; Mon, 2 Nov 2020 03:27:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id EA1E81111A4F; Mon, 2 Nov 2020 08:26:59 +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 E53051111A41 for ; Mon, 2 Nov 2020 08:26:59 +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 CE7D9858298 for ; Mon, 2 Nov 2020 08:26:59 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-0s7pyLlTNP2BHsPRxp0kNg-1; Mon, 02 Nov 2020 03:26:57 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-35-wfXmqJzjPa2ahG3aBsq4Tw-5; Mon, 02 Nov 2020 09:26:54 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:51 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:51 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:50 +0000 X-MC-Unique: SGur8Dc6Nk-GDziEOnu5ZQ-1 X-MC-Unique: 0s7pyLlTNP2BHsPRxp0kNg-1 X-MC-Unique: wfXmqJzjPa2ahG3aBsq4Tw-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/19] virsh: Add interface name completion to iface-bridge command Date: Mon, 2 Nov 2020 16:26:08 +0800 Message-ID: <20201102082621.13228-7-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d5eb34d-9962-425f-27ae-08d87f090c83 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: YUULtNNiL25kw2aLuGIbCTJvaD7H8bdbirKfpMRXrzRwSHMQETIWXIo3+s2yYTa+PJUYZTP8jhoXlCWercuxlQWpGG3Cfao/+OqRjDBVb8G3gRStgDQZoPbsrGuVeJGpEfNH6pkBoVk8Ity+pAJ/2CY5UyfrDeB1+vudc2sXI3Pswj6eVxFQePRP/46axuuyuANnrr8txN+vZkmcjWkdRYXa9KZA3kSKUFLqvTVAtWZBs1p6bwyL0536BtTHuzSY56GQ3F/773QssXasduX7ddN7B+m4LlqTJMlfsFzvhlgcq9xsRnPgTjcA4/fFBIsgAGu2j4TAdos3TqURCaNrGw== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(4744005)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: syeS8ToQwYtGf41Z8G/UstGxFM03a2PV6u9/GlUzr+oqTMOOdwCU51EaeNvnbY+jobKZAtYOY0GuAo/6WZpAxNWEopJLvsSqc8LqIulZGBNG+dTVf/nxNYQX/YO/CKHxs+mNRU0/7AebPCs7sXcSZzrqGw1ATlwL5GvQOASk/W8rGuw4srThbB1GEdBGHhnRCDcAIhmZHrzCHAhGtNRYUIg4kzqeCFWUYylxe2dmXiJe1e7RUUs8t8vnxa+lE9merLioy5BQmN24Csxvw3e4yqyvUalFo2OkG5xkkNcy3iDI3YFX364aBjhctDaLixqQYI4juBQijfZbdsVrbd8m23xae9IgN1Mlhr1PLUNO67QXxxsmzOIWmIobCQIR6BHfcC+n+LkB+tNZQvhfJX3k0jI7QmtPNnkBPPjvU7gXJgrBNmjhKPrqIODK2GQuNGE9tJN5kvfaJmdtumcFxias+S78ktWfjvvjTtMcwKOj1Izkp+asB96cy1DgmzV6j5fjYeD4WFSUm3ls/8EOi56flHIh3ySwAFFmpOSybpgGftjbfnDB513i7JL9Xpd/uGvHYgqPvPnmpAahK/eWtU0kINY+vO9nsVlc4KEmfXw5kvZnsxwp8hok4+wfOaZqRz6GK+sUxVYolw3wPK2YBg24ug== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d5eb34d-9962-425f-27ae-08d87f090c83 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:51.7918 (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: QpKqLAxI1nJRxkQqcWE/oSBV5BJsg2LqwZZhOt6+pXkc+cychqNGI58Bfa1akOQO X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28R0W0031250 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 --- tools/virsh-interface.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 6c47767754..13e120d7a0 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -785,11 +785,7 @@ static const vshCmdInfo info_interface_bridge[] =3D { }; =20 static const vshCmdOptDef opts_interface_bridge[] =3D { - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .help =3D N_("existing interface name") - }, + VIRSH_COMMON_OPT_INTERFACE(N_("existing interface name"), 0), {.name =3D "bridge", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305683; cv=none; d=zohomail.com; s=zohoarc; b=Sn8ptbLSzkbVhe3BSNoauGqQf5ok7nFHy1vP95RFUlt++7HPiYNEXgw71gbaVHJ0AUxI+ozfklz0Cq42oDYM8CBQY4gnHDyYTkTFO+SgG7WLuDTq5bwdFx9yL0J7ztugrlrEdJ0M9qhFRU2Y8t13c0L3//Ggg8AQpPmEttUSUyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305683; 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=U4gbgQpJyLGliBaVSibsBvQkhumP9EZoc3ewDleVAds=; b=PJqUsTrmf0YK04OHH2ZioPTNdssLEPGQc+2unthVlRKxQ9KK8oxO6JfTSlALk2eBtXgF281mjFy2hexck3Vvan1gHb+UZYP7u+qGkmnv5Ou1//uEeAAvmTZ2/fISW5+J2g8z16T3PEXD8bw3tPJZy4Ghw0RQ5EqltCr6teH5YeU= 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 160430568351539.966132421480324; Mon, 2 Nov 2020 00:28:03 -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-386-n_QGgXzYM1eTfyypIbeNRg-1; Mon, 02 Nov 2020 03:27:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D25F6800050; Mon, 2 Nov 2020 08:27: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 A99065B4D5; Mon, 2 Nov 2020 08:27: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 65FB38C7B5; Mon, 2 Nov 2020 08:27: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 0A28R2LA031268 for ; Mon, 2 Nov 2020 03:27:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id EE86047CE3; Mon, 2 Nov 2020 08:27:01 +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 E840547CDC for ; Mon, 2 Nov 2020 08:27:01 +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 C0BD0185A790 for ; Mon, 2 Nov 2020 08:27:01 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-pB_qKe1pNNex_JBMMWMEbA-1; Mon, 02 Nov 2020 03:26:59 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2054.outbound.protection.outlook.com [104.47.1.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-35-JaDY6WUbPhGL1KwRVwGYYg-6; Mon, 02 Nov 2020 09:26:56 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:26:54 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:53 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:52 +0000 X-MC-Unique: n_QGgXzYM1eTfyypIbeNRg-1 X-MC-Unique: pB_qKe1pNNex_JBMMWMEbA-1 X-MC-Unique: JaDY6WUbPhGL1KwRVwGYYg-6 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/19] virsh: Add interface name completion to iface-mac command Date: Mon, 2 Nov 2020 16:26:09 +0800 Message-ID: <20201102082621.13228-8-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cf052c8-48b9-48df-aa30-08d87f090db7 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: lQ+Z2QFm+zSTvsM7/jhPZtXVV8hVRkWWF1FIMNY7CG0YuGcD5BfIDWih0g0Hi1HA8zXG5VwDfgV37qPG2V/x0ekp7tA59aI+/vkf5eb93qjcQXDECuBO1WQWb5nKTTGsk2v8n/mXo+5VH3Eq0AAUETxqT6FSSjgbY0vX6UoLf6RWbBA3mt2fyPvHjXjPUrTwv8lI1Omm05SSDe2hVKW7uF5vOBqZRZiRAgMV/QOXjHHe6Wh1oQ1Lmuq+P4HDsf26GuLh0riJNJsx/mXsBvt5QV3USa8zkNHlWU4upEn3lMRpmOxT1f9zZYgJcghxuWcieq+5J1nFZtWWtudjRC8U3Q== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(4744005)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: /4oIZKBCxigYwZ1gI6akhU2zDlwBlWmjajOakUDS30SfV49v9IxrZWEBTDjEV4e9uKaGLrrv/Du27mU6s9nLJcUHQn1/MRpZ+8koaPBIB/M4rPN2ElE4yTz85C5T2nsCjdBHy+G64s3WR2iatufb0Rs6+7fOo/KHixhar7JkqNu+jzo7Q1cTCvadsWL9/I8XWrQa12i2b/KjvH/p/WuI9LELlEXf0AalIMnEvMjAuX4KyEV7DxW8PTRz/iEMTBajZflBytPyCcXV4vBfIZIuDWVNfNFFJVV9fzSUiwC9dOu6uHfdsQWqY+0DBeMJJ6WYmQDWDeCjxnxkFWovZBsvnNys8vDpRPh1u2x7DyVpfcmTtbo9febIENTH1cQJbgsEu6YgwVVXEldZGj8SYCvuF10WHLlM1/dynPOy8g5yUZo7inrsDSkzkWVF3Qj9giBMZ1w/xzAkwECoq7xU8fceayRkPWjovVv4mtdDNrvsCcvsHbnkZeQG0mY/8vVlDf2/FEF5Gshrx3JdIQJ0X+aMARqAk9ashgV2vYt1n1uKOmURw3LXu+8DufjVJnBUWmCX0O/QyVT2YQtcu2/UAsv3eCJy5XpLf+kJa2j7WlpteRjauP3P1f0A9LpWC+dnGB7ewxQpsv/u5yZhbqAvlAz4IA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cf052c8-48b9-48df-aa30-08d87f090db7 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:53.8556 (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: cYP/alYjBUglTurc0lrLp8A5eTGHnHqSEqrOxEL50a+89D8vvI9XKD480fRVk4vp X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28R2LA031268 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-interface.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 13e120d7a0..df97b74c4c 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -440,11 +440,7 @@ static const vshCmdInfo info_interface_mac[] =3D { }; =20 static const vshCmdOptDef opts_interface_mac[] =3D { - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .help =3D N_("interface name") - }, + VIRSH_COMMON_OPT_INTERFACE(N_("interface name"), 0), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305653; cv=none; d=zohomail.com; s=zohoarc; b=WaKUZAUgd45sru+Z9+yp9VcuYjzVY2jGaSIAnzDujPG4Jev7x2R7bgHF9vgPaAmj2SCuW/eO+E96chUr/3xRIC3IUGk7a7SSr0AfW2diNqrU7oaCc667XHWivrB0SCewcKiK9UlRbQGb+YrKRyz6oj2whEkn+qq7PAbkd7LIhrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305653; 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=iSdvFGc+a48vrjTcWxA7D6jyCjUtJf7aLvaE1AyUd+I=; b=dnNNZAcsOfQGQPMFabzAa3RDAyCkmUJpW3iGNV+NVEmojaVx/fcE8aloRKnIh6GJGeVJ4q+reMaK2i2JNE1lpB4nuawwnWSb5CLepIjnFEfiql4sbMBIJG3PI36lECvuojb6LSzGXGLJEsYS0soNqqhu6BfeD3DIMNI2Hbpdc0I= 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 1604305653443774.1857701775577; Mon, 2 Nov 2020 00:27:33 -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-556-HeNuvnd7NUGC1vzBeEk2FQ-1; Mon, 02 Nov 2020 03:27:30 -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 726E257085; Mon, 2 Nov 2020 08:27:22 +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 5038C73660; Mon, 2 Nov 2020 08:27:22 +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 1B7A8181A6DF; Mon, 2 Nov 2020 08:27:22 +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 0A28RFX1031323 for ; Mon, 2 Nov 2020 03:27:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 03D3C1111A51; Mon, 2 Nov 2020 08:27:15 +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 F32731111A41 for ; Mon, 2 Nov 2020 08:27:09 +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 3BC2C185A790 for ; Mon, 2 Nov 2020 08:27:09 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-WnHaH5vLPTS9immZR1Pn8w-1; Mon, 02 Nov 2020 03:27:07 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2051.outbound.protection.outlook.com [104.47.6.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-11-eu1vujCeNRe8QpjbyaiqeQ-1; Mon, 02 Nov 2020 09:27:03 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3845.eurprd04.prod.outlook.com (2603:10a6:209:1b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Mon, 2 Nov 2020 08:26:56 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:26:56 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:54 +0000 X-MC-Unique: HeNuvnd7NUGC1vzBeEk2FQ-1 X-MC-Unique: WnHaH5vLPTS9immZR1Pn8w-1 X-MC-Unique: eu1vujCeNRe8QpjbyaiqeQ-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/19] virsh: Add interface mac completion to iface-name command Date: Mon, 2 Nov 2020 16:26:10 +0800 Message-ID: <20201102082621.13228-9-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c799b9e5-e7bb-40ed-fcea-08d87f090eef X-MS-TrafficTypeDiagnostic: AM6PR0402MB3845: 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: 6dIYiZnrTHck1mnfIUuk8fKDCBuq2fx4/q/HSe3vHwriHUbTZAQx4BLovrfSEo+BriKASMkMG6QYz/SeMeGVJNxH94qSq9Nu5gc5jho01eykpmK+H0cFJVgwXh7KuSPaEUFsQDRj/Ga+y4MKTAv/Tac62UFi/szan10VsJlJI7NFrrLN5yVCtK+a/9yOo9EFxY0UixlrkUZxB9rAleLSmJMJPqmqVdeZrHlgkz2XC+s5XLActsfDDSSaOTWwU3bhrbwyTFHECkoNnoz+XEgKDZqPFGJNAwOXyu8sqIqZXn25K4tXzdnjNrrQXZ8z3rbip81xvCJN2JnfUEWNATVpFQ== 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)(366004)(39860400002)(376002)(136003)(346002)(26005)(1076003)(6506007)(186003)(16526019)(956004)(52116002)(450100002)(83380400001)(4326008)(2906002)(5660300002)(2616005)(478600001)(55236004)(86362001)(6486002)(6916009)(8676002)(6512007)(8936002)(6666004)(316002)(66476007)(66946007)(107886003)(66556008)(36756003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: QEIQjsDGl+I0Lzs4PSQYF+7jEHaDeXW6SFiJ240FEAmXZDKPMr7YqKDhk1y5gcr0Z4aWn33NDtVWNWZQQgicQlQb4okwNqwF86h0s6oSNHZKCeHrhsi86fBysorketi5XY6oVNYTXO4S9GR9U01hVU0CzFcfnlSSJRd8/M5M7AV5rbGZkI6gqlwwaAYIO9fi5KyKnrDuP5qlIlWkM1iBW5VRTw0tDfkhJ46PDpCJ+1OWLX9ePAkAR1FKE4+ZnbBjvsFzI4jUJ3P8Fg/DmO8gRv3F9QdA49xv0/psjQ7Y5Eghxp99vpPsv+DN58dMhMSqg4766opAJXXUOyA7GE8pqS75unjiW5DvdJ/+39AVT0BG6omKcvgXlNIga3+sk2Btrm7e7ngNSkRy+ksmpQUkC4O2uMdvFIYAaL9iARBWtiSSCoxNJBMmA0usR8kLrYlo1kuzh22uNvwv0w1izIkzfk2rOb8N47HYsDBBNfqzy4+AT1pMDXsYJOs6uxjrdFFW7IwMiHUwSfUB6hTUacH0ZFZWQ8E7J0SV1dabo4ibUKVBmLBx/cipmW0xpBzpKVVzT9bHjLRJj0i/AESXbY5idcTsrQxlR4xsNLzY2zBnWOZY3LMdfNIbcvm5ds87jVD17LVnrn0ZKaq5S0himEV6wA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: c799b9e5-e7bb-40ed-fcea-08d87f090eef X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:55.8845 (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: GHGpYXgqGcsWqkxkQbnKHyG0X4TPoNeSCJB+L2KIQ7pifNxLph4WX4J+AElC4ttN X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3845 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 0A28RFX1031323 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 --- tools/virsh-completer-interface.c | 13 +++++++++---- tools/virsh-completer-interface.h | 4 ++++ tools/virsh-interface.c | 8 +++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-inte= rface.c index 777bb22b0b..c24a2cea6c 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -38,7 +38,8 @@ virshInterfaceCompleter(vshControl *ctl, VIR_AUTOSTRINGLIST tmp =3D NULL; =20 virCheckFlags(VIR_CONNECT_LIST_INTERFACES_ACTIVE | - VIR_CONNECT_LIST_INTERFACES_INACTIVE, + VIR_CONNECT_LIST_INTERFACES_INACTIVE | + VIRSH_INTERFACE_COMPLETER_MAC, NULL); =20 if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) @@ -50,9 +51,13 @@ virshInterfaceCompleter(vshControl *ctl, tmp =3D g_new0(char *, nifaces + 1); =20 for (i =3D 0; i < nifaces; i++) { - const char *name =3D virInterfaceGetName(ifaces[i]); - - tmp[i] =3D g_strdup(name); + if (!(flags & VIRSH_INTERFACE_COMPLETER_MAC)) { + const char *name =3D virInterfaceGetName(ifaces[i]); + tmp[i] =3D g_strdup(name); + } else { + const char *mac =3D virInterfaceGetMACString(ifaces[i]); + tmp[i] =3D g_strdup(mac); + } } =20 ret =3D g_steal_pointer(&tmp); diff --git a/tools/virsh-completer-interface.h b/tools/virsh-completer-inte= rface.h index 2b382222d7..71bc44c4b9 100644 --- a/tools/virsh-completer-interface.h +++ b/tools/virsh-completer-interface.h @@ -22,6 +22,10 @@ =20 #include "vsh.h" =20 +enum { + VIRSH_INTERFACE_COMPLETER_MAC =3D 1 << 0, +}; + char ** virshInterfaceCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index df97b74c4c..1dabc6e406 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -404,11 +404,9 @@ static const vshCmdInfo info_interface_name[] =3D { }; =20 static const vshCmdOptDef opts_interface_name[] =3D { - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .help =3D N_("interface mac") - }, + VIRSH_COMMON_OPT_INTERFACE(N_("interface mac"), + VIR_CONNECT_LIST_INTERFACES_ACTIVE | + VIRSH_INTERFACE_COMPLETER_MAC), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305656; cv=none; d=zohomail.com; s=zohoarc; b=U1CQEMwkKVvud2xsXId4ChVWkNsK91Xouj6+qLLEmj/VwGdHrNQnAzxTVWqrkutQ5ygwrIaW452Prvg4dxCVw5ZtwAF1M8R+UmnXxYoVPkPfjigjuN212lpYKNM9wuAFREBmCNAtl6XI9vjMZdf72dBs3ncRiogRBspxc53gyNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305656; 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=KJ3OomqzyNX1oxfaXrP+C8JQzRkMnMHvrzCbVIshKsA=; b=OTso6ewiap44Uhe1KDqC6YsjnCy2bzk3mCEMzKZdTx2igtnuFT9TLRz1Th7tGOwAQdWW9FsGouzRvs4aj1Hk9yDZbBU0vZbxyZR7EFND5OWWCb8VZq8TfTh/teF4djYU4VJa5o0/Kx46I6Kgac7htOV7274o00XUhcA+3p2xElE= 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 1604305656884689.4938221769368; Mon, 2 Nov 2020 00:27:36 -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-476-_jpim7eJPqWoZRdDhALHXA-1; Mon, 02 Nov 2020 03:27:32 -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 76B1A809DDF; Mon, 2 Nov 2020 08:27:25 +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 538DA62A14; Mon, 2 Nov 2020 08:27:25 +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 1AF7C181A870; Mon, 2 Nov 2020 08:27:25 +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 0A28RC6o031299 for ; Mon, 2 Nov 2020 03:27:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id CC24B49C1A; Mon, 2 Nov 2020 08:27:12 +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 C60C347CF6 for ; Mon, 2 Nov 2020 08:27:09 +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 2509C8007A4 for ; Mon, 2 Nov 2020 08:27:09 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-383-zk2saNstNxmcfNhkRollLA-1; Mon, 02 Nov 2020 03:27:07 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2057.outbound.protection.outlook.com [104.47.1.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-OeG7TrhpOFmkdzJo26J-iA-1; Mon, 02 Nov 2020 09:27:03 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:01 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:01 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:56 +0000 X-MC-Unique: _jpim7eJPqWoZRdDhALHXA-1 X-MC-Unique: zk2saNstNxmcfNhkRollLA-1 X-MC-Unique: OeG7TrhpOFmkdzJo26J-iA-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/19] virdomainobjlist: Add vnc into filter group to check the vnc existence of guest Date: Mon, 2 Nov 2020 16:26:11 +0800 Message-ID: <20201102082621.13228-10-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78ce83d2-bf2f-4b59-4f8d-08d87f091031 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: ZuIOFlC3LvWAIdNB92Nh50h5LDg+01Zet1iMjv2A4aar4obwjQTi+9dfLVzUtgBG19Ih+Y0GvIp4vg0buhNGxz5bxW+Iz4O1uN++TT2VM5NCyqO0hvcRpAx4fy/nipHBQ1CNcpZsy5A7ecIdOL7OWo0toW0758H1+jvzzJJ2+J5I8PvGG8jERAyH2WaeA5kVeuel/BeAmgPtuGXrddo/bNn498ogSMB5fEBpxW6ta9X1lV2MqiPqeB9uDB5UKj62jkJVRWZqkRFc4Mq7MSGn0x5FyTtwfSoSRO8zwHJRqT4YZndWgSH4mWKMdJzPyKPu 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: pu8xqEe3Lu2CxcyYCdVzU8spgFuM2L/ZLbKb8TCu8y8sjLp+3lb+1rVFfDsT03T1pJb9RLbANcgJ9yf0nAeBer82HmsKvQ1FpZsfwJ31FGILxmJ7WgW7WQLXxtRuUacnH9WFDRZ2HUcMZ8WFD10c9g/OUBgSB/M2/wQs5VHOgwjP8A//9mQD7h5jCciAaEf5RojPlCoHJrH/LZcJShmBlIuEDTitDoEhGztCDraJrrpaujsrzjXcxcWVmfOoPjxGNtIrB0wHg6xSM39jYefLqLT4dlwjwl+RguryKMvrezM0UrgStoSItbC8cpTzY9yjoQJPGXIQW/F8x4dmd+StZncJmrkK9ACa2WuXl7uF3Lc3uwfW1cqyGL9gzkXzmRfjZLX9vMekvof5hQfrBHZiu2f4C0PvLWe0k/P2TyxV1AfB51sIp90r2qJy//JJS8hGlT/AYua1JLd2WetHxssAIFGzZkkmILssci7xHYId4xKq5nk+0rTJyU16kUVTqMv0bds/q7uXJk71j1FCSG87EKNwrYlowZx5/iw8DHWKlKsytKPMPL1rs3YjNHNztcMOO2/DDF5KnZVwD02GnGMBmszZQMjG7n0J5gyaURjKd6FByLXCknIuxlp75w4YeIJVjPtzL/Swn0MD/TJy3kCWEQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78ce83d2-bf2f-4b59-4f8d-08d87f091031 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:26:58.0303 (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: CiU1aiOe3VyxzxnCFtaWp1eBHuecyxYvgFj0YwbBjzKJ1E5SVnmtQJb9B11P+YeX X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28RC6o031299 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 --- include/libvirt/libvirt-domain.h | 3 +++ src/conf/virdomainobjlist.c | 15 +++++++++++++++ src/conf/virdomainobjlist.h | 7 ++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index b3310729bf..c138e8299c 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1877,6 +1877,9 @@ typedef enum { =20 VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT =3D 1 << 14, VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT =3D 1 << 15, + + VIR_CONNECT_LIST_DOMAINS_HAS_VNC =3D 1 << 16, + VIR_CONNECT_LIST_DOMAINS_NO_VNC =3D 1 << 17, } virConnectListAllDomainsFlags; =20 int virConnectListAllDomains (virConnectPtr conn, diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c index e9a4b271df..5931669b5d 100644 --- a/src/conf/virdomainobjlist.c +++ b/src/conf/virdomainobjlist.c @@ -912,6 +912,21 @@ virDomainObjMatchFilter(virDomainObjPtr vm, return false; } =20 + /* filter by vnc existence */ + if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_VNC)) { + int i; + bool hasVnc =3D false; + for (i =3D 0; i < vm->def->ngraphics; ++i) { + if (vm->def->graphics[i]->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE= _VNC) { + hasVnc =3D true; + break; + } + } + if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_HAS_VNC) && hasVnc) || + (MATCH(VIR_CONNECT_LIST_DOMAINS_NO_VNC) && !hasVnc))) + return false; + } + return true; } #undef MATCH diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h index 6150e13aa4..3a86e24100 100644 --- a/src/conf/virdomainobjlist.h +++ b/src/conf/virdomainobjlist.h @@ -124,6 +124,10 @@ int virDomainObjListForEach(virDomainObjListPtr doms, (VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT | \ VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT) =20 +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_VNC \ + (VIR_CONNECT_LIST_DOMAINS_HAS_VNC | \ + VIR_CONNECT_LIST_DOMAINS_NO_VNC) + #define VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL \ (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT | \ @@ -131,7 +135,8 @@ int virDomainObjListForEach(virDomainObjListPtr doms, VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT | \ - VIR_CONNECT_LIST_DOMAINS_FILTERS_CHECKPOINT) + VIR_CONNECT_LIST_DOMAINS_FILTERS_CHECKPOINT | \ + VIR_CONNECT_LIST_DOMAINS_FILTERS_VNC) =20 int virDomainObjListCollect(virDomainObjListPtr doms, virConnectPtr conn, --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305649; cv=none; d=zohomail.com; s=zohoarc; b=NosfOnoKyYi06amgyoPThcsFX2g6R9txsmMnF2l/lDY+uH8ZorZtifMy6RrCl9fzcN6oDbh/piCO7OwXuHmfUt3kh55tlTtR7t/iWDQNYzSm+aqqWqTCKYVEfImtFUZPyKz6iol8mL6ggxxeyybGr6pdPEgC4pEkLvFftMpW6gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305649; 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=wyJSdDwzF17G3Ik9fhxcGLHc9a+w2dvW5EQLRMZfxvQ=; b=YnSb1WM9nhJeRIsd5aQ29bCHXLUnQizLlpdZztamRPQCbmcu7/M0ixaGBUQEuK1yzhOt66KWVpWWwoos3gaLXKUItfhhwznFtci/T/U1BH6aZPPY2o6G5OkC32KbV3okwjEwFsDmifkwiiDlp2xVD6mJc4pp1PYcMU4lthXjtl0= 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 160430564980744.14186841683863; Mon, 2 Nov 2020 00:27:29 -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-nSHiyFyoOc6VvT7qhwE1eg-1; Mon, 02 Nov 2020 03:27:25 -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 7549D186840D; Mon, 2 Nov 2020 08:27:17 +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 54D1E73664; Mon, 2 Nov 2020 08:27:17 +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 1F85C181A261; Mon, 2 Nov 2020 08:27:17 +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 0A28RCs9031293 for ; Mon, 2 Nov 2020 03:27:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 351521111A4F; Mon, 2 Nov 2020 08:27:12 +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 3016C1111A41 for ; Mon, 2 Nov 2020 08:27:10 +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 6A480801224 for ; Mon, 2 Nov 2020 08:27:10 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [62.140.7.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-TaAoZ_neNHWUKKADZDbgXg-1; Mon, 02 Nov 2020 03:27:08 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2052.outbound.protection.outlook.com [104.47.1.52]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-36-WL-ekE-ONbG8B8Qtrk9j1Q-2; Mon, 02 Nov 2020 09:27:04 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:02 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:02 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:26:58 +0000 X-MC-Unique: nSHiyFyoOc6VvT7qhwE1eg-1 X-MC-Unique: TaAoZ_neNHWUKKADZDbgXg-1 X-MC-Unique: WL-ekE-ONbG8B8Qtrk9j1Q-2 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/19] virsh: Only return domains that have VNC display to vncdisplay command Date: Mon, 2 Nov 2020 16:26:12 +0800 Message-ID: <20201102082621.13228-11-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cdec77b-894b-49fb-b7e8-08d87f091171 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:346 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: y4lauW0uAiZQhK6maLGZgAWkli64imw8mbvQfpNz4hofRMYWWOKRPyAXl2T2k7P1P/iimEGqm5sWP0vNzLhsvu8UY+y/Dh8WY4adNd8zU/FzY9ppnhWW/fQgH6iv2QbNoc9b4uZ/pFbm0pbWqj9rSBYBLXx05ZFCKgS7p+SPBkx0DKdKfnfIXMVJMv6Kyj8uldj2ilvkeWp65cKDIoNLnG0b8uRSp10l8mZNTE9wGEYR4wKIy45+tKTr7hf9TbdlpKI7p9zQdXUOIWUyjQFhiGOVqQK2Qite4iioA/T2o2kckyojVCkJdfja6+L2QhuRuJMouSb1xYiLsZeka41CZg== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: W0rN4dhcN55YhYJRAqOvwBEModsPHImNjdrVsU7XcszjJ4cx7Wus5wSRmBv3gQRl0DooLP4ZYbrvIQNRfykX0aenuUgt1X+V0EBgNA8FzucxznOIINGNdA8yztpmGt0pbGqD7cFVTUKGt5hPc+2MVpRvKKxJGiDgwgV5tmth/OJ0z2vTNvv/rlOb+C1Ks10vwAm/GH+QAPeKqSCDAZM0uvIzMOaD8jep3VvAfTXzN0Gbz90utHtWGtY46qfQPzQ10cvn3ufAhqIcoh+AD9G5ad/n30JScJxb6bjugIIrWOXXHBKLRVDJGaqUu85c6Ws9EpYG7+Md0Pkb0oPOeKl6hrbGAXLVRW/noIs4KNiIbWui3uyNWA8xbD7KdTSgGC6t2WGvZuRAxsV6u+FsoGySSon3ox7ItNK/vIFEBhmJm5JMRoMpFAWOndDs5/VOl2yuPzBJkmG4iirsG1UU/Sem8psleYAJraCOCOvl5QnP+MIHcmbvxtXbzq//X68YRFgnnY6CKwfUQ9akYCH4jsri4LWk1C6uNJOblAMOtTARoRfgqOtPvijtuPBwpOXM4tCQ8mT3LCxurZecy4vYudXbsX5Vp8yaQKiqPIp81Eze1Bw9h1RYEV9effnRKxON0vqMXO8oVeZArlE7/pmx+IH2OA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cdec77b-894b-49fb-b7e8-08d87f091171 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:00.0881 (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: VKCXgNWBQS72w0nqPhcIuvugE1/Fk6XyzUyDMH3mTV0b5iIaf4WFQmFnVOSPqs6F X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28RCs9031293 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 --- tools/virsh-completer-domain.c | 3 ++- tools/virsh-domain.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index ab81a0dcfe..305711151f 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -52,7 +52,8 @@ virshDomainNameCompleter(vshControl *ctl, VIR_CONNECT_LIST_DOMAINS_SHUTOFF | VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | - VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT, + VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT | + VIR_CONNECT_LIST_DOMAINS_HAS_VNC, NULL); =20 if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 7189c8c826..5b9970fdf5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11759,7 +11759,8 @@ static const vshCmdInfo info_vncdisplay[] =3D { }; =20 static const vshCmdOptDef opts_vncdisplay[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE | + VIR_CONNECT_LIST_DOMAINS_HAS_VNC), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305643; cv=none; d=zohomail.com; s=zohoarc; b=RrMZsa62hnNICuzj1NjEJYvr1NyRwf9t4LJ+bJCi397RztOMHBEM884AxM+r4a2elqZgtKSElIvNBcHXTrClb0fKrTC4bCqyxhXHV+WOhv8GO8ct9JlzS8ppqkzXJKbCu+jPG8q9wsQKmgDbyD3bu2+Nz0v73bipg9lTKR6NQsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305643; 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=aMd1WUjN6iYLk63y9Eo1K7wsvdG4sFtR9aIGnfv7+DmC5YxbxtsxdvpIlVSnH5FFwg0DtuP6mPHkCVg1NVN/y49Lq7RHPSKnlqzMI0JxUp+J///WZxHqHpIhpbSdMYqq0Yrts21flcBUEkYR3l3DH5d9r5yPIzoxKO56Mwxx80A= 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 1604305643192243.10781331912642; Mon, 2 Nov 2020 00:27:23 -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-394-EZxKCLx1NCG8P3nKP9M5iA-1; Mon, 02 Nov 2020 03:27:20 -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 9F12B1006C93; Mon, 2 Nov 2020 08:27:14 +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 775BC10027AA; Mon, 2 Nov 2020 08:27:14 +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 44A298C7B9; Mon, 2 Nov 2020 08:27:14 +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 0A28RCQA031288 for ; Mon, 2 Nov 2020 03:27:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id E33E1205EB1A; Mon, 2 Nov 2020 08:27:11 +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 DB4B4205F385 for ; Mon, 2 Nov 2020 08:27:11 +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 C68A9858280 for ; Mon, 2 Nov 2020 08:27:11 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-0-olpmJ7MVqptbLeEpXhdg-1; Mon, 02 Nov 2020 03:27:09 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2057.outbound.protection.outlook.com [104.47.1.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-32ucvPsaP6-Upa_nXWE2vQ-3; Mon, 02 Nov 2020 09:27:06 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:02 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:02 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:00 +0000 X-MC-Unique: EZxKCLx1NCG8P3nKP9M5iA-1 X-MC-Unique: 0-olpmJ7MVqptbLeEpXhdg-1 X-MC-Unique: 32ucvPsaP6-Upa_nXWE2vQ-3 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/19] vsh: Fix completion error in case of multiple mac addresses Date: Mon, 2 Nov 2020 16:26:13 +0800 Message-ID: <20201102082621.13228-12-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a63eb343-605c-4840-e2e5-08d87f0912bb X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: nkZSguvR/ECZqs5J/nKhcfnAw6lPO34ZhmK0x4T8z5NKiYPym4z7yCrTzk88JXedAVmNprwp/PIkKlSmXKbL+PFSUD2PzPJVIY80+7U54oBjVej9mvl5pEtODT37R0LxnvRuLduL7eJVjGiZop9bgaWeLMV1tFWGT6EpZycM39zy88pP2ZiC7+x77wNDHRTB0IZ0TtWpy/p80qDh3o3SMbaZb5kxZBgi8CKpGZ3JK24zdSfTZjw7ULxcdn4aQJ0tL+j/9adqCIOQaEqAjkdjxPKhVdqL86MULsOxWYWqsDxVSX5bUTGgbF4TA4srDrE9IIjVQGew6fae4mLGhyO44Q== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: uOhzt/1s6x8hARell4cainugzCNAHE/ZM1Wo0nA+HsquYu2jvYTQTuDc9vOiZS6gqwhsBt8rGxR3iN8E1ZTAygbvYeRzQ75bN/+hnkjgPu2rd5k98sStiRLKlgoJI/adRfcLvZJlXRv4A8iBr7hiM8tuna2BQp4wxv2vi2SKqVuRoNtSw3O+eYo5AdaFMZ3Xx+JsQgsDAd+jeea+U4PXy2XS7o7ZYJ18ukqPjFpqP5VLqjEkJ7p6EO7ICO7OGSCOwS6t1uqAgDa79EpSUF2lesc3Dg9KcG78AzV7R/GpJaW8Yp7ScSiXep3sUtPhF7j+RIWgVCAcQPEUAAWUJfS3NZcpwKgXLcaIj/Tlr+FA/MdzSWFSqi01gKIyKltyDQUlBORQIcGvLLedHAB7UYoIv/UXJJxLP+Et4TrUQ+CXjOopX0nBj7wzjMKbEwga8xYfx4FOYGKyMA+pIrWCCfS97m/5lB1nqzblK5sn3RoSNBIKf5nRlN1gMkEFb/bV2d2uS07vjEMYCdnZoOGkK1T8zYKVkoeIfzXkX+GJTwA/qsixtJ7OwVmQuwcrdxQpxU1Of9khVW1O42KJnjxvyAJys0lYA8nwyPFhpRiLu8R9Xx1Ah20TzhoY/eXBau37D328fZ5zRCdGcCvogkKw/py6DQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a63eb343-605c-4840-e2e5-08d87f0912bb X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:02.2429 (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: SXwCStQt50LCZ79PnKMcGkbhgKrQU3M3gIjnRnPEx+nTXbwcKYwu1W7O7BYmvok/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28RCQA031288 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" 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 Mon May 6 15:11:31 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=1604305660; cv=none; d=zohomail.com; s=zohoarc; b=lEDeADdWfIvv6IYgUK1tHbcQkrNxPHwDt7nvG2MWbMeL7SzEQ7llGxoa1F0STfWg6hg4zehk64275OTrfi2CTHimBzYMJuZ8o82S+qAJEz6RysPsA/vPB4ZE8q8/uOs+OpYfT9XW5vXBZ/1kdakvNBAg/Bj7muTIrPhPw3AJLIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305660; 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=bVZt0ix7v7iArHrzTYV9PMSzmR3/vEc3VSzmqYhmUeU=; b=GdEfnqeZgrAbV0eBZ6DKASxEcHwpkACcs/WdFAE4cRaujdeVpVXqTKWvGB718lltRbZlCOStzUQzrgQ4YZAeDahTR84zWoYh2NinIjZV/kK+ixU+VawD+l99tfMQkh5t6gyvOsuk3nmbQzK5Dg1PUmdAiRCI+ZF0Qt243/DYPrk= 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 1604305660572705.6308894057584; Mon, 2 Nov 2020 00:27:40 -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-551-s3XtplG2N5SDrSKXAxp1gA-1; Mon, 02 Nov 2020 03:27:37 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E69957205; Mon, 2 Nov 2020 08:27:28 +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 2EF185B4C3; Mon, 2 Nov 2020 08:27:28 +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 E9F768C7CC; Mon, 2 Nov 2020 08:27:27 +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 0A28REw0031315 for ; Mon, 2 Nov 2020 03:27:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 70EDB47CF6; Mon, 2 Nov 2020 08:27:14 +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 6ABC747CE3 for ; Mon, 2 Nov 2020 08:27:14 +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 5313B185A794 for ; Mon, 2 Nov 2020 08:27:14 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-Se9vEL_qOlW2XRXfBryQEg-1; Mon, 02 Nov 2020 03:27:11 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2057.outbound.protection.outlook.com [104.47.1.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-4sgj7EblO2yj5IP0CKIN7w-4; Mon, 02 Nov 2020 09:27:08 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:04 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:04 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:02 +0000 X-MC-Unique: s3XtplG2N5SDrSKXAxp1gA-1 X-MC-Unique: Se9vEL_qOlW2XRXfBryQEg-1 X-MC-Unique: 4sgj7EblO2yj5IP0CKIN7w-4 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/19] virsh: Add mac completion to net-dhcp-leases command Date: Mon, 2 Nov 2020 16:26:14 +0800 Message-ID: <20201102082621.13228-13-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d7827ab-2dd1-44f7-657b-08d87f0913f9 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: fABZ5zV+nGFX1T64knxwoKdCIGsjb1wg1E5QkldS2HckHJ697K8HxiqSgt83k8g9iRkEDAy70L6RVplEQKUFvEWLU2KNY/+hcNmKzg527vcCi2HLP6JcXBQRvXxIDrPp9hHJYyv4Fd957IDFd+QVBmmWp3i1q6dJ3vFAfbpo+oI+aqkiyHmP3dmHHT7PmDYBUxnGlQCSNZ6f/UgEn+42X88Fakhcd/mPBa5esRnagyRPM/HrAQKopLD629aIyAOXX4Wbh25PohitKlBJ+P69vY1GZnNuyJrDxfosUgz5vtijm8PmWlrOTbDxpcA0OBksDOnYtTUsv3HrpKqUvx9TSQ== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: ygA6rAe3Mw4kQObjujv91ojNyyZ71HG10iM1Q51IfJSYkjbQxvE+nKYtsIjZ+E5CvfCEmxqdfjat5Ys3TdzUNMJixSm3eHOrUkInwYHxwOwzaGbmhhXLyfNfAYwANfoXE/4Kvgh/8x2leVhVDxjHtZwmmpARNQZ49tCGasC4N8lVwpweje2QSdJ3d+yKZtnYFP6QbRZB80uZA5U6gjAIqY6Kq88zdM2jv1lyBNm5SE8n0inA2qu9M2AkhkBPY5snuXVHy1xgjmskXCt7RXBNbiRP8sZmDSodcRZzo0ZSZfZ7DEBZ3hjywtmSk4djoyeraj+418cGCUU7FAHS8WbVi2245qbh2CdWfiRgLSZaDZLcPDIwpuiHOZGZ8p5ij6+oYtQjItO/ZapMT6pzppUxZgIEfk3VBxHWTG5bY97L144gNQ8Yc4uBscC7EgO05IEaiit0I1No/WBNtLOSsEDRDPvIHPcNkJMmdtRYKp/CIm92B6fryGPFXKTVjGPoku6Fd1xRILUCOz0xwlTam7rkDikm7aUz6nn7pALsDh5ANYgbU5g6GxMExLRbO2D8hIYsWbrErTJ83DYlpsqhCvdzyhZehZdUT5u4FGMqSGtwTm2wUDmwVXBVDwNMGuxZd3YigSJ3CdjTtLuCk8sW2NxaTw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d7827ab-2dd1-44f7-657b-08d87f0913f9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:04.3297 (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: yEu4EimFjPlYVegkLzFe4wAWhrMoaOhEOLXGxT1CL+WsmGOsKPQXsXWNgNwaPxfQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28REw0031315 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.11 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 | 45 +++++++++++++++++++++++++++++++++ tools/virsh-completer-network.h | 4 +++ tools/virsh-network.c | 15 +++++++---- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-networ= k.c index 73f7115ab2..58bc126693 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -174,3 +174,48 @@ 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 Mon May 6 15:11:31 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=1604305654; cv=none; d=zohomail.com; s=zohoarc; b=fj9hxfCT6YhZkxo22hemq7GfQPgWo71nZ967XtDKO6lvgxzzbFYDcAc6Y4vVFyaF8FhdxM2Rkyvdc+xM9E6Qshct9AMdmRbBvsvNvNGUtw3J2BMkV4xc1sw7i+fTCEovpsFrsY02U4R0aEA5sFl+siFY7X8+OdUgMFd0jIFk7Tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305654; 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=5SjoXCF7Ps7Ui+47OBlP/tzNjByvYemUJA6UR7U7SRM=; b=amXUQpO2PCiFR2g8E8YERZsSPGAE+7hx7q076YQpti/3LZIMa3DipO4W3s18yKRT9GV2GiUSfDVJXV6HHGGi0WZPDay9Riw7H4PnKMdwRf6PJxTcM8zzDjwxZsTfmvUNWHXtERM/rjiQGP/zkrGwrT/TeQCT56IMZxVzG6NlRHQ= 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 1604305654881773.6953802217676; Mon, 2 Nov 2020 00:27:34 -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-469-cRzKa-CYOu-XRBjCJOlCVQ-1; Mon, 02 Nov 2020 03:27:31 -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 316408030A7; Mon, 2 Nov 2020 08:27:25 +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 0999673667; Mon, 2 Nov 2020 08:27:25 +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 C56C78C7C6; Mon, 2 Nov 2020 08:27:24 +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 0A28RGoW031340 for ; Mon, 2 Nov 2020 03:27:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 87FE347CE3; Mon, 2 Nov 2020 08:27:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 817FC47CDC for ; Mon, 2 Nov 2020 08:27:16 +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 69FCB8D6330 for ; Mon, 2 Nov 2020 08:27:16 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-201-vX8jSKNbOfCER_gRcTaLuw-1; Mon, 02 Nov 2020 03:27:14 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2057.outbound.protection.outlook.com [104.47.1.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-b-_IhKejPKC3__nfX8K2-Q-5; Mon, 02 Nov 2020 09:27:10 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:06 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:06 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:04 +0000 X-MC-Unique: cRzKa-CYOu-XRBjCJOlCVQ-1 X-MC-Unique: vX8jSKNbOfCER_gRcTaLuw-1 X-MC-Unique: b-_IhKejPKC3__nfX8K2-Q-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/19] virsh-domain: Introduce 2 macros for domain options 'interface' and 'mac' Date: Mon, 2 Nov 2020 16:26:15 +0800 Message-ID: <20201102082621.13228-14-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c600cd1c-c2da-480d-54de-08d87f091532 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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:1388 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: aJA2Sqge9Il8VNLgCl5ncmG51ucJsmqxuquI9y77v0orC9yi9Hjir23XMIZJT5Qaq3nLlewWcxh/wFlwv5FOw+H7Cvr1y62Lhe/lkATM5+Dy1zYdxCUtpAUM+Lf0IKZimZ5UPwZHjZ+TIIdyP5o03IhzaHPWIzXBtcA4FMsydVPagmw74K3eqy9pTReHg4Vul/8HJb4f/RbMVBORiggwxafE3WWn2DBDvFEcV2cVwi/XBp1z3heglXd99SKi5Q7WiYj6GCMItbL4eWy3q+J6g3C5h6KjabdtSGA3wOGeulUR9AKY2rMJ4BRFme989c2e 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: sufzTkcd821mSFlolxkdJaLhimx4m1Nr09Vi/vXHN7Y1Q4yMWsdobm2A8hXqwVHcOnvSaHrt0HS1npwBT7+hr4HPgZTnQ/ULFzVjOP5+spcGteLZt4bi+ec814c8q3aL68G1mDYPbCJUWV9APtMkqFiGL022HIq2WgoZAWnikzwr8AuGiOEPE1rZcvVBLk1Wk+kEjDqtcKLkfsim9BlHAfZGLd6bxqmTsOLg0XrfCSyapYhMyq5FzGvQ/SktfmHjsHrK9ZBxZc0U5QB5oTvTtlvI8nqEAHjkSfn4vacNYN6eHj4Xbx4M+6oPfdcdP9ol33tr+evPEW9iYVzRgdXQgrY0xZYYPeB7WrNyu14Vfgthswn3S5kFYylalC6EZRbxfB4v5W9RlM9QYJW7kKiLl4q6jI6AqfV8SfZeSiro0bw4d1oPjPRNaHv0Ykdiu0n6c/Lf8TKhVitwczSvjfjz26DBRIFVY3AqnoI8oeHBzUzJAWENowc5XP2VTDudsFQb4ytL7aHRAZlutBLNE4fAew5GSDgj344D3OS6UvfybeBiDKQy4/yjeI5BlWk0xCrvdh2DpjZeCb96Jy8Appi3jaMaQemjLxUAESjZ5fEZSXivgcu8kckgp7rv5zAZ83BOnLgHm4KqXsOhtl4db48/Qg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: c600cd1c-c2da-480d-54de-08d87f091532 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:06.3916 (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: d+WArqrti0b4VH5XZ3S0vGktrey8NGLEFT23QW2XEzobdkBpAJiJMsClpkIIMyMz X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28RGoW031340 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" The macro VIRSH_DOMAIN_OPT_INTERFACE for domain option '--interface', The macro VIRSH_DOMAIN_OPT_MAC for domain option '--mac'. Signed-off-by: Lin Ma --- tools/virsh-domain.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/virsh-domain.h b/tools/virsh-domain.h index 0d59c579d4..ac05f983f9 100644 --- a/tools/virsh-domain.h +++ b/tools/virsh-domain.h @@ -39,3 +39,21 @@ typedef enum { VIR_ENUM_DECL(virshDomainHostnameSource); =20 extern const vshCmdDef domManagementCmds[]; + +#define VIRSH_DOMAIN_OPT_INTERFACE(_helpstr, oflags, cflags) \ + {.name =3D "interface", \ + .type =3D VSH_OT_STRING, \ + .flags =3D oflags, \ + .help =3D _helpstr, \ + .completer =3D virshDomainInterfaceCompleter, \ + .completer_flags =3D cflags, \ + } + +#define VIRSH_DOMAIN_OPT_MAC(_helpstr, oflags) \ + {.name =3D "mac", \ + .type =3D VSH_OT_STRING, \ + .flags =3D oflags, \ + .help =3D _helpstr, \ + .completer =3D virshDomainInterfaceCompleter, \ + .completer_flags =3D VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, \ + } --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305656; cv=none; d=zohomail.com; s=zohoarc; b=n6XoQG1C8x0kPbFdolQqgs5jyk+SINvSDAngd1Is0YrDocxAdVglN0Lof0s3v7rXBdMCEvlWNSClLgMackhDCgcg93zicHTCkyUHU6vwk7RoPZAA1Se65XE1xseLCLIg93joySMQJaXoD6ABJOx4sSUOV90m67Yd2S1zPjrFYn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305656; 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=7Bs62jLiD+TEuu3nLom9vca3ZZ7B7bTl43T8ecn75m8=; b=PGonv4PUiOgIhd3lUSAITghBsj5oDgNQZsaE8U0Btqhqp0auvJtChHzLadDFvW0QTdKbQSGeEqd48ehnV6ubfZB+8anVDDP4Cb3NuPERx8x5h6TaF7SlZuadiYZ7gIxiaAgBFCsaXrBpQNeDMTcBdIexoZq0gI7kqoCpSrpHug8= 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 1604305656346979.8949099976825; Mon, 2 Nov 2020 00:27:36 -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-569-85Olg9DZNb-FKkMs8haSsA-1; Mon, 02 Nov 2020 03:27:32 -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 C7491809DD4; Mon, 2 Nov 2020 08:27:22 +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 A4A7973660; Mon, 2 Nov 2020 08:27:22 +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 6F5D9181A720; Mon, 2 Nov 2020 08:27:22 +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 0A28RIn5031359 for ; Mon, 2 Nov 2020 03:27:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1DC5F1111A4F; Mon, 2 Nov 2020 08:27:18 +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 1940F1111A41 for ; Mon, 2 Nov 2020 08:27:18 +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 E7DCD185A794 for ; Mon, 2 Nov 2020 08:27:17 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-ZnBnYDRlOoq8ZFTa0U9w7A-1; Mon, 02 Nov 2020 03:27:15 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2057.outbound.protection.outlook.com [104.47.1.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-13-G3ZvVbIuPomLy2WlEbrNQw-6; Mon, 02 Nov 2020 09:27:12 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR0402MB3624.eurprd04.prod.outlook.com (2603:10a6:209:4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.30; Mon, 2 Nov 2020 08:27:08 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:08 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:06 +0000 X-MC-Unique: 85Olg9DZNb-FKkMs8haSsA-1 X-MC-Unique: ZnBnYDRlOoq8ZFTa0U9w7A-1 X-MC-Unique: G3ZvVbIuPomLy2WlEbrNQw-6 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/19] virsh-domain: Apply macro VIRSH_DOMAIN_OPT_INTERFACE for interface option Date: Mon, 2 Nov 2020 16:26:16 +0800 Message-ID: <20201102082621.13228-15-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7bbea0cf-becd-471a-6b46-08d87f09166b X-MS-TrafficTypeDiagnostic: AM6PR0402MB3624: 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: 9Y7gj9hEXQDrMnOXLLlDUlSNguNI29IY3Q2HipJVR/xxpJinwCu0fZMKlTr/4HnwdTS7Yme5qVSdShCrqsxBMrgvHZeQanC+j5d+kzxMbkjjRzovjalVFeJjW+IBgzO4efwt7yuo0q6mxfOlIq/7HwQcmUOz6VlaYwwHccdlAh5pPrlm5hw/g+vIBNmIZIGTffouhYe6lDNsE9vfrlFHKlCzM76YMEWK1u3E6ITjVEscdpb6Yau1k2P+KlD9DvWdqpZeCgoRTpQ9Lv3JNYZpTgSoZYy5ApBSLMmDFYBwgnmxg7FhZ5/MVSghLLGzx4hUYPTS+pYkMSAxk2K3BUwgMw== 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)(39860400002)(396003)(376002)(136003)(366004)(107886003)(6666004)(5660300002)(16526019)(66556008)(66946007)(66476007)(2616005)(956004)(8676002)(6506007)(186003)(316002)(450100002)(4326008)(52116002)(26005)(478600001)(8936002)(2906002)(36756003)(55236004)(86362001)(1076003)(6916009)(6486002)(83380400001)(6512007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: +Ox2jOqcZPWgBsMD0JPQ4oXSadhEo2Sl5o6GYG8LSbEXuvNUC6gSZPoaZexhCsZGAD09+b7bodATxGhDi7C70pvBarbeJynXRcXlpiVIgm8DoaxteBmIj51CQSvmLD9OJD+fFUPJSMQ431EONDEEoTREQGt6p9tD1sz210HCCubaLsMvirylflnU23PSABUB3F6foptnHFWd4q4MULxaNq8M697JMAp3Bx2gZjlGTr5CEzF/zOAAKYkjnxHk6a9NqU6DbMqyYlE24l2PMhvOhMIBhczcx1eSyzo1BkoWOfXs5ElnK2VXLUPM54PkZPqwNqpDHTK6uJqzOfK6l3jdYXzIxsMeGnWKKBAFVCYiFSufrkMwqrnN+QHC3XFvakEuNHVzSCYU4WG9Gf3xl1YYikBw8rPVxklR5LddLftOw+gM8OZASw0t7Mgn7cyigmcQQuRh/n1zPEiwdG0SsHDxZ5ZTE7Io9Lnm9nUDlJcPnhMHYsY9pGikxTH03SclS8XL9rA0WuZASiqbD7wEj9xW4NTXEhdV4evDEZmdlkMiqRsCr2az/KTJLh0O6dIR9Zu+QXBSzHoxJtORrCjg1NFbQ5eeHnmZh1ZZC9lhgfkVBd1+ls0kX1H+T/tk3tKPv9yZ9pufZ32uo8fL1ObSFSP9qQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bbea0cf-becd-471a-6b46-08d87f09166b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:08.4104 (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: qqQXX5s6lYveSmg9WBMbqQHkMw1gToeToScmbV84wvXNnJH188eXgQJTn57SlGvy X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3624 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 0A28RIn5031359 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 --- tools/virsh-domain-monitor.c | 20 +++----------------- tools/virsh-domain-monitor.h | 1 + tools/virsh-domain.c | 14 ++------------ 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index e0491d48ac..313fdaf559 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -802,12 +802,7 @@ static const vshCmdInfo info_domif_getlink[] =3D { =20 static const vshCmdOptDef opts_domif_getlink[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .completer =3D virshDomainInterfaceCompleter, - .help =3D N_("interface device (MAC Address)") - }, + VIRSH_DOMAIN_OPT_INTERFACE(N_("interface device (MAC Address)"), VSH_O= FLAG_REQ, 0), {.name =3D "persistent", .type =3D VSH_OT_ALIAS, .help =3D "config" @@ -1138,12 +1133,7 @@ static const vshCmdInfo info_domifstat[] =3D { =20 static const vshCmdOptDef opts_domifstat[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .completer =3D virshDomainInterfaceCompleter, - .help =3D N_("interface device specified by name or MAC Address") - }, + VIRSH_DOMAIN_OPT_INTERFACE(N_("interface device specified by name or M= AC Address"), VSH_OFLAG_REQ, 0), {.name =3D NULL} }; =20 @@ -2328,11 +2318,7 @@ static const vshCmdInfo info_domifaddr[] =3D { =20 static const vshCmdOptDef opts_domifaddr[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), - {.name =3D "interface", - .type =3D VSH_OT_STRING, - .flags =3D VSH_OFLAG_NONE, - .completer =3D virshDomainInterfaceCompleter, - .help =3D N_("network interface name")}, + VIRSH_DOMAIN_OPT_INTERFACE(N_("network interface name"), VSH_OFLAG_NON= E, 0), {.name =3D "full", .type =3D VSH_OT_BOOL, .flags =3D VSH_OFLAG_NONE, diff --git a/tools/virsh-domain-monitor.h b/tools/virsh-domain-monitor.h index 0de47c50c4..540c266274 100644 --- a/tools/virsh-domain-monitor.h +++ b/tools/virsh-domain-monitor.h @@ -21,6 +21,7 @@ #pragma once =20 #include "virsh.h" +#include "virsh-domain.h" =20 char *virshGetDomainDescription(vshControl *ctl, virDomainPtr dom, bool title, unsigned int flags) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5b9970fdf5..d50fdbad26 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -3053,12 +3053,7 @@ static const vshCmdInfo info_domif_setlink[] =3D { =20 static const vshCmdOptDef opts_domif_setlink[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .completer =3D virshDomainInterfaceCompleter, - .help =3D N_("interface device (MAC Address)") - }, + VIRSH_DOMAIN_OPT_INTERFACE(N_("interface device (MAC Address)"), VSH_O= FLAG_REQ, 0), {.name =3D "state", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, @@ -3225,12 +3220,7 @@ static const vshCmdInfo info_domiftune[] =3D { =20 static const vshCmdOptDef opts_domiftune[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), - {.name =3D "interface", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .completer =3D virshDomainInterfaceCompleter, - .help =3D N_("interface device (MAC Address)") - }, + VIRSH_DOMAIN_OPT_INTERFACE(N_("interface device (MAC Address)"), VSH_O= FLAG_REQ, 0), {.name =3D "inbound", .type =3D VSH_OT_STRING, .help =3D N_("control domain's incoming traffics") --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305686; cv=none; d=zohomail.com; s=zohoarc; b=ODQEjuI/eHvYkLRl0SHujcUhzSCVoad+NvyCqVkDksJc6QkAf2HhedopjEI4BJg+TFSWYTvGe1hDSmIxOnMYZnTsf4Kf05CKslCjj6bJkaN/MEtSpk+nOLmGSShCCISUJyJL7BI6aiK2qDw/pMsZkW7HiN2rCi6vVKzQCgvx0Bw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305686; 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=LkFOz41b5WgHytw6rkvR2tx1fw6A1Es7hpTfv03RoJE=; b=bOkQCNNqfAIDiVJcYOdsxHVcQAaju6j8R/pu6SkCnSyWeqdNs5xGJhnYhYXsqYUYZHMkfJfpCNoRjP+ISCB9RTDoSJ+LQxfWErMSfPBy2BkPcEJQSSvySQkDe4QTsLLtdT3TTFHs6Xmc2wK2bJjiGjomKAxzXW7qFuHJbEszBrs= 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 160430568662257.24779985815212; Mon, 2 Nov 2020 00:28:06 -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-553-xFxpKuDcN9Cc7Qi-hRRyfA-1; Mon, 02 Nov 2020 03:27:37 -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 8FCFA801FD7; Mon, 2 Nov 2020 08:27:31 +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 6643D5C5AF; Mon, 2 Nov 2020 08:27:31 +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 31075181A87F; Mon, 2 Nov 2020 08:27:31 +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 0A28RKEB031370 for ; Mon, 2 Nov 2020 03:27:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6C0882156A36; Mon, 2 Nov 2020 08:27:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 644E62156A39 for ; Mon, 2 Nov 2020 08:27:18 +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 051598D632D for ; Mon, 2 Nov 2020 08:27:18 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-F7FmVIPPOJeYTSDF517MpQ-1; Mon, 02 Nov 2020 03:27:15 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-MiLiaeDLPv2TCnjCC1raDw-1; Mon, 02 Nov 2020 09:27:11 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:10 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:10 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:08 +0000 X-MC-Unique: xFxpKuDcN9Cc7Qi-hRRyfA-1 X-MC-Unique: F7FmVIPPOJeYTSDF517MpQ-1 X-MC-Unique: MiLiaeDLPv2TCnjCC1raDw-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/19] virsh-domain: Apply macro VIRSH_DOMAIN_OPT_MAC for mac option Date: Mon, 2 Nov 2020 16:26:17 +0800 Message-ID: <20201102082621.13228-16-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27835532-5bea-4014-158b-08d87f0917a0 X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:296 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 8Yicji4mMBje2VWBes6YiymyE+/0s1kq3RWIxrSJZIjqM4NUSGU4vgha08r86TVk6H2yIqVHt3lqcEdlzc13VZBICIqiwSLHzZB8mGc9WG/mn5gu5NfO9STi+a0Pea3lbGycP9BecoVCm5oARSE4Il8Xv97GQehKRMxiRbMH8J5KpfS5sjujR36h+p9pBWHA8D4elctyqBYuREeNvOXkYRnqfx148+R1RzyC6tJhIEST+FUEsCxw/paJck7X9eHb8xLgJv0Uukl9hNGJKHtrarLT8uPeZtS2hKKJH/udx8Crx+aUFlB1bFHqJV/HAHvH X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(4744005)(5660300002)(83380400001)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(6666004)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: r3NTlBTsCilxypZC+mbMlgw65kMsTrfhUS+ppE2NWJwMEJQfcFPi2xwMFJQ3WhpN0+dTTXm9bh77x/UNH8zfonVNTNz140J/8cYdBhdPEj5KIKAWElQoqofiLff/az/CUIF1obyIcQUWt6PV3n9VCaHqyfWncK+E72pFMBY7PfuOl4jkNjESs04l/XuddIdyy1S/xFoHW8WxOokcuPYjJEQ8xVOne7uAWjZ90o9jxEEgnTD1XXXtiOqD+S2RcKyjBFR2OuzfIpCSZoDqDnpa8r3wC/2WFT507vCToVVJtlpFw7TQHXGJe8q+H6YbwAdF/btDLIIoHfZlFUER1EiW6qFLTrXDzhxT89THE2o2sOLkSTJkfJkJ/2iTqvyRPttLPEqm0jDaYjBP6jxcE9sBpBvpaAbLB2FK7Hmh/Wr5jGKDeTS9gT7cd3G3HxCiO9U3ejxWJaPRazN0PRV77hr6VuXXZDawDO+PB4KJ/Uk21vCTjVK9fZ6I1cLtzIRelClrUmQT+JQ6U8FMB7/fY/W6ucLmsaCQEzb8+TXMBJkTkBXUEO/Laz0lRJkLt5z+pbkZsHU9OsSPte4Mjq1Z/qbn9cKUrIpkrx/H4URukq6H1KCUyydPVEEF61ttyaqF70rPyjFC+SloWQdPvdhORu2hBQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27835532-5bea-4014-158b-08d87f0917a0 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:10.4553 (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: iONkpGDXMxf2Znt+o2o7ES0B+1iI25ouQAq/RkZPrfabmZpjew2cedYmPHfTmsEY X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A28RKEB031370 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 --- tools/virsh-domain.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d50fdbad26..ed7307cdb6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -12291,12 +12291,7 @@ static const vshCmdOptDef opts_detach_interface[] = =3D { .flags =3D VSH_OFLAG_REQ, .help =3D N_("network interface type") }, - {.name =3D "mac", - .type =3D VSH_OT_STRING, - .completer =3D virshDomainInterfaceCompleter, - .completer_flags =3D VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, - .help =3D N_("MAC address") - }, + VIRSH_DOMAIN_OPT_MAC(N_("MAC address"), VSH_OFLAG_REQ_OPT), VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_LIVE, --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305657; cv=none; d=zohomail.com; s=zohoarc; b=k4Kui/0HLcS5TBAn8hHYsuMLb8TWpyP5rrdMkIUt4i22QHCKEdCevR1glJRa9h/Rdse65/roWqVCNgcQyvOtj836nf2s6OEjt/jLUJ3DTOUu0mT5B+K8fRrB4BqEuST2gtEvu73+igVRS20vBKUwZFaOtA1n/Ex8fUWsCftPiis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305657; 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=2c+tc4o3lO7UCkhixUChwehiZY0GGpaq1uJzHS1zbuE=; b=l3KMCn02aJ5ial2vYcUKVXFFngRAh7DrVjfKWgmu/sOwy3JSZPt3PNyHXU48ZlAMG1/KL819nfWE4SweMuGDk+QD7kFpsSYJkYRqfCUCUmBN6guejnXL4cAc7zBlBiqeO6lK571eYxHZKLwPnzIhI95hnSZZ7BO2EaXqnU3ZMIA= 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 1604305657640731.3139355725164; Mon, 2 Nov 2020 00:27:37 -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-487-bJ90wHZ8M6uy7kSTNXM12g-1; Mon, 02 Nov 2020 03:27:34 -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 0842B186841C; Mon, 2 Nov 2020 08:27:28 +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 D786D5DA6B; Mon, 2 Nov 2020 08:27:27 +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 A6DED8C7CA; Mon, 2 Nov 2020 08:27:27 +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 0A28RNEO031394 for ; Mon, 2 Nov 2020 03:27:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3BCC12156A59; Mon, 2 Nov 2020 08:27:23 +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 344552156A37 for ; Mon, 2 Nov 2020 08:27:21 +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 90CE6102F1E3 for ; Mon, 2 Nov 2020 08:27:21 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577-mu1Wqvi1OT2SQSlV6LniAw-1; Mon, 02 Nov 2020 03:27:19 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-j06QEoLKOkiAraUbVtQhww-3; Mon, 02 Nov 2020 09:27:15 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:12 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:12 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:10 +0000 X-MC-Unique: bJ90wHZ8M6uy7kSTNXM12g-1 X-MC-Unique: mu1Wqvi1OT2SQSlV6LniAw-1 X-MC-Unique: j06QEoLKOkiAraUbVtQhww-3 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 16/19] virsh: Move/add some of function declarations to virsh-domain.h Date: Mon, 2 Nov 2020 16:26:18 +0800 Message-ID: <20201102082621.13228-17-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fa5b7fa-6ce1-4e3c-82ec-08d87f0918d5 X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: +KDHpxAhKYswDYyB1LVBwFiugvHQNhu6aglPjM1RnVAoG1HJUSdQftIRYGXbRN862ImRZJWVFHbP/eNfCaFAGBm4zOnhshGqliDU2BhP0khr8PWFiFuRtc4FZMt6XxDCFzB8sQumPxNzJQBZM0gANGE6kv71UcVGtIvot9sIXtJ1h3cpIJ7foEzA/J1+T1ryyJ89jCRbon7q3P1Z6VlVKvU/ss8rwRgMwhYUqiC0YG8S94XnwSR7MmCrVNjJW3WVnAUqdy+sdhCGfJMQN3Jqx9N8RlWqNT2qj6/eIValzLDbfCOESfiYC9DcDeqA7nEIh3I8/y8PPiLUPVpTJm4k0Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(5660300002)(83380400001)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: DqKV6CYL3DKkRCBTx3edXpnqOdvGC2veXd5IcCfau3QJmvkI2G10ZCaqfeKpokVq1mrS7ntIMQQD+m5CMKinElxn4kEgCQG+VsAQL0OdNYxxXOMrWXbO/o2W/kBd+cme1zhyNulFHv9ETxw9ePhw1dI7ixacqN5NG+E2RDpucbCUazY6pUvmyWLN/D+EwY1Dea9J9oBL3WfwVOaMCB+Z52J/qCW0D+zQP3SKYSfaopXuSxFoYdXJ/hvgInTFwUT33O0Ik/pvNJJMnujPBPOxJ+VYWwV5Rx7dMwNdY1FtY57gmCyTxWs/7r9qqhD9PkhXOzQlVhgubDfJ8DhQz/keWxlNSRfHZunnbV302Suzx1CU/Qme3OCy/pQkWOgfBbQgR4xHp7CIP8RZqPlcErcail9carCW2fPXXHp9aVrC1v0FvzIpqbU+3cpiDw80YvAoZ+Cw3V22SQ9EJxwuLw+LrVYLYyiAk+eZkKzNH73lwYIAVnsrlSBQ50jMHxIKrREctDs5qpA/i8Mjr+BMe/TKVBvjhabe2KsigPCYPiUlvZ2bQtKDmfu5wMel7kE0VgzbLgBmVHR1GofwtX7D09cWhF0LpVGhmU3Rs2acWi/Ol4ufthd9XlEvw9xENmw5oqCkTjEHpandTPxoai3h9m2SOQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa5b7fa-6ce1-4e3c-82ec-08d87f0918d5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:12.4952 (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: vB902Vr72s9wdfABqZ0TS94Ij2SlbI0nmchNBNoHmvpIU1URNiMVaLngY/2/SQSm X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A28RNEO031394 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" 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 --- 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 ed7307cdb6..65bbb6c646 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8900,7 +8900,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 ac05f983f9..55938e54c0 100644 --- a/tools/virsh-domain.h +++ b/tools/virsh-domain.h @@ -57,3 +57,7 @@ extern const vshCmdDef domManagementCmds[]; .completer =3D virshDomainInterfaceCompleter, \ .completer_flags =3D VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC, \ } + +VIR_ENUM_DECL(virDomainProcessSignal); +VIR_ENUM_DECL(virDomainLifecycle); +VIR_ENUM_DECL(virDomainLifecycleAction); --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305659; cv=none; d=zohomail.com; s=zohoarc; b=LRC98cUiuEzKOJkazVRtB5Qb9lG/Jvpe1F3JL8cJZ5bLCmF8HZ5WSoK2z1Hqr43PkYbgH3tm+AhaTIEKfGRSu4pCeSXRVBPLQB91bCroXaVuSZV7xd5iuZkWUUXkn7fTKWOWdGvr5Rz+gAEEyjEKSi2+SXUW8YC5GpG9v4aJTGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305659; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VkFTm8GTbbRCUVE4t/FmklN8lLdgYqWvJtLflfvrr4A=; b=L56lj06DSFLXfp/764Bla6gOzBNBrxTF0vHMOtePypyb7x9lShClBGNv2KiprayPt1Biuhu5jZ3Wdu6wGJnMdErTz07R/9dbZpMrr2wPWn4jZLHvwDSCxRQ9Gi93q/WnHCbNheFEbT0qo1lainv1G8w9ryQwu7Sa6/V3xaYdA4A= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1604305659208221.7759567028611; Mon, 2 Nov 2020 00:27:39 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-hXdYiV50Mpaa6dQ41Yec-A-1; Mon, 02 Nov 2020 03:27:35 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 020BF1006CB0; Mon, 2 Nov 2020 08:27:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0CE3672CF; Mon, 2 Nov 2020 08:27:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9BDF58C7CB; Mon, 2 Nov 2020 08:27:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A28RRFi031421 for ; Mon, 2 Nov 2020 03:27:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8FDAD205F389; Mon, 2 Nov 2020 08:27:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89DC62086F64 for ; Mon, 2 Nov 2020 08:27:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 50B2A185A79C for ; Mon, 2 Nov 2020 08:27:24 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-RONwkDh2NgGCr_gGKopJtQ-1; Mon, 02 Nov 2020 03:27:22 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-e0CETeGtOX24hn8iuwdQNg-5; Mon, 02 Nov 2020 09:27:18 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:14 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:14 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:12 +0000 X-MC-Unique: hXdYiV50Mpaa6dQ41Yec-A-1 X-MC-Unique: RONwkDh2NgGCr_gGKopJtQ-1 X-MC-Unique: e0CETeGtOX24hn8iuwdQNg-5 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/19] virsh: Add signal name completion to send-process-signal command Date: Mon, 2 Nov 2020 16:26:19 +0800 Message-ID: <20201102082621.13228-18-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f23769f-feec-4fcb-0e74-08d87f091a0f X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: iFE8VBLiLF5K/e5VnEg5ABjhfLRZVWiI49seZAjFpCpU+zHUVakmIhT5XTsI2HWW1ku4+yGRk5a/jrdn07xnnVFuKqacoUNbfM+lQH/rxcPm2fHRHhlpaYQR67ouGk6wsOWhYd0Ef42AaOspvw2rAYYk/FPq/xg1gq0pQACrQqFNqP+aF7sfqG3jULKMU3N8iDZGpzKgXcfSbu6y5gEc8g8SjPs6laF0NounsJ0/neckVOwqHnEflcxaDIHKj4lfw52yDg25JSo0jmJu1i2QmIkVqDuJuhINNvzjBQ/lLIec2eUOBJYhnZw2OsF6kFNV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(5660300002)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: /IJhzG4zsvbFqYgciZMfE/H7FZNi6tM+1l/6znea1GK/M0rBwkJmrgl+wiC1nYYScKq3dQluD53kjGTf3LkGqbE5wp5NLalmBOZ+I3ehpyeozBVZJp2YkVGG19ElJpKU4JVa3TjhJkTf1N1h+a/9V2n+Dkm22tcLPkCFi0rz0CNkuQnFjINjvxtyOBviTI6/JeOt0XteU31Y2mNMem2gMsbzEbtKBD0LrBAh/t4kAHUMLRsm52loguWReJ32XfweeU5hrFgehh9eUScarc2y1Siah67t5gouI4yhWN6WSf9Ch6EEEndKntQv1bXxx+TqvENkUwA434vzgSDM86MeJFyh4PsVK8jWDxljOujByKeRKSlYFU7nCVc6Z30nNc5wgfSBuXpvV+ZrksT5ZKobea7gYwmqXl6BFsNoaenS1WHuBnfqR6VjX/IHEw7vZ/twVOPpP0kzV547z3B7qps7k7eV1Sefn7TK+oiaz+JfhIq1+W7iSKbvEv3QGcckdLRXXO90JUaKvybABe/yDD7Vdj1KTWikpX6241rsCTMNRzAY5yKXaUSF6xtXUHDh+7WoCL5PbVZyyKQ6BJXSE9c0z1q6niURgnkeEE8wOgbRG7R/oGkNSAeRQir3rW7mEAuKWpFcWXuXNUHB0Kju6NySRw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f23769f-feec-4fcb-0e74-08d87f091a0f X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:14.5860 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y05zaE6xzpqtN7uUEtU/bKVnyMWGjmPHmnaadVaRQTCav/BwramC6FNsMzKOsMP3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A28RRFi031421 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-completer-domain.c | 20 ++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++++ tools/virsh-domain.c | 1 + 3 files changed, 25 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 305711151f..c1151764ff 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -672,3 +672,23 @@ virshDomainConsoleCompleter(vshControl *ctl, =20 return g_steal_pointer(&tmp); } + +char ** +virshDomainSignalCompleter(vshControl *ctl G_GNUC_UNUSED, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + size_t i =3D 0; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + tmp =3D g_new0(char *, VIR_DOMAIN_PROCESS_SIGNAL_LAST + 1); + + for (i =3D 0; i < VIR_DOMAIN_PROCESS_SIGNAL_LAST; i++) { + const char *name =3D virDomainProcessSignalTypeToString(i); + tmp[i] =3D g_strdup(name); + } + + return g_steal_pointer(&tmp); +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 02fea2fe94..cdec66f23e 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -98,3 +98,7 @@ char ** virshDomainVcpulistViaAgentCompleter(vshControl *= ctl, char ** virshDomainConsoleCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainSignalCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 65bbb6c646..f69fbe41a5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8895,6 +8895,7 @@ static const vshCmdOptDef opts_send_process_signal[] = =3D { {.name =3D "signame", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainSignalCompleter, .help =3D N_("the signal number or name") }, {.name =3D NULL} --=20 2.26.0 From nobody Mon May 6 15:11:31 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=1604305663; cv=none; d=zohomail.com; s=zohoarc; b=J3VqzPjCrvidTNBtDTx6xYoelp7/3Jd35+U3hQWp0sLG7Ylj9ihIMlAXDgeYza20jDoNFbvjLnJ7o4HKhXGKkQNZbIGBFNbbM5cTNXC5HT93i1X81FOIWpM2NIS4UpfzHlRRWvQPTQO9EPI+kGPuQiA6K/4fy/GHBnpdp8dWcEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305663; 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=+tMsN7VWUcDkU8hW8dyAsYKmfV5Y3v5zS3nIr0zb0aM=; b=gQ2ogiAA6xrHqSDl/dDB4HbKLEwdcgxhP0yglrDc8iof9rRE7LGiNdspy99GuCZdsMjZCKLa5r5u650eEGMpxrlkWjMlxrBijaOGkwMdfKmjSAUH4caUZooevjf4ETn7+H2w/buivvcoKGGb2jbs3g2rqAFC162SisfREGdk7Ac= 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 1604305663440170.48958698853573; Mon, 2 Nov 2020 00:27:43 -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-198-8WRDRxCQOSelO7O17-7IpA-1; Mon, 02 Nov 2020 03:27:38 -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 BD98B1006C97; Mon, 2 Nov 2020 08:27:32 +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 976BE75124; Mon, 2 Nov 2020 08:27:32 +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 600D58C7D2; Mon, 2 Nov 2020 08:27:32 +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 0A28RRWu031422 for ; Mon, 2 Nov 2020 03:27:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8F9CB205F385; Mon, 2 Nov 2020 08:27:27 +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 89720207B426 for ; Mon, 2 Nov 2020 08:27:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 C81D58582A0 for ; Mon, 2 Nov 2020 08:27:26 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-TpnGcpnpMLq_3b_ZfmQU-g-1; Mon, 02 Nov 2020 03:27:24 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2057.outbound.protection.outlook.com [104.47.5.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-CihGX6XnN5aiI4e7jsh2QQ-7; Mon, 02 Nov 2020 09:27:21 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:16 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:16 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:14 +0000 X-MC-Unique: 8WRDRxCQOSelO7O17-7IpA-1 X-MC-Unique: TpnGcpnpMLq_3b_ZfmQU-g-1 X-MC-Unique: CihGX6XnN5aiI4e7jsh2QQ-7 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 18/19] virsh: Add lifecycle type completion to set-lifecycle-action command Date: Mon, 2 Nov 2020 16:26:20 +0800 Message-ID: <20201102082621.13228-19-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a855f3d2-376e-4bb6-76cf-08d87f091b4f X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:923 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 3WV8QPLmpJCCq0W0qyya0j+7I45rPHlxFbyxLVViKQITUnhwnCe2zVaUM4cFz8BQx81nENt1O+FWYSImx09InJb0Em+vSLR5/OZg6onI5C4fK7a2aWMvJnzOZWesGFTuY3eEY1ZgpoJDQGprc/qCbxtHZ36iHgy5JENvwkWZ6ArbK4q01hdLndkAq+e6sGifWNabwNy3KuTTJTdWlFjVyPgzUMawDk1LhNZT+f8xYWCDiK7i+9D5GhcAnUsOwyXG7mZDB0rp7+jD8oetASsbzKFO4EpfCsBUd2OPic5dV2YS3ql74Flw2Jxcep5bb5SclGWHvLsgGRFPYWGcDixoeA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(5660300002)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(6666004)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: 9pOzDKZJb7mWmGdm9+U9WGxuZOORDrqN0olf6dIaja85oJU00M2n3dG7RfG48kE5aHsht9FymYAnTToMujh6mLqTkKFb4vPzXn4KdcTpfUISBCymgooNoFYBWy5Xj1RHgX7vIOrxgQIEERLt3hODbzHQgNwC5cXfcoAczw7f5tz0ALlqFxltF9/Fvt5CnwfyZbe7+3zoofwtASsQe7/d4bB5sHD9c6qjexccmOkTvfNkaef4gECrSpejcSNEp4kWOnNCKpedxjebriWfxIFdLJqra5x4Xbqd+uLi3Eli9sBrU0DDB2TBMellM2xWT97+YdXQOzrHsIiQ1wZyfJrjBbAESJjEW5t7HzZtFi3CzzCM4RKyt83Ue4TJ0UK+52JqPH2kQ5iPYhmvO9lDBnSwPcmArUoQk6JNU2ID8YPkbPF70AZijXR+gn7A3yVaWZ8WS4r/mX0beiJU4aJtldwy0aSnWIcKi2bQLEO5wHRTDZcW2aI0sdSy9d9icyMwvu2J6t3qHWMyquq3RW5rLr1FprhCYZCU4HsbKFDHO5b2CEUdgAUqBtBYAihqsg5/EnzF0SUwV6/5pLScpzsQ+am2RKnSS/i8u4Cq8kX7VM3FInz2QT4TdLsNGsPHBc1XugGzf0EyJ95vUD3HBf1QB1/jZw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a855f3d2-376e-4bb6-76cf-08d87f091b4f X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:16.6418 (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: eQXjHDHxru+EPkY6sSlsOs/DTY1n6Kct3vkI8zJ3HSLX0x2d2T/G9JgQht0gEyoR X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A28RRWu031422 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 --- 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 c1151764ff..d8ea3d62b3 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -692,3 +692,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 f69fbe41a5..516e55e564 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5707,6 +5707,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 Mon May 6 15:11:31 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=1604305683; cv=none; d=zohomail.com; s=zohoarc; b=PS5YQW2U3/HUwF2g7aQCp7808l9XTOgCjVtd7SWHQpHquyibe1fbrauazdM90J7M7lASkRhAyb6T+E9JAnK075zb7FvGcTvyHTqnw4y2cXa26YHWRxPuf+UlM86i5wJlPyGXXPfpwHtH9lt9b0FIeohqROQka2Joun+vaULtP04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604305683; 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=dEsP5/an9wKVADXuhEJfr1dJjXqZafhK2YoieE8uEPA=; b=C7V3JoC4XUXwq7hhgijYiiTyIktJZioUF498QXzU6LYoLDHd1jUQ4QUGVf9UaF+kxvAMhKpz9Km0F+v+jjtkCq7zVVFLqLAI9OavdOI9h02edYYg46Pb/3iBH6KtLvtdX+zha8sMEiLg5V/QKccbhfx1Kk5HeDpmLg+4p6ESQFc= 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 1604305683777815.7314021788754; Mon, 2 Nov 2020 00:28:03 -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-181-fuJVdF5RPU2g4ZxScGv3Tw-1; Mon, 02 Nov 2020 03:27:38 -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 58CE81006C99; Mon, 2 Nov 2020 08:27:32 +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 2F8851A8EC; Mon, 2 Nov 2020 08:27:32 +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 EE5A6181A8C0; Mon, 2 Nov 2020 08:27:31 +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 0A28RVMU031449 for ; Mon, 2 Nov 2020 03:27:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id F34E1205EB1A; Mon, 2 Nov 2020 08:27:30 +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 ED926205EB18 for ; Mon, 2 Nov 2020 08:27:30 +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 D5098185A790 for ; Mon, 2 Nov 2020 08:27:30 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-1x7QOfchNGiPBosLYkWjdQ-1; Mon, 02 Nov 2020 03:27:28 -0500 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2050.outbound.protection.outlook.com [104.47.5.50]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-39-2n6jpYSiPOa8FXeBrC1EKQ-1; Mon, 02 Nov 2020 09:27:24 +0100 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) by AM6PR04MB6119.eurprd04.prod.outlook.com (2603:10a6:20b:bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Mon, 2 Nov 2020 08:27:18 +0000 Received: from AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712]) by AM6PR04MB5782.eurprd04.prod.outlook.com ([fe80::b5ca:e454:9fad:8712%7]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 08:27:18 +0000 Received: from t440p.suse.asia (60.251.47.115) by AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Mon, 2 Nov 2020 08:27:16 +0000 X-MC-Unique: fuJVdF5RPU2g4ZxScGv3Tw-1 X-MC-Unique: 1x7QOfchNGiPBosLYkWjdQ-1 X-MC-Unique: 2n6jpYSiPOa8FXeBrC1EKQ-1 From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 19/19] virsh: Add lifecycle action completion to set-lifecycle-action command Date: Mon, 2 Nov 2020 16:26:21 +0800 Message-ID: <20201102082621.13228-20-lma@suse.com> In-Reply-To: <20201102082621.13228-1-lma@suse.com> References: <20201102082621.13228-1-lma@suse.com> X-Originating-IP: [60.251.47.115] X-ClientProxiedBy: AM9P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21c::12) To AM6PR04MB5782.eurprd04.prod.outlook.com (2603:10a6:20b:aa::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41f00c48-43e0-419c-0b3f-08d87f091c85 X-MS-TrafficTypeDiagnostic: AM6PR04MB6119: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:923 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: rk+ioMYBv+glpATarl2XiS/OCHT0EgNeY+wkaqmNCTLJF8HK7nc2HVhzEsRGH4rMw3C6rEtSGJckNKqVHT4wV66vIHMmznkkPEWpoBfaStaQhYk43epah7OOB4tZs37u8R44LxtmQSk7JDobeUyU1vSiN7lH2IcGkzPqO7nD/h64W5NiTMkNVgDxgXjzneQeR0OolbT6FOg20h4HyBvDZpOMXL4OkIvd3IqPHXlqnnSEFRpgd/LYQ+VSz91pJ66jZYul+h3MTWDDR25a6fms3YUVCkNpVOv8Cp+p2cNy2PUUmz2Slnx96NuIMzMUrVgVnSybRMIplGjadRJyg/r0Rw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5782.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(6512007)(8676002)(450100002)(316002)(6506007)(66946007)(66556008)(66476007)(2906002)(107886003)(5660300002)(8936002)(4326008)(52116002)(55236004)(6486002)(6916009)(16526019)(186003)(6666004)(36756003)(478600001)(2616005)(956004)(86362001)(26005)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: oMJXidfvMQBYnkmgA3zlWy6KkGaPywlUxzA4lNH09lL894OtJNSoDmyB7Ro72i0iHHGNWo4pAW2iASVqN0TCYXwO3TCLKCU06cG06xoC/MPqS4RImnSKBAhdwDmZzwl58YG6bWb7MXr73i+35cF9uo/UNm7kjBocjWmiyJEq+j1iA405khYcgVXATwg3Raj+BrkReSoBkd8YT5kqbTHZKlBRGO7P/T6+ttstywh0j5pnfnghHg4Vhtyv7B1S3DOuYWUQAyhpJvPKonLudhAq42/elg6U9uUp5WHBIV7ASJQgx1SZ38uND/IkX5bgoL8Xln5vq6mOW50skjeXmU4Lu8ab8o24GaTqbG0NNkru+4/vMW7w+OXiURxszofPYGvEQYXSGGZDrcHMpIRtBKsFHBFnOWMv0WzJkqeK5gFYlVRIUctOfvgg5HD07vDmryGZ4J+FZVHUTr0SWPtSjsa8PyEqNODzazc2eDedLSJTh1tL9yenw6Htt/kEa7OWZyk1Mmg90J9BUiV3rnVMofs01qW2EI7VoVrh+KwWhsvoLha3hvrUT9iRRGTUjpqqoKEhsqOZ5vUlvov1YmwqFX9/TIeALdZlu6FX192H8NtFol8l1PfOUj8Vq/9y0Fa7bKi1kb+BdAK1cOXoJkprm8rYHg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41f00c48-43e0-419c-0b3f-08d87f091c85 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5782.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 08:27:18.6597 (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: ZJmz6XKBC5RNAAQ1jiyjLWhstTv9kj7PSAW5nLDkJGfrVViVKh3X7Qf6xG7zzEej X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6119 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0A28RVMU031449 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-completer-domain.c | 20 ++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++++ tools/virsh-domain.c | 1 + 3 files changed, 25 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index d8ea3d62b3..9d2f41f0eb 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -712,3 +712,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 516e55e564..132cfbf637 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5713,6 +5713,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