From nobody Sun May 5 10:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551756039527742.3008315953084; Mon, 4 Mar 2019 19:20:39 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id BABAB59449; Tue, 5 Mar 2019 03:20:37 +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 80A266013C; Tue, 5 Mar 2019 03:20:37 +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 32CDC181A12A; Tue, 5 Mar 2019 03:20:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x253KIov000653 for ; Mon, 4 Mar 2019 22:20:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 737565DD63; Tue, 5 Mar 2019 03:20:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C0E35D978; Tue, 5 Mar 2019 03:20:16 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 922613092646; Tue, 5 Mar 2019 03:20:15 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id f65so1091626wma.2; Mon, 04 Mar 2019 19:20:15 -0800 (PST) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id l18sm7402167wrv.20.2019.03.04.19.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 19:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PDreowu7AFN4aHjj2VjdHfDSflj8h4Jt3INmhZdEH+Q=; b=VJSyowAs/G9X5NZsm+a2/WURTk5MLBGn2so1LAMKbYbOdcSQJpqIR4V1wQ5PqgWiT3 12B/7rBWvX//GiifQaXL6VEvuGQPJlbO3Tj0MPGdD9TRUvfWfajQnhsWM+49ezxTVAvM fQyMpU0FS4TuNmirS4LPVqGhYCuUjJHcL8tuEqyKvSSmdyUP6P1FLCMTDcshZ0JYFr5X NoVBkYZE1KdwT5Qqac1eQBtUrsc2YrbJ++qcYuuQKDuJT64gW3H/Xi9lMcDnsJ6IQwYr 0nzkVLTnWy+QnlylKh99XHngstef54rUz2EspfTMvkUeRt2AWKQDmFwWG/QqErr5dtpe cezQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PDreowu7AFN4aHjj2VjdHfDSflj8h4Jt3INmhZdEH+Q=; b=Oyrb0qGlzwsRggxUCkNtve+Em6AOqGFOTjL3i0AyIYpxBoVy3+mtQqv5MG43YSb0l4 0fCd/U8rMH+RJFPjwzbqDEf7NzWPhNqaWuWNfxmuCtlXc+oHgrSJW0CYf1TWnX2FSTrq CkvkVby+PTduHI7FOn9zXuMKOg39CVkEawwEX5pQJL20jISV1+SHZRjspwVOvhoSGVg0 i2fT8OtjSex0JzFzCxy/cstYhfB+mFcfWD043tXpyVF49cCOrD80ozkP5vjuPT9x3m+b QjJ9TrHABqWneeDfgDSOg8A8nyh8EhKXZF+uPsgftjePmxA+07pfcj7XUdbhVETgmIOi MphQ== X-Gm-Message-State: APjAAAUbhrnQW5SPZauUnIywNj31ghInT3LF7Yj8AkUpvOtKGSzYQc6j Obedg2StTzf+ELTRRlWRpS/WzYLD X-Google-Smtp-Source: APXvYqypBKh3oysEngyzZ8tUTOb7LbSStX7B51LwqeZYRcI3ByFkqhxFA7fZXr1zlzLnjUYVsJrx7g== X-Received: by 2002:a7b:c38d:: with SMTP id s13mr1103964wmj.151.1551756014112; Mon, 04 Mar 2019 19:20:14 -0800 (PST) From: Lin Ma To: libvir-list@redhat.com Date: Tue, 5 Mar 2019 11:17:36 +0800 Message-Id: <20190305031739.10600-2-lma@suse.com> In-Reply-To: <20190305031739.10600-1-lma@suse.com> References: <20190305031739.10600-1-lma@suse.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 05 Mar 2019 03:20:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 05 Mar 2019 03:20:15 +0000 (UTC) for IP:'209.85.128.42' DOMAIN:'mail-wm1-f42.google.com' HELO:'mail-wm1-f42.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.128.42 mail-wm1-f42.google.com 209.85.128.42 mail-wm1-f42.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma Subject: [libvirt] [PATCH 1/4] virsh: Only return active domain names for detach-device-alias 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 05 Mar 2019 03:20:38 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5699018dcc..c8c4db1b2b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11939,7 +11939,7 @@ static const vshCmdInfo info_detach_device_alias[] = =3D { }; =20 static const vshCmdOptDef opts_detach_device_alias[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "alias", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, --=20 2.19.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155175602603689.28943134172175; Mon, 4 Mar 2019 19:20:26 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 2260030821E0; Tue, 5 Mar 2019 03:20:24 +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 C93865D978; Tue, 5 Mar 2019 03:20:23 +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 7A4623FB13; Tue, 5 Mar 2019 03:20:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x253KLrJ000663 for ; Mon, 4 Mar 2019 22:20:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8139460C7F; Tue, 5 Mar 2019 03:20:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79B7A608DA; Tue, 5 Mar 2019 03:20:19 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61798859FB; Tue, 5 Mar 2019 03:20:18 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id i12so7774955wrw.0; Mon, 04 Mar 2019 19:20:18 -0800 (PST) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id l18sm7402167wrv.20.2019.03.04.19.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 19:20:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9wLWM2KaYs62ZHOfJ+H+lZtL6TMj1yif+wiODUBjV4o=; b=qcETyZWZEm1jXeeyPpaIMXXA9nGVV7Zw4W0fOk2yWLFYXOyU8nsIgrFoeIT1DSBrCw 5N+PdLELJV5/GHAMsqi8fpeZyNmZ8KVXS/lNtmqQiLQ8G1h2KeFoMGhyZ4vo3OOrTijx qcRbTwhCX/UCiuLZsULEvZhY7B5emWnv9KYwBcn8TH+djDbRSFh/xxBRPqxNKn7dGRZG TtOBrrjCc8ATrppDg0g3pRfP3oIhxR/58RSu/h7PQG9ECbst0RbqrxUY7jZ4NkZr7oSh tEi0cmn4R7cou5gKgwIBfCS9YhGl+Yt/BY62F3xMmncZwQXRfUT/NPC20OhynIGv+aUo RaJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9wLWM2KaYs62ZHOfJ+H+lZtL6TMj1yif+wiODUBjV4o=; b=dnV0GtaZwdQOuyhBmojcEJ3/m0+kboLGPupJBeiX0TXfi65w6kSnqg0eqw+EZ4KEDu ie6DuznrBONjThnWJMcHd+Fw0/2w5zgtCKqzwBgmNl4YUCoBOvudGt8lY8NIctdWPWnE Slv4bgK2bSPvBbD+vWLME8AbxQq0khWoUn9/sYQX9Ag1yrO4W3J9ZXOCe7pY5SWX1Ndq +DZ30uyGAyN1b4LL741RmHKNsI+bsUqr8Gfm/ZFJKNBlyFT9cbQobSHYKgntMQhpuLeL 6QlvDVdm1CtBMishZ99fHVzO0pSBNWGS9dA2U/IMVc6+7rEnclpf3jB/5wRlf4rCmkYh yRVQ== X-Gm-Message-State: APjAAAVbOqITmkZuN9vMGAMIuzwtZpYgHSi7nhuNXuFpPwEgoINVfTpb NyQwpDs8q3T5JP5LMKYQyeeApk+f X-Google-Smtp-Source: APXvYqyRSyiuj54HIR82bbkgbaftXDkOFVn4T47oP7twN67eq8Cqp70p01PpwHsV+BpZLlO5XchoWg== X-Received: by 2002:a5d:570a:: with SMTP id a10mr11187608wrv.85.1551756016914; Mon, 04 Mar 2019 19:20:16 -0800 (PST) From: Lin Ma To: libvir-list@redhat.com Date: Tue, 5 Mar 2019 11:17:37 +0800 Message-Id: <20190305031739.10600-3-lma@suse.com> In-Reply-To: <20190305031739.10600-1-lma@suse.com> References: <20190305031739.10600-1-lma@suse.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 05 Mar 2019 03:20:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 05 Mar 2019 03:20:18 +0000 (UTC) for IP:'209.85.221.47' DOMAIN:'mail-wr1-f47.google.com' HELO:'mail-wr1-f47.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.47 mail-wr1-f47.google.com 209.85.221.47 mail-wr1-f47.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma Subject: [libvirt] [PATCH 2/4] virsh: Add device name completion for target option of detach-disk command 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 05 Mar 2019 03:20:24 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c8c4db1b2b..911727cde6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -12548,6 +12548,7 @@ static const vshCmdOptDef opts_detach_disk[] =3D { {.name =3D "target", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainDiskTargetCompleter, .help =3D N_("target of disk device") }, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, --=20 2.19.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551756028508547.0896916352466; Mon, 4 Mar 2019 19:20:28 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 8B58A86677; Tue, 5 Mar 2019 03:20:26 +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 67FAA608DA; Tue, 5 Mar 2019 03:20:26 +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 16B283FB15; Tue, 5 Mar 2019 03:20:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x253KOCA000674 for ; Mon, 4 Mar 2019 22:20:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id C13FE6013C; Tue, 5 Mar 2019 03:20:24 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6776600C2; Tue, 5 Mar 2019 03:20:22 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32C3A36961; Tue, 5 Mar 2019 03:20:21 +0000 (UTC) Received: by mail-wr1-f46.google.com with SMTP id o17so7780113wrw.3; Mon, 04 Mar 2019 19:20:21 -0800 (PST) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id l18sm7402167wrv.20.2019.03.04.19.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 19:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OsK4GJasJmZsJVzSxzQsELXXwYOx1Ft3LEhDw6nJmpE=; b=Rt068AQzTTZRAkiIcY4FguO3ebXU+dejc0FKkn8MZYXMDLsgJh4YgYRmq6y0RBexQa YtI3lblsOySJJD450pcZNUJMOITJIfg9qx02I9H3V2huAYPCsSabZrfzRzYSxxGr0J9z X3WUGnlhOpmLxgbrzIsRhP8zUr+UCZURzjiuPqge9IceAUCkxQspV/gzkc2uW5OwBPy8 It0Q58osz7B+iDGdcAwx//e1mWD1OSbGHpgXlCOXvOWR0PyxsqOVrS47fPaCG4iZFkjQ 4F/o5YdGT41ATRQTjb/HJ3YV+sGfosE8sSkeQ4hVB7v5wEj+TUXKU7XQZMWJiHaI3U7M FxBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OsK4GJasJmZsJVzSxzQsELXXwYOx1Ft3LEhDw6nJmpE=; b=kLSG4u9H/S2oXBtlpOhT8xVutsuDf2v8KDQv+K/yNYemLPZT1LXDR8n5cdDQV7EzKh xo6RwxdI8MMoKu3haLSDg+1xH8U+T4yRaqiAdIYWdKj7m4BQ9RA0WT2RB8V/0ZWR+IGs JZxA50Id/xKwDnX+ss+wRIprGL0R+i7KIbuskAdy88WhtnQRwoWy+Q7L5Zg5kT4FjOsj h3HiQ2vHTBC3ZVzeH4NAgBYAaiXYNfMAefxUdvFw4A3PowK6KpkvqZWDJAHQr/aVaQlm dBPNxdB5v7k7iAXajmrPN6klzUbSZeS+KSqMFs0R58UD5OyiRUnlQJXRdRRE0NDlNzYU GpKg== X-Gm-Message-State: APjAAAVafATv7YdczdDs5qzOd+TpEU+1DzSdsf68YV5O615obMpEYmRo lGbujgiyTOST3G39v9I1BPltpBmB X-Google-Smtp-Source: APXvYqzJEeIaRcJYeTlY4KWhg8iaACueEok1LlXVMP0r9/OSG/TpT5skZxgV1R6oDVB6xQIcCEuAtA== X-Received: by 2002:adf:9dc4:: with SMTP id q4mr15332569wre.330.1551756019685; Mon, 04 Mar 2019 19:20:19 -0800 (PST) From: Lin Ma To: libvir-list@redhat.com Date: Tue, 5 Mar 2019 11:17:38 +0800 Message-Id: <20190305031739.10600-4-lma@suse.com> In-Reply-To: <20190305031739.10600-1-lma@suse.com> References: <20190305031739.10600-1-lma@suse.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 05 Mar 2019 03:20:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 05 Mar 2019 03:20:21 +0000 (UTC) for IP:'209.85.221.46' DOMAIN:'mail-wr1-f46.google.com' HELO:'mail-wr1-f46.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.46 mail-wr1-f46.google.com 209.85.221.46 mail-wr1-f46.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma Subject: [libvirt] [PATCH 3/4] virsh-network: Introduce virshNetworkEventCallback to handle network events 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 05 Mar 2019 03:20:27 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-network.c | 17 ++++++++++++++--- tools/virsh-network.h | 8 ++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 9b86ef8071..d5b3649050 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1156,6 +1156,7 @@ struct virshNetEventData { bool loop; bool timestamp; int count; + virshNetworkEventCallback *cb; }; typedef struct virshNetEventData virshNetEventData; =20 @@ -1195,6 +1196,12 @@ vshEventLifecyclePrint(virConnectPtr conn ATTRIBUTE_= UNUSED, vshEventDone(data->ctl); } =20 +virshNetworkEventCallback virshNetworkEventCallbacks[] =3D { + { "lifecycle", + VIR_NETWORK_EVENT_CALLBACK(vshEventLifecyclePrint), }, +}; +verify(VIR_NETWORK_EVENT_ID_LAST =3D=3D ARRAY_CARDINALITY(virshNetworkEven= tCallbacks)); + static const vshCmdInfo info_network_event[] =3D { {.name =3D "help", .data =3D N_("Network Events") @@ -1246,7 +1253,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) size_t i; =20 for (i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i++) - vshPrint(ctl, "%s\n", virshNetworkEventIdTypeToString(i)); + vshPrint(ctl, "%s\n", virshNetworkEventCallbacks[i].name); return true; } =20 @@ -1256,7 +1263,10 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) vshError(ctl, "%s", _("either --list or --event is required= ")); return false; } - if ((event =3D virshNetworkEventIdTypeFromString(eventName)) < 0) { + for (event =3D 0; event < VIR_NETWORK_EVENT_ID_LAST; event++) + if (STREQ(eventName, virshNetworkEventCallbacks[event].name)) + break; + if (event =3D=3D VIR_NETWORK_EVENT_ID_LAST) { vshError(ctl, _("unknown event type %s"), eventName); return false; } @@ -1265,6 +1275,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) data.loop =3D vshCommandOptBool(cmd, "loop"); data.timestamp =3D vshCommandOptBool(cmd, "timestamp"); data.count =3D 0; + data.cb =3D &virshNetworkEventCallbacks[event]; if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0) return false; =20 @@ -1274,7 +1285,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) goto cleanup; =20 if ((eventId =3D virConnectNetworkEventRegisterAny(priv->conn, net, ev= ent, - VIR_NETWORK_EVENT_CAL= LBACK(vshEventLifecyclePrint), + data.cb->cb, &data, NULL)) < 0) goto cleanup; switch (vshEventWait(ctl)) { diff --git a/tools/virsh-network.h b/tools/virsh-network.h index 0fff4b7748..9c86eb5bc9 100644 --- a/tools/virsh-network.h +++ b/tools/virsh-network.h @@ -32,6 +32,14 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *= cmd, virshCommandOptNetworkBy(_ctl, _cmd, _name, \ VIRSH_BYUUID | VIRSH_BYNAME) =20 +struct virshNetworkEventCallback { + const char *name; + virConnectNetworkEventGenericCallback cb; +}; +typedef struct virshNetworkEventCallback virshNetworkEventCallback; + +extern virshNetworkEventCallback virshNetworkEventCallbacks[]; + extern const vshCmdDef networkCmds[]; =20 #endif /* LIBVIRT_VIRSH_NETWORK_H */ --=20 2.19.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:28:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15517560390180.42087502247068187; Mon, 4 Mar 2019 19:20:39 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 51805859FB; Tue, 5 Mar 2019 03:20:37 +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 1DE5D1A7DB; Tue, 5 Mar 2019 03:20:37 +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 CD26A181A010; Tue, 5 Mar 2019 03:20:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x253KOIp000679 for ; Mon, 4 Mar 2019 22:20:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id EBA5818BB0; Tue, 5 Mar 2019 03:20:24 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E52A75D978; Tue, 5 Mar 2019 03:20:24 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5CA3307E040; Tue, 5 Mar 2019 03:20:23 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id i12so7775088wrw.0; Mon, 04 Mar 2019 19:20:23 -0800 (PST) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id l18sm7402167wrv.20.2019.03.04.19.20.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 19:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AL6OdpOhbzKn/87jc022hXr2EgRyV8uRLoLEER7AxGE=; b=pfNqQtxsMzQMg4PHQZPMHkXUxbKCX1qQ9GozIaGY8Fl1MASdW39zQpeFuguf9mETsr osTPJ+akK2UIkkHDJ7OHgKLK+q8DmZCeJX4jbKs80/Vm3XxsOhcl5jLC3sARxLViedoi VUy7FtKAWwNYp2kJ+TjRTiXsGU4wciRPk9TYFm6feA1xlWZrwqJVQXHXx29vDmWsGiBn pfmdr9EyPEOuBrRknoPqypB6Wlp8izZMLMXFl8NysWzaB312rHGkljGuI0kLZsPnNyxV ZlVk831notym+7Ik+g5JDITErHckyqRHD+InNUwUJJtUtu2VD6GNoZnu6yp/PvLc9z0r decg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AL6OdpOhbzKn/87jc022hXr2EgRyV8uRLoLEER7AxGE=; b=dEu1dXuL0HPbqhUU6bgSvwp2C4VQoEbg1SYenrwwcHR0oZusw7uunzKeWfIwqpABeo HgQF6vhZcAgiBMaziXLdTrs9VzmXKxLNaCr+SODCcE36r/aVtN3OV+mxhAky0HexhzsO u2LlF0JzeieR8swQrdx3TZFGUS22t5dZWtHMa1BWHkSTqSiPmwrl/aUUh9TptWuMuVCA jKpoGt0YtYtijZh4qMcIBjzGQ7yig5y+rRL+Jf7UncK9B44G6bzAehzg6huNfczWX6mn y9/iFGeeXLkklS1PsZelrIInifda0QRhhw71ROIlxfZ1nZ4nUmiwQjDnDg6xJxKL+W5h heuQ== X-Gm-Message-State: APjAAAXKzKmB2g3dAqvYDcBU+ra3bUYA8yj1G1ZbkyeOcwMUpxFdSh8d F/2JRjmU3WytEiHvvOwT36q7yct+ X-Google-Smtp-Source: APXvYqzzHNMtt9y+d3XKEMXk2wVMZ2tunJc0GSqfpuKnpHa6vnyloKvuV2TWN5oMKytM7FOPdv+ggQ== X-Received: by 2002:adf:a4c9:: with SMTP id h9mr14341179wrb.254.1551756022449; Mon, 04 Mar 2019 19:20:22 -0800 (PST) From: Lin Ma To: libvir-list@redhat.com Date: Tue, 5 Mar 2019 11:17:39 +0800 Message-Id: <20190305031739.10600-5-lma@suse.com> In-Reply-To: <20190305031739.10600-1-lma@suse.com> References: <20190305031739.10600-1-lma@suse.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 05 Mar 2019 03:20:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 05 Mar 2019 03:20:24 +0000 (UTC) for IP:'209.85.221.50' DOMAIN:'mail-wr1-f50.google.com' HELO:'mail-wr1-f50.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.50 mail-wr1-f50.google.com 209.85.221.50 mail-wr1-f50.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, Lin Ma Subject: [libvirt] [PATCH 4/4] virsh: Add event name completion to 'network-event' command 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 05 Mar 2019 03:20:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma --- tools/virsh-completer.c | 27 +++++++++++++++++++++++++++ tools/virsh-completer.h | 4 ++++ tools/virsh-network.c | 1 + 3 files changed, 32 insertions(+) diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c index 7c68e2e832..c4adbb70d0 100644 --- a/tools/virsh-completer.c +++ b/tools/virsh-completer.c @@ -27,6 +27,7 @@ #include "virsh-nodedev.h" #include "virsh-util.h" #include "virsh-secret.h" +#include "virsh-network.h" #include "internal.h" #include "virutil.h" #include "viralloc.h" @@ -415,6 +416,32 @@ virshNetworkNameCompleter(vshControl *ctl, } =20 =20 +char ** +virshNetworkEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED, + const vshCmd *cmd ATTRIBUTE_UNUSED, + unsigned int flags) +{ + size_t i =3D 0; + char **ret =3D NULL; + + virCheckFlags(0, NULL); + + if (VIR_ALLOC_N(ret, VIR_NETWORK_EVENT_ID_LAST + 1) < 0) + goto error; + + for (i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i++) { + if (VIR_STRDUP(ret[i], virshNetworkEventCallbacks[i].name) < 0) + goto error; + } + + return ret; + + error: + virStringListFree(ret); + return NULL; +} + + char ** virshNodeDeviceNameCompleter(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED, diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h index 4563fd76ac..2e2e1edafb 100644 --- a/tools/virsh-completer.h +++ b/tools/virsh-completer.h @@ -55,6 +55,10 @@ char ** virshNetworkNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); =20 +char ** virshNetworkEventNameCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); + char ** virshNodeDeviceNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); diff --git a/tools/virsh-network.c b/tools/virsh-network.c index d5b3649050..9adc63a8fa 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1216,6 +1216,7 @@ static const vshCmdOptDef opts_network_event[] =3D { VIRSH_COMMON_OPT_NETWORK_OT_STRING(N_("filter by network name or uuid"= ), 0), {.name =3D "event", .type =3D VSH_OT_STRING, + .completer =3D virshNetworkEventNameCompleter, .help =3D N_("which event type to wait for") }, {.name =3D "loop", --=20 2.19.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list