From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808442; cv=none; d=zohomail.com; s=zohoarc; b=QFqZ3BHtnoji9WhfkCCEQ6PBlRHQib0ut0GBkZffjECJD4mumkRQi/yeeW4d2dtPBaXwVqp0cTAHTpdDSMSo2w8bT6t8ZFrKgV79v6t2lyTLDbL66B/rcVI34wg31trkK72Nz2tI9u5Q470UwIvzjzRqdvaa/7HA9YgOtjQRMuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808442; 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=hpn0Gno5SqNe1Q1AIE81qgPwIVc8s64VBDZ8+Y60xy4=; b=DS4qJP5HshgDTdfYbC/9r1Ds5OCqOhBrgHQdFEVxxw/nGfS03pJZmeJ0p0pybtfRAAPEqhPvJnqKUW6/iTorU/V0ExxHWjWf7+BiDMy3cNlPX7NKi6vioV+mf8aGzbqVxIbNKP7yyOKII/90rsLdDPW5ZH8J65XC8fXmVyc8B+k= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599808442922504.6793361433199; Fri, 11 Sep 2020 00:14:02 -0700 (PDT) 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-465-VxbpsVD5NzalJ4L35pxoMw-1; Fri, 11 Sep 2020 03:13:59 -0400 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 D77E9801AB5; Fri, 11 Sep 2020 07:13:53 +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 CFEAB81C42; Fri, 11 Sep 2020 07:13:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CDB81922F6; Fri, 11 Sep 2020 07:13:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08B7Do0O008993 for ; Fri, 11 Sep 2020 03:13:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 54FA7117DB23; Fri, 11 Sep 2020 07:13:50 +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 501DC117DB1C for ; Fri, 11 Sep 2020 07:13:47 +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 845A8101AA42 for ; Fri, 11 Sep 2020 07:13:47 +0000 (UTC) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-kem1zQ70Ph6kzFMizxjEkA-1; Fri, 11 Sep 2020 03:13:44 -0400 Received: by mail-pg1-f195.google.com with SMTP id 34so5965362pgo.13; Fri, 11 Sep 2020 00:13:44 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:42 -0700 (PDT) X-MC-Unique: VxbpsVD5NzalJ4L35pxoMw-1 X-MC-Unique: kem1zQ70Ph6kzFMizxjEkA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hpn0Gno5SqNe1Q1AIE81qgPwIVc8s64VBDZ8+Y60xy4=; b=N6xPJLhyo/gDu6n5XRtHc5ajcoFdFYpMZKOyDijClvQAldR2eF6hxPHQrVrWKoezKB kCQBEfWR4FCatDC56n8WaQqR0O6Pd0hMXcNnMJ2LEAEcI+3V7nsKCYrXkd1w759JMzOz eX7siIUBs2XWtyja/D9/1x0TklzTMUvK2D4C7roGUIjtieNV3Tge5Kn1oChJl0plWj2M CVg3h2v4vv4Fv4E7IEfIakAcABfxJsddveISKUJ3iTniE1EDUn5q8qtQ7JdX0cEJ7c2H GFP0LI5MrXuN9WuuJDHtzstau483Jbx/bXSsp5WZIpqGssFiuVe3JF/TSm8yraaHrnQI wrJQ== X-Gm-Message-State: AOAM531tZxV0F8Po3t9nJIg0tk1hDgRnVEFyUujBJ9NHikfNatg3dVlx maYGwTNSlKDE0gAPCxagi3tzASlm1htXIg== X-Google-Smtp-Source: ABdhPJwy5lPZsjAMI2Dp4CEFBQcJRNL4vfgQFACCxajUlTFn61RIqeyc2UnF5wq2nKxELJ4xS+cPKA== X-Received: by 2002:a17:902:82c1:: with SMTP id u1mr756903plz.38.1599808423132; Fri, 11 Sep 2020 00:13:43 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/17] virshDomainNameCompleter: Add some of VIR_CONNECT_LIST_DOMAINS_ flags Date: Fri, 11 Sep 2020 15:13:02 +0800 Message-Id: <20200911071318.12495-2-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 3b225256 removed unused VIR_CONNECT_LIST_DOMAINS_* flags, But some of them will be used in upcoming patches, So add some of them back. Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 4472ee08f2..4c1261b06b 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -48,7 +48,10 @@ virshDomainNameCompleter(vshControl *ctl, VIR_CONNECT_LIST_DOMAINS_PAUSED | VIR_CONNECT_LIST_DOMAINS_PERSISTENT | VIR_CONNECT_LIST_DOMAINS_RUNNING | - VIR_CONNECT_LIST_DOMAINS_SHUTOFF, + VIR_CONNECT_LIST_DOMAINS_SHUTOFF | + VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | + VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | + VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT, NULL); =20 if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808448; cv=none; d=zohomail.com; s=zohoarc; b=PpzuU08tkZX3ZRcPvwBrEiX/MPGGYJoMSaDDeHYFMRutXv0iS3BjIPz7TP49PEu81txSdr5+kFFxP/Pwnwo9nrCan+3trEgPp/CGAzlAxF+GjAty8o7An5Z+pcg30Bqjgv7sT/Ql6SfOzH0i6iE3igLiY5AWmJWz98LvnRhO7bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808448; 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=xSe/3+yzkcUp5P9/6Xuw3xGm9GdV5Rr5L5Uv6k81qP0=; b=dnQQuXsvMPicJ5lpl/7ZyCkHttlIa/HXCltZN9og+A97shNZAameiGltzWNAlU8sMoPI06EkA/U5u8GsRyBromoC/yM1kR8wmrAMolPgqcwq8QZwOh/Ei/zXRStHX3xR0cAgJqkJGfYeyajpLXL2IJRLB5//3tcRtyDFjyZK6yE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599808448022203.82821882913595; Fri, 11 Sep 2020 00:14:08 -0700 (PDT) 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-363-vZ-XhZBwMuuVzSXGN1xR0g-1; Fri, 11 Sep 2020 03:14:04 -0400 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 6F62E10BBEE0; Fri, 11 Sep 2020 07:13:58 +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 4E9A27512D; Fri, 11 Sep 2020 07:13:58 +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 14B2492307; Fri, 11 Sep 2020 07:13:58 +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 08B7DrOM009017 for ; Fri, 11 Sep 2020 03:13:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99A49202451D; Fri, 11 Sep 2020 07:13:53 +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 9516B202450E for ; Fri, 11 Sep 2020 07:13:51 +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 0DB9E18AE953 for ; Fri, 11 Sep 2020 07:13:51 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-tPa1uLbDOzKnrw8Wl8ORBw-1; Fri, 11 Sep 2020 03:13:46 -0400 Received: by mail-pf1-f195.google.com with SMTP id o68so6727378pfg.2; Fri, 11 Sep 2020 00:13:46 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:44 -0700 (PDT) X-MC-Unique: vZ-XhZBwMuuVzSXGN1xR0g-1 X-MC-Unique: tPa1uLbDOzKnrw8Wl8ORBw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xSe/3+yzkcUp5P9/6Xuw3xGm9GdV5Rr5L5Uv6k81qP0=; b=SfF8ahDOLGRbi0VX0uC/CHieCcQ1KL5BITEhUi7NX2vecqC5h5HYlNfbLxt2n8itPi F8ly709JuASy0FOPbmxRTu0hY6/MrXEVFgBJam6UkbyRF8FlskpQTJjRn3BmtMM5g9Gb oK5hhT8/iCzwtKoCGkBg7etDpfhZzRU3cs4xSe56hr9cIjMhRJgJyRwMPlz1UC0Y7kii AFYBteKhpvJNoc4ZEQnM970k11eTz3qoUvgkDNN6hJk7ATrV4NEqVYpJ03GSvl9kTPsr Uwn0ie3Gk0OUrG7ZQeiI2Z971JGTyRvTDaUbvGwuR7gS6Y/mXIzTXMsriJ71Z1jQggqZ zJKQ== X-Gm-Message-State: AOAM531ShAqFwjbh3ITnSpba2EUTlA9hA30/f0gb//AIciCWFKCyFZjT oyguwZFumj0u0GWEpvLu3I9j4tACVEOKOA== X-Google-Smtp-Source: ABdhPJzH/vsVoWEFpddibXCHtJwdpURSZpHWU2C26bPcKfhIS53ky4XigIgtdGUfEWhouBc4FSRg1g== X-Received: by 2002:a17:902:9341:: with SMTP id g1mr710861plp.94.1599808425306; Fri, 11 Sep 2020 00:13:45 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/17] virsh: snapshot: Only return domains that have snapshot images Date: Fri, 11 Sep 2020 15:13:03 +0800 Message-Id: <20200911071318.12495-3-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-snapshot.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 8b16d77b56..99e3d98c6f 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -511,7 +511,7 @@ static const vshCmdInfo info_snapshot_edit[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_edit[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_STRING, .help =3D N_("snapshot name"), @@ -624,7 +624,7 @@ static const vshCmdInfo info_snapshot_current[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_current[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "name", .type =3D VSH_OT_BOOL, .help =3D N_("list the name, rather than the full xml") @@ -856,7 +856,7 @@ static const vshCmdInfo info_snapshot_info[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_info[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_STRING, .help =3D N_("snapshot name"), @@ -1406,7 +1406,7 @@ static const vshCmdInfo info_snapshot_list[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_list[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "parent", .type =3D VSH_OT_BOOL, .help =3D N_("add a column showing parent snapshot") @@ -1669,7 +1669,7 @@ static const vshCmdInfo info_snapshot_dumpxml[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_dumpxml[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, @@ -1733,7 +1733,7 @@ static const vshCmdInfo info_snapshot_parent[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_parent[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_STRING, .help =3D N_("find parent of snapshot name"), @@ -1793,7 +1793,7 @@ static const vshCmdInfo info_snapshot_revert[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_revert[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_STRING, .help =3D N_("snapshot name"), @@ -1878,7 +1878,7 @@ static const vshCmdInfo info_snapshot_delete[] =3D { }; =20 static const vshCmdOptDef opts_snapshot_delete[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name =3D "snapshotname", .type =3D VSH_OT_STRING, .help =3D N_("snapshot name"), --=20 2.26.0 From nobody Sat Apr 27 04:38:48 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808446; cv=none; d=zohomail.com; s=zohoarc; b=ULBMf37z5GNDoAZPAIO+j05oogrgmZkin08k5MvEz5i+4otYaLOnH2RWKez6NkqkMRkeL7xGrdX7LF9kDEF/TcPlyiLlvjY5hggXuvexYtUQa/k7kvWkHfllsr2RAhStbAxXfuKNaq5C2rXieyo0a+TAKWd8sJDIIz/IWqN2YSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808446; 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=+sATER0qIhG2+T2Gi1FhLkfFyP2EmTP3ItBjq6YJ+1Q=; b=gtzxAkmg42BzoD6nukFR88kAj04vDlAyalxza/4+gbAFHH0FD/vhZYkLqFkXx1qbq/8XRymj6a3TRCCsT/Jza6uBf1zqNEPEJ57yWFaKuso4sKq0vxTHAxTCflXjx9KthTUj2b9PSWWsOPQSuAnOMX2XqxlQlSsJiv4GfxkQnpE= 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 1599808446963656.2291827696356; Fri, 11 Sep 2020 00:14:06 -0700 (PDT) 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-512-ofqwbGwxOuOBwHDbtEqjDQ-1; Fri, 11 Sep 2020 03:14:03 -0400 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 6E78F425DD; Fri, 11 Sep 2020 07:13:58 +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 5121581C50; Fri, 11 Sep 2020 07:13:58 +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 2161792301; Fri, 11 Sep 2020 07:13:58 +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 08B7Dre6009016 for ; Fri, 11 Sep 2020 03:13:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 66DD2202450A; Fri, 11 Sep 2020 07:13:53 +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 5E8DD2028DC0 for ; Fri, 11 Sep 2020 07:13:51 +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 2951980096B for ; Fri, 11 Sep 2020 07:13:51 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-GNFaw3xTOROI-7wf_TDGBQ-1; Fri, 11 Sep 2020 03:13:49 -0400 Received: by mail-pf1-f196.google.com with SMTP id w7so6611215pfi.4; Fri, 11 Sep 2020 00:13:48 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:46 -0700 (PDT) X-MC-Unique: ofqwbGwxOuOBwHDbtEqjDQ-1 X-MC-Unique: GNFaw3xTOROI-7wf_TDGBQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+sATER0qIhG2+T2Gi1FhLkfFyP2EmTP3ItBjq6YJ+1Q=; b=KGVUn6ohhfL8/JN8QC1JsQ0VmGDg2O5IlmWQ6bV8SY5uUVGuoZGptLkL4PiJmJ0w46 0LdFfPvzq5I03RpBG8qaRGnapHnCFIXCREOvVbvqFsMU7ahLn3NQZ8T2Kj6Nltks9jvA Pt7hxxQT1HAm74H+lBJsmGVMxzMl1LECkYpWseg30kUXFAUJh6le5J4aTBXGmzVdwZIj 9eHuEYH/+wcRP6M90FNKcEvYc7t6rzbNJM29YE5CYelKG4MJ1QjS2FYIIEDImitsZcKN 82vhitv2wNanu0ikeC2/8c023kvXvSESeqC5+wffK1tQkpXYMrTsIv9Wh44/2NID6RHf 9QBw== X-Gm-Message-State: AOAM530yVRGacAYRB5Or2Jqlg4wvHZ8+VCZXGG456tLnJ4D6h5oeka4G h+DGv7zb7204iQfDDE5A/afwPaP8+fMRhQ== X-Google-Smtp-Source: ABdhPJyNZVoIA/OFC8IGRDtxfUM1scv8+oJrJwvz1w1Uita5B3MZPOe1bsr+7s0VNGMmhiLMdNOe5A== X-Received: by 2002:a62:5801:: with SMTP id m1mr959168pfb.31.1599808427527; Fri, 11 Sep 2020 00:13:47 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/17] virsh: managedsave-*: Only return domains that have a managed save image Date: Fri, 11 Sep 2020 15:13:04 +0800 Message-Id: <20200911071318.12495-4-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d1d3f8e566..68600d728a 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4848,7 +4848,7 @@ static const vshCmdInfo info_managedsaveremove[] =3D { }; =20 static const vshCmdOptDef opts_managedsaveremove[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE), {.name =3D NULL} }; =20 @@ -4903,7 +4903,7 @@ static const vshCmdInfo info_managed_save_edit[] =3D { }; =20 static const vshCmdOptDef opts_managed_save_edit[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE), {.name =3D "running", .type =3D VSH_OT_BOOL, .help =3D N_("set domain to be running on start") @@ -4969,7 +4969,7 @@ static const vshCmdInfo info_managed_save_dumpxml[] = =3D { }; =20 static const vshCmdOptDef opts_managed_save_dumpxml[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE), {.name =3D "security-info", .type =3D VSH_OT_BOOL, .help =3D N_("include security sensitive information in XML dump") @@ -5017,7 +5017,7 @@ static const vshCmdInfo info_managed_save_define[] = =3D { }; =20 static const vshCmdOptDef opts_managed_save_define[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE), {.name =3D "xml", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808451; cv=none; d=zohomail.com; s=zohoarc; b=X4gtXwFYLt8oo41Ju7uREROZ10o+LVM3KJDcNcd31Kths/uA6voG8OF+5fHSgNU6DMguR6sNlrGKeVll+8tEcaHgLU0GDzRP+NST1SgydxyhK8IdeAafGKyyBOj5O1+Fx1EhGB8364EnLe/8gBZmHfHE1kwkj6QV7jii92Lrj1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808451; 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=XS1CJ2rkaSvZWQyMacHdsEE66FptdRjxzUESHnK4dfE=; b=SwfjJivPbM92qRP9rx/FwvO4GQVVcVj+Shvnbrf5ubY62u6bsLq/oo7I1TO8F9YsLRnLmtcq9aZZ1TaOLh23gT9yhyOdOsFS/n/11IJoLPB7x1/7yKZPXapGQrZH16nP8UBqT4e2pQYbqSdk17Golb2go9dZomcibABHt7Bbfjc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1599808451167262.2753798084482; Fri, 11 Sep 2020 00:14:11 -0700 (PDT) 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-524-u6Ivknr7N8ypSfm540E8JA-1; Fri, 11 Sep 2020 03:14:08 -0400 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 E73E010BBECE; Fri, 11 Sep 2020 07:14:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C259310027A4; Fri, 11 Sep 2020 07:14:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A064181A07C; Fri, 11 Sep 2020 07:14:00 +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 08B7Dwud009054 for ; Fri, 11 Sep 2020 03:13:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id D00D810FAA1; Fri, 11 Sep 2020 07:13:58 +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 C7F0D10FAA2 for ; Fri, 11 Sep 2020 07:13:55 +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 BD4DA18AE947 for ; Fri, 11 Sep 2020 07:13:55 +0000 (UTC) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-SM_sWcD7N1Sh8dRjWlhwKA-1; Fri, 11 Sep 2020 03:13:51 -0400 Received: by mail-pj1-f67.google.com with SMTP id s2so1260431pjr.4; Fri, 11 Sep 2020 00:13:51 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:48 -0700 (PDT) X-MC-Unique: u6Ivknr7N8ypSfm540E8JA-1 X-MC-Unique: SM_sWcD7N1Sh8dRjWlhwKA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XS1CJ2rkaSvZWQyMacHdsEE66FptdRjxzUESHnK4dfE=; b=VaOSElrz9oXjBMd3qEOnWGw41Zhp0qKFKC+E/3IuotoQqBt4hS60hpqGnzvRYbRMoX UOtXCnbJpnnLC6cG0/X+xYu/tAH6iv8aLh4K/LfYSwBKw+Xd0PzCHCMnbyexz4dIlVuu MX6HOGrHIJTDemNtye6sRO8QeZEF7LyNWjin+4xWqolMpRjtf8OTThjqa+1NiUJSvG06 iviGmHbZgDUmhF5OFTKcW96p7Gxff51AiOBoQWbU7j9c1Yxy4Df5Zx71Xw4B/Mp2E6w5 uYFyiSyOdaAYXrVqautofU1TjfIEYYOUUqinX9m1rdSKSIylcptc9V7A5KMNnDChfVXH FNMw== X-Gm-Message-State: AOAM5301Pdt3iG7eW85+AxKrZbgWESpBOZINYtrq+Bop1rw9ULQM/dR5 DLEIW7dfhtBp/u3OYt2AMGrvR7HoTNBuuQ== X-Google-Smtp-Source: ABdhPJxOetdndvqnz5t1WsTV5yonjxglJL1g3pb24aKuB1TD20oO/CWVXOSV9lHxv/Alb87CNz4aVA== X-Received: by 2002:a17:90a:4d47:: with SMTP id l7mr1013656pjh.30.1599808429833; Fri, 11 Sep 2020 00:13:49 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/17] virsh: checkpoint: Only return domains that have checkpoints Date: Fri, 11 Sep 2020 15:13:05 +0800 Message-Id: <20200911071318.12495-5-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-checkpoint.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 411eac7fc8..c4ff863802 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -332,7 +332,7 @@ static const vshCmdInfo info_checkpoint_edit[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_edit[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("checkpoint name"), @@ -452,7 +452,7 @@ static const vshCmdInfo info_checkpoint_info[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_info[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("checkpoint name"), @@ -662,7 +662,7 @@ static const vshCmdInfo info_checkpoint_list[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_list[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "parent", .type =3D VSH_OT_BOOL, .help =3D N_("add a column showing parent checkpoint") @@ -879,7 +879,7 @@ static const vshCmdInfo info_checkpoint_dumpxml[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_dumpxml[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("checkpoint name"), @@ -954,7 +954,7 @@ static const vshCmdInfo info_checkpoint_parent[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_parent[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("find parent of checkpoint name"), @@ -1015,7 +1015,7 @@ static const vshCmdInfo info_checkpoint_delete[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_delete[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("checkpoint name"), --=20 2.26.0 From nobody Sat Apr 27 04:38:48 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808448; cv=none; d=zohomail.com; s=zohoarc; b=E0Fnt+sW7ReJa7Oa990dvIWph91jMpBth5oBGU+RkntKD+2DusQdPW/iHYo4wAB7q2UdQcJFS1EG7WC+NwT1Hdsl2iyKOiQodz+Ex1gnN12Js0fYUcgbzIwswavbO9DVROrOB8rpwcdY+5rw27aZoP+Se8T8gmfNvbPzaK006Dg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808448; 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=KtBCNP+purQb83IBKvel5POv2OCFJy9I+d9hReSj9k8=; b=TQqPtSGk1WuHasuKjjJvDOBZBhtEKn4NOVr+Ar/8i66pQHA4O/5D+uNugaZPvN9Y2eFO0uDnvRXVPhEfiCNgP0B8P6Ksbr9wr2GNmun2BQym0ep1UCPFa6p7nJx/i6EtJHIY06eMo7YbYoPzhQg+S04lRWY69TeLeFJnaP5Sjd8= 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 1599808448353976.2355967057587; Fri, 11 Sep 2020 00:14:08 -0700 (PDT) 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-397-uH_DdCfFPaCHj0qah0KHqw-1; Fri, 11 Sep 2020 03:14:04 -0400 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 AA61310BBEDB; Fri, 11 Sep 2020 07:13:59 +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 8860A5D9E8; Fri, 11 Sep 2020 07:13:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 52CF4181A06E; Fri, 11 Sep 2020 07:13:59 +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 08B7DwbN009046 for ; Fri, 11 Sep 2020 03:13:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 31E2D201E730; Fri, 11 Sep 2020 07:13:58 +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 2D5532026F94 for ; Fri, 11 Sep 2020 07:13:58 +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 1430D18AE94A for ; Fri, 11 Sep 2020 07:13:58 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-gBPFwXsKPr27joybEsyNdA-1; Fri, 11 Sep 2020 03:13:53 -0400 Received: by mail-pf1-f182.google.com with SMTP id d9so6606662pfd.3; Fri, 11 Sep 2020 00:13:53 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:51 -0700 (PDT) X-MC-Unique: uH_DdCfFPaCHj0qah0KHqw-1 X-MC-Unique: gBPFwXsKPr27joybEsyNdA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KtBCNP+purQb83IBKvel5POv2OCFJy9I+d9hReSj9k8=; b=JcbSnKJnYf/yLz/MEgPjjgjQEmFfMEnZHqWng21EZiE6SiCyOUb05nBx7Z9LMBX/8n LKo39gd0E5eaeOv6bWWEnRKLGJhV2LeA1fBlrXph1HNjngE6fwp5V1F4NfJHquu5sgSL zY5uyctqurAl2ygovJFGkk9xx8zisoG6/2ATdTGyfrQxSvRHDLqa8w+ElmfUFpy6Crx9 zOPSqMPVMTefXuHu3RWxBeUSMppSq1jLEJ6g0hhx3TuuG0C3Y/mGvvTdviofSpKcISMc /Q1ii4qXA5jYWaXx9gk+In1iMQmeznjvXuc+WeNxuA6QTBrTjk5VfxtWbmlRtbbO0kP3 FlsA== X-Gm-Message-State: AOAM533p8ODugFD/ehLFthCCZPVPeJLLXudAFBLuTZE6PwWvXo9iqcFr gx62yJGNMfoXr1mjao4Uz3gfMyttLmvxyQ== X-Google-Smtp-Source: ABdhPJzNbAVAVBC4HKLlz944X6BfP5PnUnxo0gNwWv7rl6QWT3lhtFhKB9HZEh7cP25YNGx5fniYgA== X-Received: by 2002:a17:902:8e86:b029:d1:9be4:b49d with SMTP id bg6-20020a1709028e86b02900d19be4b49dmr1045227plb.22.1599808432056; Fri, 11 Sep 2020 00:13:52 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/17] virsh: Add event completer to --enable/--disable args of perf command Date: Fri, 11 Sep 2020 15:13:06 +0800 Message-Id: <20200911071318.12495-6-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 49 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 8 ++++++ tools/virsh-domain.c | 2 ++ 3 files changed, 59 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 4c1261b06b..122a9d5f66 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -29,6 +29,7 @@ #include "virsh.h" #include "virstring.h" #include "virxml.h" +#include "conf/domain_conf.h" =20 char ** virshDomainNameCompleter(vshControl *ctl, @@ -338,3 +339,51 @@ virshDomainHostnameSourceCompleter(vshControl *ctl G_G= NUC_UNUSED, =20 return ret; } + + +char ** +virshDomainPerfEnableCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + size_t i =3D 0; + VIR_AUTOSTRINGLIST events =3D NULL; + const char *event =3D NULL; + + virCheckFlags(0, NULL); + + if (VIR_ALLOC_N(events, VIR_PERF_EVENT_LAST + 1) < 0) + return NULL; + + for (i =3D 0; i < VIR_PERF_EVENT_LAST; i++) + events[i] =3D g_strdup(virPerfEventTypeToString(i)); + + if (vshCommandOptStringQuiet(ctl, cmd, "enable", &event) < 0) + return NULL; + + return virshCommaStringListComplete(event, (const char **)events); +} + + +char ** +virshDomainPerfDisableCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + size_t i =3D 0; + VIR_AUTOSTRINGLIST events =3D NULL; + const char *event =3D NULL; + + virCheckFlags(0, NULL); + + if (VIR_ALLOC_N(events, VIR_PERF_EVENT_LAST + 1) < 0) + return NULL; + + for (i =3D 0; i < VIR_PERF_EVENT_LAST; i++) + events[i] =3D g_strdup(virPerfEventTypeToString(i)); + + if (vshCommandOptStringQuiet(ctl, cmd, "disable", &event) < 0) + return NULL; + + return virshCommaStringListComplete(event, (const char **)events); +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index b00b05e3bd..e3375c3c65 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -62,3 +62,11 @@ virshDomainInterfaceAddrSourceCompleter(vshControl *ctl, char ** virshDomainHostnameSourceCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainPerfEnableCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); + +char ** virshDomainPerfDisableCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 68600d728a..1ba536466a 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9333,10 +9333,12 @@ static const vshCmdOptDef opts_perf[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "enable", .type =3D VSH_OT_STRING, + .completer =3D virshDomainPerfEnableCompleter, .help =3D N_("perf events which will be enabled") }, {.name =3D "disable", .type =3D VSH_OT_STRING, + .completer =3D virshDomainPerfDisableCompleter, .help =3D N_("perf events which will be disabled") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808457; cv=none; d=zohomail.com; s=zohoarc; b=c353DSKSirv2TGrlnHCwe4AGdpoBnvhMq4OvRldVe8yYo1xM+xeHoJ3Ls5qrLVBwLUdZtOfhuzWib3k+/bWLHBQkVkl5WGqmKZqLpCLaqGSHI/41p2Z5dnoh6Lzu4mIX4xOcO6h7urUN/hmsdWx7VOcfOqxlLn+op4p9DEY69SE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808457; 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=1pi2s9Hb+hA8l4dle6KIm2kzSbq6L6wR4mfUAImQdas=; b=L4JSkvmQtX2OmQ4GisQj0MuhyT66/VtZxW5lY/gxONnyNfiY7sWsXcWsDfJa4tLooGpS8A0+ll4pxOlZ76RDudzCqJOYSDHfF62aCdMG6x2HBQS5siN9NrQ6lpAV9g3mtcxLHwdoLHj/hTLOq2bh5Me1/qJ0SDDv9aDhOLJkw3I= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599808457361191.55885503754803; Fri, 11 Sep 2020 00:14:17 -0700 (PDT) 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-223-u5uVoob6OICLglCy4KmezA-1; Fri, 11 Sep 2020 03:14:12 -0400 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 60285425D9; Fri, 11 Sep 2020 07:14:03 +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 3C71E60CC0; Fri, 11 Sep 2020 07:14: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 04015181A271; Fri, 11 Sep 2020 07:14:03 +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 08B7E0pS009064 for ; Fri, 11 Sep 2020 03:14:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 66D7D218ADC3; Fri, 11 Sep 2020 07:14:00 +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 61B042166B27 for ; Fri, 11 Sep 2020 07:14:00 +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 480E7858287 for ; Fri, 11 Sep 2020 07:14:00 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-bLKh7CImMYaWgNDfgBaH_w-1; Fri, 11 Sep 2020 03:13:56 -0400 Received: by mail-pg1-f193.google.com with SMTP id 5so6000519pgl.4; Fri, 11 Sep 2020 00:13:55 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:53 -0700 (PDT) X-MC-Unique: u5uVoob6OICLglCy4KmezA-1 X-MC-Unique: bLKh7CImMYaWgNDfgBaH_w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1pi2s9Hb+hA8l4dle6KIm2kzSbq6L6wR4mfUAImQdas=; b=obA8HSb9IoPif6D/oirOiJSLmTKaS3H6cJnmuryBPJkR8mqZvbeJ2W3gjBZD7sQ9E3 ID0fPiTgITcZ15HytpPb5IYcdiBUCCpJLzZvPEVNj2orCwH2CnAHmqTrr3a/ldM8cjg6 LXSEDm92ny+HocgwIPdVRLtGBJ2j7S2nLgaen+TFSTg4A6TsPp/jxH6ILLMX0uO2QNNy B2Vy9plcoiXEjFJEqgFvrJG3hPBVueVR2waDw/3ddJGGd8m5cax/bvXLWKN6O1BYF4jy zjdf5LBWSC3fI8XHd9p50NqOZ6RegPx+9KRbdzUMI7uBNGBSKebuvt1rTZqKAg7T4f3E PDwg== X-Gm-Message-State: AOAM532F6ms4MGzHk4tQ9oFXx4gu55U4OlcMUxpPSe1TiP110RQpktfs 8SfRFPKvohMzIqSrhS+BUacAVRJ00XA5cQ== X-Google-Smtp-Source: ABdhPJzk0Wbqb99FQMEbJx8IfjEP+PZuLvJ0jpvLm555LiE6aEnaMqIM905BCCAUPKOXpYJyqCSE4Q== X-Received: by 2002:a17:902:7844:b029:d0:cbe1:e704 with SMTP id e4-20020a1709027844b02900d0cbe1e704mr994616pln.18.1599808434451; Fri, 11 Sep 2020 00:13:54 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/17] vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options Date: Fri, 11 Sep 2020 15:13:07 +0800 Message-Id: <20200911071318.12495-7-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.003 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit c7151b0 added the completion for VSH_OT_INT options, say '--cellno' and '--pagesize', So we need to ignore VSH_OT_INT otherwise we get the incorrect completion. before: # virsh freepages --pagesize --all --cellno 1GiB 2MiB 4KiB after: # virsh freepages --pagesize 1GiB 2MiB 4KiB Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/vsh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/vsh.c b/tools/vsh.c index 0e8edcd78c..8b50e20a5a 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2780,6 +2780,7 @@ vshReadlineParse(const char *text, int state) } else { if (!opt || (opt->type !=3D VSH_OT_DATA && opt->type !=3D VSH_OT_STRING && + opt->type !=3D VSH_OT_INT && opt->type !=3D VSH_OT_ARGV)) list =3D vshReadlineOptionsGenerator(text, cmd, partial); =20 --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808452; cv=none; d=zohomail.com; s=zohoarc; b=azNUoWcELtNjs3hWlLtjlX2gpW/XElOVtV3Tye5ww4TGB/MFLfyTSherc9xYz0DS+6Y9WaVPPd0El6quZze+Er6UZnprEj1b6bjrH+IaRZ+XaygxsSk+WZy9fa2531MYlwx9QfbikFujjQFHzsAhBsBbRj9usIyIHyYRGzt+eFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808452; 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=W/PF1/gC/J8NrrY3MwLQHK4V2MHxZ2DlPNp7A41cOoA=; b=B+SnxvSNXfAq559u5HkZ3TLh/AfihSQZzDYS8Eq3QpoESU2KgGZHJHso2g5eO8ZXMEePYgPqkRzmprBZUB5t9UAJ1IhGPNrwFBEEoTw/+IcuyeF6qt50+gOJbc34XmKyY/ehcrc/Z4It3T8OnCe+A4kyHN4sDM/dxjUQtTdyCXM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1599808452912480.9109096631406; Fri, 11 Sep 2020 00:14:12 -0700 (PDT) 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-580-nlGhNlbiPr227jvOsEFsvQ-1; Fri, 11 Sep 2020 03:14:09 -0400 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 792FB81F004; Fri, 11 Sep 2020 07:14: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 5A86081C58; Fri, 11 Sep 2020 07:14: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 2A07692309; Fri, 11 Sep 2020 07:14:03 +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 08B7E0tb009068 for ; Fri, 11 Sep 2020 03:14:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 91B94218ADCD; Fri, 11 Sep 2020 07:14:00 +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 8D4522166B27 for ; Fri, 11 Sep 2020 07:14:00 +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 744ED80121C for ; Fri, 11 Sep 2020 07:14:00 +0000 (UTC) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-gTGB21drPCygT-T86htGGg-1; Fri, 11 Sep 2020 03:13:58 -0400 Received: by mail-pg1-f195.google.com with SMTP id w186so5984040pgb.8; Fri, 11 Sep 2020 00:13:57 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:55 -0700 (PDT) X-MC-Unique: nlGhNlbiPr227jvOsEFsvQ-1 X-MC-Unique: gTGB21drPCygT-T86htGGg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W/PF1/gC/J8NrrY3MwLQHK4V2MHxZ2DlPNp7A41cOoA=; b=mDNa1/w5hFJDQnV0Rxdtr71+sVxJv3waCbKHnpn5nQl9vOg/+ZqWevk0+MziT/ABBr PKnWkTXTl6ch2bul8RZ7WE/eUYhO/FazW65bXzmnP5rn9hMNhiaJAblFsKbeu2pWDRqn 6m+Ma8M9rW+OaUUe3XctYuOfFwyMzSYdz2B9o6288sZxPDyufLwExjFJgFFcU8GJZx+7 n2FIMKRNz25Xqb/w7TsbQCT/WM3M083J0eU5WzggWYa1M7UaiyVbOKR+1R0EV+ge49zc IArI43p6l0dqDbEvmrezHUzbH0LmzHavkVV5qy2vGReEY13W0s6QiocwwKn0aLYgUfHj BiHQ== X-Gm-Message-State: AOAM533QNIKwfystLcDCqtfZODuvClNaE/+FcF2cGhiR6GLtlV0s7Fl/ Jx/c9qptLvpWeF6wNvTMa8wqe7sz55pCww== X-Google-Smtp-Source: ABdhPJzv75s1dHvq/wZ7aHXxxAMoJ5LXpBG3CczJdbYJgDZ5vmoY74+sjPi1gPuUvO7TJ3uxg514eQ== X-Received: by 2002:a17:902:6bc1:: with SMTP id m1mr666612plt.75.1599808436624; Fri, 11 Sep 2020 00:13:56 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/17] virsh: Add network uuid completion to network-name command Date: Fri, 11 Sep 2020 15:13:08 +0800 Message-Id: <20200911071318.12495-8-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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 | 42 +++++++++++++++++++++++++++++++++ tools/virsh-completer-network.h | 4 ++++ tools/virsh-network.c | 2 ++ 3 files changed, 48 insertions(+) diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-networ= k.c index 8f0048ed6f..22ab4a80c3 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -137,3 +137,45 @@ virshNetworkPortUUIDCompleter(vshControl *ctl, VIR_FREE(ret); return NULL; } + + +char ** +virshNetworkUUIDCompleter(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + virshControlPtr priv =3D ctl->privData; + virNetworkPtr *nets =3D NULL; + int nnets =3D 0; + 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 ((nnets =3D virConnectListAllNetworks(priv->conn, &nets, flags)) < = 0) + return NULL; + + if (VIR_ALLOC_N(tmp, nnets + 1) < 0) + goto cleanup; + + for (i =3D 0; i < nnets; i++) { + char uuid[VIR_UUID_STRING_BUFLEN]; + if (virNetworkGetUUIDString(nets[i], uuid) < 0) { + vshError(ctl, "%s", _("Failed to get network's UUID")); + goto cleanup; + } + tmp[i] =3D g_strdup(uuid); + } + + ret =3D g_steal_pointer(&tmp); + + cleanup: + for (i =3D 0; i < nnets; i++) + virNetworkFree(nets[i]); + VIR_FREE(nets); + return ret; +} diff --git a/tools/virsh-completer-network.h b/tools/virsh-completer-networ= k.h index e317e483c1..8910e4525c 100644 --- a/tools/virsh-completer-network.h +++ b/tools/virsh-completer-network.h @@ -33,3 +33,7 @@ char ** virshNetworkEventNameCompleter(vshControl *ctl, char ** virshNetworkPortUUIDCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshNetworkUUIDCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-network.c b/tools/virsh-network.c index f0f5358625..f488e840ac 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -806,6 +806,8 @@ static const vshCmdOptDef opts_network_name[] =3D { {.name =3D "network", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshNetworkUUIDCompleter, + .completer_flags =3D 0, .help =3D N_("network uuid") }, {.name =3D NULL} --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808456; cv=none; d=zohomail.com; s=zohoarc; b=ljo4P9kchqhNUwQmMmEPDWQmbYoj7HSr/YWuV6RWqE3JdeidHoh/pw2jp9Gwfn8eW0vxHpKRUrvHP/nQZ0MBGmiw+OfN/ZXXwlfwJDS1s1C0ZKkzH6iSKeDo+nksuRwls2yBwGr5X7T73IUsk7qEFQKpOXQJElUbKEIuQ8/uFqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808456; 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=nwBcaCe+i4B+2rhg5Bpt8dA2YjgJqNGuxmHgvJPcDB0=; b=TAH/sTPoMA4pjDMJKBvi4CLmih6JxPElK6ODU/5/JMkM+31C2oCHVr8vXMDhdaSaUe9lPLjT1BJ9h/+HGPtmK1Apj3GRZODKpnIcyr1oBEd1B4NZWm8xg/xHiFS2LdMCoNRYDAUF5Y34xaoGMHdN2Ehndo/nfE3B+sR+A8/elCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599808456957153.99287009021305; Fri, 11 Sep 2020 00:14:16 -0700 (PDT) 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-2f88GQanPPuFgKIKa451lg-1; Fri, 11 Sep 2020 03:14:13 -0400 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 65C28425D1; Fri, 11 Sep 2020 07:14:07 +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 408F81001281; Fri, 11 Sep 2020 07:14:07 +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 103559230D; Fri, 11 Sep 2020 07:14:07 +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 08B7E4Rt009097 for ; Fri, 11 Sep 2020 03:14:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id B85682026F94; Fri, 11 Sep 2020 07:14:04 +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 B3FFD202450A for ; Fri, 11 Sep 2020 07:14:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A00D18AE947 for ; Fri, 11 Sep 2020 07:14:04 +0000 (UTC) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-313-1vvvAI8gPxm8N_THhM2GXg-1; Fri, 11 Sep 2020 03:14:00 -0400 Received: by mail-pj1-f67.google.com with SMTP id s2so1260624pjr.4; Fri, 11 Sep 2020 00:14:00 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:13:58 -0700 (PDT) X-MC-Unique: 2f88GQanPPuFgKIKa451lg-1 X-MC-Unique: 1vvvAI8gPxm8N_THhM2GXg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nwBcaCe+i4B+2rhg5Bpt8dA2YjgJqNGuxmHgvJPcDB0=; b=hR1qT5OxmEpc8SEneVCGfo8870h2GqQ3cSwVBcj6skJTvIHca6Ar5bO/2nzRj15DY5 g3kxc/e6gVxu5mqaGo02lWRl8ghGF/gl5oHabYygzX4DZJxsS+DeDT1yqdHq1jNzM86n 8DltnZk65NHlO3IForAmhSQQ/OejK16VOS2nruNPkh8RFgQWycQA2/0fDweJTHfgVZAw DeDzcJKmkGfAf9VJGqZmmM0dNG6g1Cwn0MXiPEYw2oTxbseG/7EFQTbDWh0UTFBUNcWT CDCiljP6Ts292pFZzy3hJo/mlafrJb5ynkhXLHtQHeaKeEnhErFKNAdoawb6fOn+jKuB yIgg== X-Gm-Message-State: AOAM531dIdULYDWLAUIatuwuZMKZlkp/UPyxct6b/K4u1vG1viElfti3 mL2z18obkO9wpogHGgeFvcLGUXy7G4y6fA== X-Google-Smtp-Source: ABdhPJz185NcV3hvZyi/jy3mvqRB+q76OlOnyry+waVU3NV/5C6jZnM08eZ4Mb/1kyIS9w/fOoMgpA== X-Received: by 2002:a17:90a:6741:: with SMTP id c1mr1000652pjm.6.1599808438819; Fri, 11 Sep 2020 00:13:58 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/17] virsh: Add domain uuid completion to domname command Date: Fri, 11 Sep 2020 15:13:09 +0800 Message-Id: <20200911071318.12495-9-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 52 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 +++ tools/virsh-domain.c | 8 +++++- 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 122a9d5f66..ae8baa52e3 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -80,6 +80,58 @@ virshDomainNameCompleter(vshControl *ctl, } =20 =20 +char ** +virshDomainUUIDCompleter(vshControl *ctl, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + virshControlPtr priv =3D ctl->privData; + virDomainPtr *domains =3D NULL; + int ndomains =3D 0; + size_t i =3D 0; + char **ret =3D NULL; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(VIR_CONNECT_LIST_DOMAINS_ACTIVE | + VIR_CONNECT_LIST_DOMAINS_INACTIVE | + VIR_CONNECT_LIST_DOMAINS_OTHER | + VIR_CONNECT_LIST_DOMAINS_PAUSED | + VIR_CONNECT_LIST_DOMAINS_PERSISTENT | + VIR_CONNECT_LIST_DOMAINS_RUNNING | + VIR_CONNECT_LIST_DOMAINS_SHUTOFF | + VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | + VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | + VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT, + NULL); + + if (!priv->conn || virConnectIsAlive(priv->conn) <=3D 0) + return NULL; + + if ((ndomains =3D virConnectListAllDomains(priv->conn, &domains, flags= )) < 0) + return NULL; + + if (VIR_ALLOC_N(tmp, ndomains + 1) < 0) + goto cleanup; + + for (i =3D 0; i < ndomains; i++) { + char uuid[VIR_UUID_STRING_BUFLEN]; + if (virDomainGetUUIDString(domains[i], uuid) < 0) { + vshError(ctl, "%s", _("Failed to get domain's UUID")); + goto cleanup; + } + tmp[i] =3D g_strdup(uuid); + } + + ret =3D g_steal_pointer(&tmp); + + cleanup: + for (i =3D 0; i < ndomains; i++) + virshDomainFree(domains[i]); + VIR_FREE(domains); + return ret; +} + + char ** virshDomainInterfaceCompleter(vshControl *ctl, const vshCmd *cmd, diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index e3375c3c65..9a8b962cb7 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -70,3 +70,7 @@ char ** virshDomainPerfEnableCompleter(vshControl *ctl, char ** virshDomainPerfDisableCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainUUIDCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1ba536466a..c07c8c3527 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10370,7 +10370,13 @@ static const vshCmdInfo info_domname[] =3D { }; =20 static const vshCmdOptDef opts_domname[] =3D { - VIRSH_COMMON_OPT_DOMAIN(N_("domain id or uuid"), 0), + {.name =3D "domain", + .type =3D VSH_OT_DATA, + .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainUUIDCompleter, + .completer_flags =3D 0, + .help =3D N_("domain id or uuid") + }, {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Sat Apr 27 04:38:48 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808458; cv=none; d=zohomail.com; s=zohoarc; b=WFad5vQFh0GNOSPEj2AYjdj9IMtJKBPGFzR8TdtaUa6MS3esWInMvR9Eu4rlQCBOUeNhiZFvfo3jSkd2kmOI61bUUtN7WqJhUp7MAyBejJrsodBY3weeV3aAVreJoNEDYHE55vTLvdfdWhl4BS6ZPDV1DzlifmDZRSoi0GttalU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808458; 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=hQ7ByQ+1Sg25gUP3qqH0u7xy2sDOJfwxEKpz9V4Fk1g=; b=FysV3npaY7Q24uKjJ6KG5tMdTE/0ZGTZHaEI1VUbSiJRXC4M8fNFbw9p01MKKUOOPPDG5A2klo7fk4qyHtwvb2rVgf0jk2QMt9jCeU8GpWhGbxtLtKUA0yymsapwvm/NnMjzgZAofzOyOid++dnKmcA1+w8/CSmQd1cfblV/ibg= 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 1599808458593709.86339611759; Fri, 11 Sep 2020 00:14:18 -0700 (PDT) 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-88--lsHgVonOe6sicEVH3ZY5g-1; Fri, 11 Sep 2020 03:14:15 -0400 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 3D7E918B9F1C; Fri, 11 Sep 2020 07:14:10 +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 1F3F69CBA; Fri, 11 Sep 2020 07:14:10 +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 E2339181A2E5; Fri, 11 Sep 2020 07:14:09 +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 08B7E6nh009110 for ; Fri, 11 Sep 2020 03:14:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id D88B72026F94; Fri, 11 Sep 2020 07:14:06 +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 D388A201EE2E for ; Fri, 11 Sep 2020 07:14:06 +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 B6B76801224 for ; Fri, 11 Sep 2020 07:14:06 +0000 (UTC) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-267-zywLuTZHN-2w1axT-INgGg-1; Fri, 11 Sep 2020 03:14:02 -0400 Received: by mail-pj1-f67.google.com with SMTP id n3so2266378pjq.1; Fri, 11 Sep 2020 00:14:02 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:00 -0700 (PDT) X-MC-Unique: -lsHgVonOe6sicEVH3ZY5g-1 X-MC-Unique: zywLuTZHN-2w1axT-INgGg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hQ7ByQ+1Sg25gUP3qqH0u7xy2sDOJfwxEKpz9V4Fk1g=; b=IpjbiLwLfNprDtyJqpBXb1md+yCEoltINZGVF+dmfL0hj4VpiUP/YesyVRPBkIh1bL Lial1gggIWOUhj0k3UOSRPRWQf5bSYrRA1t4NfpmgyFADGT3QmsTbVhDaO3Jfah0NMnW 2/Hbsek66jA8pkb98BoXXpyw6+2/jxzmx3hQZVygZcbJ20zCnynoofRzx1CLHi7YNpQz hJjosXzu55jto6cn48pI6uxgQL35nLkGdZQiGHAhd8ZXDf/InXF6rAIHeT7SCnlo2INb UMfjUs8oRi+5gIuzlv8nwQNA8rVNlkDUIlbPuthu6tiMuF1/1QHOf+t1fw4NkA3TEPsg SBVA== X-Gm-Message-State: AOAM53154ws+BPV/txfODTvvYdEzlAcIpBLSHYG3jQjb6ct4VwPCQKsO Z3uEPXFOrEI7p+TfcV6szC4DMUA5v4Q28w== X-Google-Smtp-Source: ABdhPJyvWkQtUGxseuB4RrAeUjSB/VooXqheQLECW7oxCo9ZnO5FkWV3uBbEzlgI7jCh3ScfYm4Cng== X-Received: by 2002:a17:90b:50f:: with SMTP id r15mr959153pjz.15.1599808440973; Fri, 11 Sep 2020 00:14:00 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/17] virsh: Add iothread IDs completion to iothread* commands Date: Fri, 11 Sep 2020 15:13:10 +0800 Message-Id: <20200911071318.12495-10-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.003 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 37 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 4 ++++ tools/virsh-domain.c | 6 ++++++ 3 files changed, 47 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index ae8baa52e3..56f014ae40 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -439,3 +439,40 @@ virshDomainPerfDisableCompleter(vshControl *ctl, =20 return virshCommaStringListComplete(event, (const char **)events); } + + +char ** +virshDomainIOThreadIdCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virDomainPtr dom; + size_t niothreads =3D 0; + g_autofree virDomainIOThreadInfoPtr *info =3D NULL; + size_t i; + int rc; + char **ret =3D NULL; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) + return NULL; + + if ((rc =3D virDomainGetIOThreadInfo(dom, &info, flags)) < 0) + goto cleanup; + + niothreads =3D rc; + + if (VIR_ALLOC_N(tmp, niothreads + 1) < 0) + goto cleanup; + + for (i =3D 0; i < niothreads; i++) + tmp[i] =3D g_strdup_printf("%u", info[i]->iothread_id); + + ret =3D g_steal_pointer(&tmp); + + cleanup: + virshDomainFree(dom); + return ret; +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 9a8b962cb7..91731da778 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -74,3 +74,7 @@ char ** virshDomainPerfDisableCompleter(vshControl *ctl, char ** virshDomainUUIDCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshDomainIOThreadIdCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c07c8c3527..5222bbb566 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7749,6 +7749,8 @@ static const vshCmdOptDef opts_iothreadpin[] =3D { {.name =3D "iothread", .type =3D VSH_OT_INT, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainIOThreadIdCompleter, + .completer_flags =3D 0, .help =3D N_("IOThread ID number") }, {.name =3D "cpulist", @@ -7897,6 +7899,8 @@ static const vshCmdOptDef opts_iothreadset[] =3D { {.name =3D "id", .type =3D VSH_OT_INT, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainIOThreadIdCompleter, + .completer_flags =3D 0, .help =3D N_("iothread id of existing IOThread") }, {.name =3D "poll-max-ns", @@ -8000,6 +8004,8 @@ static const vshCmdOptDef opts_iothreaddel[] =3D { {.name =3D "id", .type =3D VSH_OT_INT, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainIOThreadIdCompleter, + .completer_flags =3D 0, .help =3D N_("iothread_id for the IOThread to delete") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808461; cv=none; d=zohomail.com; s=zohoarc; b=Qzxv1BqEu84xJOGZ9xhob+LXBDQ281vkFGlfWMO35waFZWBCcA9p7gyjkDvfPZEBfLwivOWU/LEEo6ZnrEmk6qb5ZVMQFIQu3O5zL1/SekllpmgIrufKTNiIHOckrnH8P9jwOVMSt1oF4Pn9Z+i7mSAECTL+QTr7o3TBpZflHSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808461; 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=drP4J8Cac7rlDrEFFK0tYm4wJI2YAbJ5GW1e2lxuPO8=; b=ByDzXFgNOGFqCMtEaCu+B0NvJjdjAumKr/vzEhfnXfeKffYciE5ZoDx8o8j6/YVUb2JVfjkOb1ZZoWHl/x56dwRn6PU6jcPMv1FXWAAjBgWyQBmK56iAl/nScq8zOZlUS5YSjBsHWmn3NRTJZ73N3WrZzWXS2HbzWgiQfAk3YYc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599808461855527.8958859801564; Fri, 11 Sep 2020 00:14:21 -0700 (PDT) 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-111-vHG2A46ROrePICuFkrojtA-1; Fri, 11 Sep 2020 03:14:18 -0400 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 B994518B9F08; Fri, 11 Sep 2020 07:14:12 +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 990609CBA; Fri, 11 Sep 2020 07:14:12 +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 6588D181A71E; Fri, 11 Sep 2020 07:14:12 +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 08B7E9QW009136 for ; Fri, 11 Sep 2020 03:14:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 72D3D117A97F; Fri, 11 Sep 2020 07:14:09 +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 6E214117A97D for ; Fri, 11 Sep 2020 07:14:07 +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 0FEA9858282 for ; Fri, 11 Sep 2020 07:14:07 +0000 (UTC) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-cb8ezemWPXGPLyyoskANgg-1; Fri, 11 Sep 2020 03:14:04 -0400 Received: by mail-pj1-f67.google.com with SMTP id n3so2266424pjq.1; Fri, 11 Sep 2020 00:14:04 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:02 -0700 (PDT) X-MC-Unique: vHG2A46ROrePICuFkrojtA-1 X-MC-Unique: cb8ezemWPXGPLyyoskANgg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=drP4J8Cac7rlDrEFFK0tYm4wJI2YAbJ5GW1e2lxuPO8=; b=pyHN9BOf6qtpPY0rpg+5dfi0JprQBnYH/TlW+BM82beDGPn8MXOyvfnoBWGnrB4iaZ unG1leNHp71dEH68mPA2YcReacfDGcXEGNMN30MREJKIEL69i7Inu0VRhgCAffpSelnI BVe/Gt1NDiqSlfH5YpHGyg1zIcQp729JHKSyrqDcul2kuGi4KEF8oiDf/FTosiKzsmYS Gm6acuFq+i87aRGcoTfnqSzUgghW/K73XzGDL2p/u5wVu2CEB91AShK0GEtWcf9uecji 0WlaqvQDgXoUng42vuONEe9UYPMRoLcourdz1zI+oc9SQ6StZO2Ntda1pPPWww/XjioG nvEw== X-Gm-Message-State: AOAM532G+H/ev06kAt4KO2eqVQAVuVuiTmz5cDXJsiqjoHJcDcgO6fiK EesIFxbQDQi5k2OznqEgLP+CMWXfXFr5rQ== X-Google-Smtp-Source: ABdhPJyNazqacc4U8dlnHGsWLXhMuUtVCuNabYe5XV2W7L8GzNTrYBaVOGVz8Ai3kHhs0Wi6N35fkg== X-Received: by 2002:a17:90b:4b8b:: with SMTP id lr11mr937334pjb.218.1599808443192; Fri, 11 Sep 2020 00:14:03 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/17] virsh: Add completion for --iothread argument of attach-disk command Date: Fri, 11 Sep 2020 15:13:11 +0800 Message-Id: <20200911071318.12495-11-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5222bbb566..6f8424ec14 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -243,6 +243,8 @@ static const vshCmdOptDef opts_attach_disk[] =3D { }, {.name =3D "iothread", .type =3D VSH_OT_STRING, + .completer =3D virshDomainIOThreadIdCompleter, + .completer_flags =3D 0, .help =3D N_("IOThread to be used by supported device") }, {.name =3D "cache", --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808461; cv=none; d=zohomail.com; s=zohoarc; b=dCZRqo7DgxJsd9KSXgCMPi5MYIbWC+p3gIIGpjca3S3/BOTVGQhKGoYSE4gVUscKTvzsh/+LhjOuT9pTOSCgpWw3DUUi2c1vl+5Q+qJYI6qnnVyHxbeKr6aL4mNnnXsT22WH3XaFtObqqLUBu3Pz9+8M1iZXZAOpxP5Dk5z9z38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808461; 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=dmIYR0DE4skRwEf6OFkpG/Krd0tbWvyqZhXBgY9vheg=; b=mkDMd/+PIT7/dyyQfsJoio9mgN7iWKFUljAa1xTFdilJPgWTPqHlC1FCH79xGeRNwpv0AYxfFRzmD5o60AZ2Q3if4KhI0jT/qKWvDfvMhFArXgJu0CGvGr6rK6R9i5tFBQRMItkioRD3q0JW2NU0sA7ugZQ5YyDLsznXAUknTlY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599808461491340.8551195816457; Fri, 11 Sep 2020 00:14:21 -0700 (PDT) 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-587-kyl0HdN8OkCRj2MGa5NstQ-1; Fri, 11 Sep 2020 03:14:18 -0400 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 DE86B425DC; Fri, 11 Sep 2020 07:14:12 +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 BB7725D9F3; Fri, 11 Sep 2020 07:14:12 +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 7DD0592310; Fri, 11 Sep 2020 07:14:12 +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 08B7EBuQ009160 for ; Fri, 11 Sep 2020 03:14:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5F7BF1006503; Fri, 11 Sep 2020 07:14:11 +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 5B1081006168 for ; Fri, 11 Sep 2020 07:14: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 42FC880096B for ; Fri, 11 Sep 2020 07:14:11 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-265-4Y8E7yRDMECSqUji2DXXAA-1; Fri, 11 Sep 2020 03:14:07 -0400 Received: by mail-pg1-f193.google.com with SMTP id s65so4927138pgb.0; Fri, 11 Sep 2020 00:14:06 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:04 -0700 (PDT) X-MC-Unique: kyl0HdN8OkCRj2MGa5NstQ-1 X-MC-Unique: 4Y8E7yRDMECSqUji2DXXAA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dmIYR0DE4skRwEf6OFkpG/Krd0tbWvyqZhXBgY9vheg=; b=WGXUWEnOTxx2qpUq3lcsFnQW5lvqbyJRer+1X1O6aHZA7iotrtY4YKr2YdVuEtCKn1 jL4Me4vAtSgfZGbMNNYMA2ZfaPer1dLY+jZrdj0n5mtrx+5zuM5AzkAn1Sy2Y2UzwIR3 oZQyuaXIOhPo8sIH+e1qiYyGXw05HklHqP8MCGFtSujl6agi6DTkXmW0Mb7sHj5aQmWb 8ZToDWPhXaqzhPx8C4HbaappdEsCLjFAzolEh2jXXtA5uqz7Y0CVmMDFo4hAdFEECZMZ Thz8yz0GawuLspnkdIcApmrCSul9UITcBoE7iDyutXu1o+PCGxCGEoY8GJMYFQzmQi3E iq4A== X-Gm-Message-State: AOAM531mZpFL/Ar/Qztp7/i6nt8PeGAeSrxyjgLuibdi9WaGWUHRQxij MkMQ/Tim76t5yyNLSO86jwyiFlnZWfGkaA== X-Google-Smtp-Source: ABdhPJyLVOpwcdK/Db0GUz1zMmJIN3ShUC7TENMELtisBozqQzeW2/ZRB20rlISCRJrgfBkOMZZwOg== X-Received: by 2002:a63:ea4f:: with SMTP id l15mr697484pgk.434.1599808445460; Fri, 11 Sep 2020 00:14:05 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/17] virsh: Add vcpu IDs completion to vcpupin command Date: Fri, 11 Sep 2020 15:13:12 +0800 Message-Id: <20200911071318.12495-12-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 42 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 5 ++++ tools/virsh-domain.c | 2 ++ 3 files changed, 49 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 56f014ae40..9b22db2119 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -476,3 +476,45 @@ virshDomainIOThreadIdCompleter(vshControl *ctl, virshDomainFree(dom); return ret; } + + +char ** +virshDomainVcpuCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virDomainPtr dom; + xmlDocPtr xml =3D NULL; + xmlXPathContextPtr ctxt =3D NULL; + int nvcpus =3D 0; + unsigned int id; + char **ret =3D NULL; + VIR_AUTOSTRINGLIST tmp =3D NULL; + + virCheckFlags(0, NULL); + + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) + return NULL; + + if (virshDomainGetXMLFromDom(ctl, dom, VIR_DOMAIN_XML_INACTIVE, + &xml, &ctxt) < 0) + goto cleanup; + + /* Query the max rather than the current vcpu count */ + if (virXPathInt("string(/domain/vcpu)", ctxt, &nvcpus) < 0) + goto cleanup; + + if (VIR_ALLOC_N(tmp, nvcpus + 1) < 0) + goto cleanup; + + for (id =3D 0; id < nvcpus; id++) + tmp[id] =3D g_strdup_printf("%u", id); + + ret =3D g_steal_pointer(&tmp); + + cleanup: + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + virshDomainFree(dom); + return ret; +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 91731da778..7c3b4c3cc0 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -78,3 +78,8 @@ char ** virshDomainUUIDCompleter(vshControl *ctl, char ** virshDomainIOThreadIdCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** +virshDomainVcpuCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 6f8424ec14..7dd566b573 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7004,6 +7004,8 @@ static const vshCmdOptDef opts_vcpupin[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), {.name =3D "vcpu", .type =3D VSH_OT_INT, + .completer =3D virshDomainVcpuCompleter, + .completer_flags =3D 0, .help =3D N_("vcpu number") }, {.name =3D "cpulist", --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808463; cv=none; d=zohomail.com; s=zohoarc; b=O/VS6ajxZzAsgmmEy9ls7bw/dDch5TiwcdmpXPD9yAczRTs1tNRqRnCziiKA1hvA+IbJu7UHpMXXR4l31F2RJkxuuVz6kyPSPym0ZmsAmqA4CeexIkS4qDcR+siErr1JTOVy8HERDUVSpxidJRHaNgZTdn6oGxbD+tD0kTpRayk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808463; 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=kWG0jhQSuwyOX21QonbWYECqDw50NyuMHwHyplQzVpw=; b=O7SeIP4Qn4/VsZyqHJrl7thMK3BK4zRk42w0SjuFldzWmBXu1T78icdqoNNxFBdy+1pu8dB9910f9cLaSiyqSnjWl456aI759n3z1y5UctLleuCdTEJIPe2yTe72ZP+0s2sEFw4d35YjhMK0nisnrwEfgnaifiEfVNFZZq7UiSI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599808463678564.5924935545131; Fri, 11 Sep 2020 00:14:23 -0700 (PDT) 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-43-TubmZ0iiMoKRctZyajhltg-1; Fri, 11 Sep 2020 03:14:20 -0400 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 29F1318B9F0B; Fri, 11 Sep 2020 07:14:15 +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 06FCF81C57; Fri, 11 Sep 2020 07:14:15 +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 C89F292308; Fri, 11 Sep 2020 07:14:14 +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 08B7EBQk009165 for ; Fri, 11 Sep 2020 03:14:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id ACEC310FAA1; Fri, 11 Sep 2020 07:14:11 +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 A844B10F9B4 for ; Fri, 11 Sep 2020 07:14:11 +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 8F645811E78 for ; Fri, 11 Sep 2020 07:14:11 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-076YwEFKN6Kb4hX03iNwGg-1; Fri, 11 Sep 2020 03:14:09 -0400 Received: by mail-pf1-f196.google.com with SMTP id d6so6591053pfn.9; Fri, 11 Sep 2020 00:14:08 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:06 -0700 (PDT) X-MC-Unique: TubmZ0iiMoKRctZyajhltg-1 X-MC-Unique: 076YwEFKN6Kb4hX03iNwGg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kWG0jhQSuwyOX21QonbWYECqDw50NyuMHwHyplQzVpw=; b=LUdqQ+OnjJPQ7E9bAaBj+L1z/EdbcymmnqBw2uw+cFntYasteXGp7hT3uGyv5wwvha tj0T3w6pgCsXNQos9TEJLOSBswfWGqsefy1dbY/+SXv9OTDYjBxQG6XcV9+dnugJECMh UP/8xzbFh5Z7dfNMwH5asxvaChdA8rxoHKqHa43UCfLGlsBt+aRlnxpLdFik+erCZ6ds HwnSlmldiCrOCJUlqjNutUiPOv86GPO4hd206stDqYV0k5j209okXolcSHZVB/Q9fa3s H8FA6n1RAbSoKfYsTGJlGPtDcawxovnNE6tKU6Auyvb/80u71jRmUkXDlhUptX/4Itnf wQHg== X-Gm-Message-State: AOAM5322LwedmlsG0w380sft1RJv2Dv8J1YyM3kyUTMcOPWY3FSpO+fX ec/Y5vqsO8rfEBz2Md4bVSZHQm5pokLVLw== X-Google-Smtp-Source: ABdhPJxcFLG/xGzhzthVRw2ZcQzQQsw9H7FTX5XEQElsu5hxlc+GRylxfN4jtXZT7b5bfVmaISFbfQ== X-Received: by 2002:a05:6a00:5e:: with SMTP id i30mr941934pfk.87.1599808447634; Fri, 11 Sep 2020 00:14:07 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/17] virsh: Add vcpu list completion to setvcpu command Date: Fri, 11 Sep 2020 15:13:13 +0800 Message-Id: <20200911071318.12495-13-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 46 ++++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 5 ++++ tools/virsh-domain.c | 2 ++ 3 files changed, 53 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 9b22db2119..218f10e5ba 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -518,3 +518,49 @@ virshDomainVcpuCompleter(vshControl *ctl, virshDomainFree(dom); return ret; } + + +char ** +virshDomainVcpulistCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags) +{ + virDomainPtr dom; + xmlDocPtr xml =3D NULL; + xmlXPathContextPtr ctxt =3D NULL; + int nvcpus =3D 0; + unsigned int id; + VIR_AUTOSTRINGLIST vcpulist =3D NULL; + const char *vcpuid =3D NULL; + char **ret =3D NULL; + + virCheckFlags(0, NULL); + + if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) + return NULL; + + if (virshDomainGetXMLFromDom(ctl, dom, VIR_DOMAIN_XML_INACTIVE, + &xml, &ctxt) < 0) + goto cleanup; + + /* Query the max rather than the current vcpu count */ + if (virXPathInt("string(/domain/vcpu)", ctxt, &nvcpus) < 0) + goto cleanup; + + if (VIR_ALLOC_N(vcpulist, nvcpus + 1) < 0) + goto cleanup; + + for (id =3D 0; id < nvcpus; id++) + vcpulist[id] =3D g_strdup_printf("%u", id); + + if (vshCommandOptStringQuiet(ctl, cmd, "vcpulist", &vcpuid) < 0) + goto cleanup; + + ret =3D virshCommaStringListComplete(vcpuid, (const char **)vcpulist); + + cleanup: + xmlXPathFreeContext(ctxt); + xmlFreeDoc(xml); + virshDomainFree(dom); + return ret; +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 7c3b4c3cc0..84219ab088 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -83,3 +83,8 @@ char ** virshDomainVcpuCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** +virshDomainVcpulistCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 7dd566b573..c3ac28cab0 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7525,6 +7525,8 @@ static const vshCmdOptDef opts_setvcpu[] =3D { {.name =3D "vcpulist", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainVcpulistCompleter, + .completer_flags =3D 0, .help =3D N_("ids of vcpus to manipulate") }, {.name =3D "enable", --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808468; cv=none; d=zohomail.com; s=zohoarc; b=dvjO4tVx5rxK39lB5WKxhnZ9IKEYptKZS0am3z3KpanrS+jkJocCD6YtyAkC4OFUKR+lD0XxzseRKKIkPjDc8IsRV78XJxAUCsE7Ul+9glJXpPAfhy2/xuacy6I/jekmusp/gqumcdAJgqNnqwziFXOFaEx8mVeW1w1BgQL9PbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808468; 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=EBIligLB0/jLXMTyc+6lZaMRF5PKiF4/IHAoBnh8cpQ=; b=g7rZpimivGuwx0J5PUIzZAk4rSLlH0i91QVqRzQtCiivv5FJ3oQ1PzgVwn+fvlaxJNZVoJxoYwa+hLSLGNM0b6D4kgvodubOS5fq5SoO/7xYzsFAray25cphIL3vH6681y4c6oQIRruDO8UTuR4sCWvxA1CvyvlKlenefZYhGuY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1599808468991350.0262982774468; Fri, 11 Sep 2020 00:14:28 -0700 (PDT) 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-318-956r2VsEPleY8-0TMu4LMQ-1; Fri, 11 Sep 2020 03:14:24 -0400 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 D174980EF9E; Fri, 11 Sep 2020 07:14:19 +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 B23EA81C5A; Fri, 11 Sep 2020 07:14:19 +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 8281F92314; Fri, 11 Sep 2020 07:14:19 +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 08B7EImU009227 for ; Fri, 11 Sep 2020 03:14:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9502310F9B4; Fri, 11 Sep 2020 07:14: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 9084E10FAA8 for ; Fri, 11 Sep 2020 07:14:15 +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 96331185A78B for ; Fri, 11 Sep 2020 07:14:15 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-426-2_uB2pKCOtuakCt0nKYE7g-1; Fri, 11 Sep 2020 03:14:11 -0400 Received: by mail-pf1-f193.google.com with SMTP id x123so6594810pfc.7; Fri, 11 Sep 2020 00:14:11 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:09 -0700 (PDT) X-MC-Unique: 956r2VsEPleY8-0TMu4LMQ-1 X-MC-Unique: 2_uB2pKCOtuakCt0nKYE7g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EBIligLB0/jLXMTyc+6lZaMRF5PKiF4/IHAoBnh8cpQ=; b=Go5F+ljp75GSsStfehnG+3Aaa73c2eU3/yHfJPCCEsm94RZ2IE7h1ljeH9VdXACeon w0cb8SF7z37ePxnwj9RYvL/CJvQftjPpVMfQq63W92VDxhkRMpuHrB45xr6egw5GkEqe whjQCWlGQ9SvS6HYL1GOR2EUdenfkL4HCAiJcSZAxxbfQH9i6iMpkRSMdmSCM3Psd9VN Gi7oC6XIQXeo0irzUQovO/GInSrX2Nglt/HT5R09BAT1Fj2k/zKTHIs/LpSCwFkFwHrA QzPA/kb1bMAuCOks58E/4hfG0Rvek8lZCFrkNqCyOr056TAiXlhF16zTF0depNDPjf6G VURg== X-Gm-Message-State: AOAM5309wyX090gHyGiRK27ve4+3/UOh8SpKezMQMAwpUsyMZWSp53cr 8Sn8bde6FBPGjl8U2LnGzd89G5D0BfJQ/w== X-Google-Smtp-Source: ABdhPJyC3i8Qf9Sj7J+VELZxZtyzl+VY9zpKYIrU5RGXhhYwI8zBzONzs555A4u/Fx+EnNg0PtLPyg== X-Received: by 2002:aa7:998a:: with SMTP id k10mr895722pfh.151.1599808449812; Fri, 11 Sep 2020 00:14:09 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/17] virsh: Add logical CPU list completion for --cpulist argument Date: Fri, 11 Sep 2020 15:13:14 +0800 Message-Id: <20200911071318.12495-14-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently this patch works for the commands emulatorpin, iothreadpin and vcpupin. Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 33 +++++++++++++++++++++++++++++++++ tools/virsh-completer-domain.h | 5 +++++ tools/virsh-domain.c | 3 +++ 3 files changed, 41 insertions(+) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 218f10e5ba..e02c3b0c31 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -564,3 +564,36 @@ virshDomainVcpulistCompleter(vshControl *ctl, virshDomainFree(dom); return ret; } + + +char ** +virshDomainCpulistCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags G_GNUC_UNUSED) +{ + int i, cpunum; + unsigned char *cpumap =3D NULL; + unsigned int online; + VIR_AUTOSTRINGLIST cpulist =3D NULL; + const char *cpuid =3D NULL; + char **ret =3D NULL; + virshControlPtr priv =3D ctl->privData; + + if ((cpunum =3D virNodeGetCPUMap(priv->conn, &cpumap, &online, 0)) < 0) + goto cleanup; + + if (VIR_ALLOC_N(cpulist, cpunum + 1) < 0) + goto cleanup; + + for (i =3D 0; i < cpunum; i++) + cpulist[i] =3D g_strdup_printf("%u", i); + + if (vshCommandOptStringQuiet(ctl, cmd, "cpulist", &cpuid) < 0) + goto cleanup; + + ret =3D virshCommaStringListComplete(cpuid, (const char **)cpulist); + + cleanup: + VIR_FREE(cpumap); + return ret; +} diff --git a/tools/virsh-completer-domain.h b/tools/virsh-completer-domain.h index 84219ab088..a5477c4ae5 100644 --- a/tools/virsh-completer-domain.h +++ b/tools/virsh-completer-domain.h @@ -88,3 +88,8 @@ char ** virshDomainVcpulistCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** +virshDomainCpulistCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c3ac28cab0..6b2787b8d5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7011,6 +7011,7 @@ static const vshCmdOptDef opts_vcpupin[] =3D { {.name =3D "cpulist", .type =3D VSH_OT_STRING, .flags =3D VSH_OFLAG_EMPTY_OK, + .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set, or omit option to query") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -7238,6 +7239,7 @@ static const vshCmdOptDef opts_emulatorpin[] =3D { {.name =3D "cpulist", .type =3D VSH_OT_STRING, .flags =3D VSH_OFLAG_EMPTY_OK, + .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set, or omit option to query") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, @@ -7762,6 +7764,7 @@ static const vshCmdOptDef opts_iothreadpin[] =3D { {.name =3D "cpulist", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshDomainCpulistCompleter, .help =3D N_("host cpu number(s) to set") }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808468; cv=none; d=zohomail.com; s=zohoarc; b=k41wyLgnU4Ous42PG5eP5p1IeGSQxU1RU+fpTjMU8a6/Sjv8wIqHq5mdexqd1XU9rP6QruMluUyKwOggmVuNkypF73ocFCIRouZsy72MdAP79KmVQ50NeCI5klA8L7CDFzW2xDzoDYKNW8fM9jSiKwgvgrPdZNdDTFFubMXJS6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808468; 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=s0Mgyn0QQVgiOmHWNqI3MywIUDfdwmwT+QmXPq03kmA=; b=bicN8usUsIvyIGptcQ3VgnVN0mAGr5sLIAl0+EcAxMXISafjiT4cjfoquP4Pu6+xjKHPD6Y9HpuvEIgCCP3q8GSAlxOzx6EYhkNXThPUGINdxgPZSj7mDKDE95LesEh531teDsmPgKOru6/r2eE49Yz+AqRg3cu+ZWSBosOGq9s= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599808468667317.9776807786666; Fri, 11 Sep 2020 00:14:28 -0700 (PDT) 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-448-aRhM8PALOqORvZTh-Ee2cg-1; Fri, 11 Sep 2020 03:14:25 -0400 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 13D9210BBECE; Fri, 11 Sep 2020 07:14:20 +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 E05141A886; Fri, 11 Sep 2020 07:14:19 +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 ADFE5181A86E; Fri, 11 Sep 2020 07:14:19 +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 08B7EIt2009225 for ; Fri, 11 Sep 2020 03:14:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9590A10FAA1; Fri, 11 Sep 2020 07:14:18 +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 90CA010FAAA for ; Fri, 11 Sep 2020 07:14:17 +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 C5EA7801181 for ; Fri, 11 Sep 2020 07:14:17 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-JPKaRBNnP6G6rg5oz8md8Q-1; Fri, 11 Sep 2020 03:14:13 -0400 Received: by mail-pf1-f196.google.com with SMTP id c196so6740269pfc.0; Fri, 11 Sep 2020 00:14:13 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:11 -0700 (PDT) X-MC-Unique: aRhM8PALOqORvZTh-Ee2cg-1 X-MC-Unique: JPKaRBNnP6G6rg5oz8md8Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s0Mgyn0QQVgiOmHWNqI3MywIUDfdwmwT+QmXPq03kmA=; b=PnjlbRy8HHEo1dzcdNFdooCBJwBiwxEC0U3oTlVEssZxhHJCNj6zSPaoe2fj4lcMiX p1pB5+1+PS9HQ0xJjUjlRPKXcgmd8XnPnt67n/3Rn2xZStGyFYH11DBtw+V17Nb3grhx fZGBqCCrVUbyGRKtLpCBqhL9RrOfzctdS1M5eDrxj2Td2UBai320SYGduhQSSNuDNeJY YqTuWCT4pmcd2kzKf2woyqteVeUyOjdr6VrFNzj+sb6WEuoEfLRlDY/vqySFYCUlhFM1 C1+kxcThHriNa1r8nyk8p+E8KlLwAOx1+jH5EG7BlSDKZ4HE4y2oQrG2h4TIOHZ05nbM 1lVg== X-Gm-Message-State: AOAM533oA/Cniv8OOjtJbFonLX5k+i9Qqwu7PXoJk1KyFKzxPyfmq1wI 2o2TvTLSW+INi0bchkWz3fZry8Lfahkiow== X-Google-Smtp-Source: ABdhPJxFN8FMXINu50ROND1BaYl34ADlfmHP55nT39eSZE/AG4NzZ3azdzdTNXte5C/gZP51MwlEGw== X-Received: by 2002:aa7:92c8:0:b029:13e:d13d:a12b with SMTP id k8-20020aa792c80000b029013ed13da12bmr983767pfa.19.1599808452037; Fri, 11 Sep 2020 00:14:12 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/17] virsh: limit completion of net-dhcp-leases to active networks Date: Fri, 11 Sep 2020 15:13:15 +0800 Message-Id: <20200911071318.12495-15-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-network.c b/tools/virsh-network.c index f488e840ac..592b08528b 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1373,7 +1373,7 @@ static const vshCmdInfo info_network_dhcp_leases[] = =3D { }; =20 static const vshCmdOptDef opts_network_dhcp_leases[] =3D { - VIRSH_COMMON_OPT_NETWORK_FULL(0), + VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), {.name =3D "mac", .type =3D VSH_OT_STRING, .flags =3D VSH_OFLAG_NONE, --=20 2.26.0 From nobody Sat Apr 27 04:38:48 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808470; cv=none; d=zohomail.com; s=zohoarc; b=FHrnm34h26NYJiWKigDYQFGWk81NfTPpMFDr+v2f2VXRo8LlBVGb3eJjpxndR9zHsqiAQCVxhutBDii9LHIjTz98RBslloCz0hz5kWQfRh0bhIgCBVrZMBiQAYtQhC9O6Ozlkmvr9mYyG4eSjsX/y82YwscN3emdPLZohI6bJRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808470; 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=QLxJg4bJbQMf9RNJqFnHxazU515xXXXf+vFfSAbsnb0=; b=Zq1tYeUFcRGeXsprBCI08vgdXATV2q06AMkG/xDE8IBjCTbWD/ZkAIXVjZtbcdxRAusKy4TvGPj0iFNXKjw36PNvd4Y4VJuc0wgFsgALIiS9Lir8UODux4nG8qUh+dpByxh1q7e3fFB3Spuvz3qjcIDk921PpXepQ2wp/9cVl+U= 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 1599808470590511.3623328800526; Fri, 11 Sep 2020 00:14:30 -0700 (PDT) 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-530-tcu3ElxtPxGTXwdjOGnheQ-1; Fri, 11 Sep 2020 03:14:27 -0400 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 34E9C8030CC; Fri, 11 Sep 2020 07:14: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 1493181C58; Fri, 11 Sep 2020 07:14: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 D6CC292319; Fri, 11 Sep 2020 07:14:21 +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 08B7EKDt009252 for ; Fri, 11 Sep 2020 03:14:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5FF62201E730; Fri, 11 Sep 2020 07:14:20 +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 5B21E2026F94 for ; Fri, 11 Sep 2020 07:14:18 +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 084DD80121F for ; Fri, 11 Sep 2020 07:14:18 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-JF5J9PqYOaG9BecnyUhmdQ-1; Fri, 11 Sep 2020 03:14:15 -0400 Received: by mail-pg1-f194.google.com with SMTP id m5so5979745pgj.9; Fri, 11 Sep 2020 00:14:15 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:13 -0700 (PDT) X-MC-Unique: tcu3ElxtPxGTXwdjOGnheQ-1 X-MC-Unique: JF5J9PqYOaG9BecnyUhmdQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QLxJg4bJbQMf9RNJqFnHxazU515xXXXf+vFfSAbsnb0=; b=c21zP4Qpns3rofYUYhN5vWc7WTlChlKQXDX82dLzke0GXZwHUT5GBPv5VWyvRK3q0g UV7Ka/k4/JCB/gr6H6jnsRfAIM+MGzs2E1hoHbftf9/gBrF9ym4hwHPB/E9RCqNiRktm jIL99XObvxBYnTrgC294tlcuYQQNvzLn59YC+E7+G43adaUvAARG8GawIOcnojvraqKV 63zPIaZiT5W8fNqKAeLFdRO2UCIPKobBgH2UHxJMooHJMVDzXPlmpRM1RZKUBvFmqLEP o4FUo6I1baEeAmqUCd66mRAmJSBaN2U4dg9/6TRuQsKLTE3AGVy0JjueiagSDxOKspGU A03w== X-Gm-Message-State: AOAM530MqKyN/tFFB04PAyk55/NqaJapZcYyg04h7e+gv29RrEA0IP8E fn3SFTOUx/i6KFOn9t/OJ82gkkZnmpx8tQ== X-Google-Smtp-Source: ABdhPJxXfFY6w8bJdA2+wyFskal+SGiw0z5Fu9xLYqJxhTi/y5FQVjGU/YP0/FmenLO6vJRDqNsJcg== X-Received: by 2002:a17:902:8489:: with SMTP id c9mr756552plo.82.1599808454335; Fri, 11 Sep 2020 00:14:14 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/17] virsh: limit completion of net-port* to active networks Date: Fri, 11 Sep 2020 15:13:16 +0800 Message-Id: <20200911071318.12495-16-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 592b08528b..b131851a0d 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1486,7 +1486,7 @@ static const vshCmdInfo info_network_port_create[] = =3D { }; =20 static const vshCmdOptDef opts_network_port_create[] =3D { - VIRSH_COMMON_OPT_NETWORK_FULL(0), + VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), VIRSH_COMMON_OPT_FILE(N_("file containing an XML network port descript= ion")), {.name =3D NULL} }; @@ -1546,7 +1546,7 @@ static const vshCmdInfo info_network_port_dumpxml[] = =3D { }; =20 static const vshCmdOptDef opts_network_port_dumpxml[] =3D { - VIRSH_COMMON_OPT_NETWORK_FULL(0), + VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), VIRSH_COMMON_OPT_NETWORK_PORT(0), {.name =3D NULL} }; @@ -1598,7 +1598,7 @@ static const vshCmdInfo info_network_port_delete[] = =3D { }; =20 static const vshCmdOptDef opts_network_port_delete[] =3D { - VIRSH_COMMON_OPT_NETWORK_FULL(0), + VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), VIRSH_COMMON_OPT_NETWORK_PORT(0), {.name =3D NULL} }; @@ -1733,7 +1733,7 @@ static const vshCmdInfo info_network_port_list[] =3D { }; =20 static const vshCmdOptDef opts_network_port_list[] =3D { - VIRSH_COMMON_OPT_NETWORK_FULL(0), + VIRSH_COMMON_OPT_NETWORK_FULL(VIR_CONNECT_LIST_NETWORKS_ACTIVE), {.name =3D "uuid", .type =3D VSH_OT_BOOL, .help =3D N_("list uuid's only") --=20 2.26.0 From nobody Sat Apr 27 04:38:48 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808476; cv=none; d=zohomail.com; s=zohoarc; b=fANR7inNP7Mqwb2vtDdtnp6YQSXE7bmdVp/iAi1J9fVxfgs7QuI38LiJ+PJhA+pb3bkvqQZwkL2bmJ3RX0BzeofKtVQBwS1QbBWgJFUt2aNlMLbtasHcyzOzJ1bwFF0rqOVkBzvqsVb/QDntZ7q5ucNu+CZsrGsJFmSa0CBzg7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808476; 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=IPw1yx5XuZyFANF6RjQBBEf6IB7XrxAFXma+cSP95J8=; b=b8jo/JnnnADqnDAgF+xcrf4xB64mYN8KdXcti10XwRIx7ox0UxVqhlMFOTYQQjv5DGQO4488SeY9mnCdlfsbBxS84YVqwupxtR1aH3lagpHwSiYl4s3kIR2LinUxuZo9Z7tFyqjDggq+C5uzHUN49RNIQHh9NxW8cj6jl0/gygc= 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 1599808476508242.2771390524647; Fri, 11 Sep 2020 00:14:36 -0700 (PDT) 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-441-zjJGUWznPWSysoMXl5i2Qw-1; Fri, 11 Sep 2020 03:14:31 -0400 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 8E7F6425D1; Fri, 11 Sep 2020 07:14: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 6C1955C22E; Fri, 11 Sep 2020 07:14: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 3BF429231B; Fri, 11 Sep 2020 07:14:25 +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 08B7ENn8009279 for ; Fri, 11 Sep 2020 03:14:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id F06E02166B27; Fri, 11 Sep 2020 07:14:22 +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 EBBAC218ADCD for ; Fri, 11 Sep 2020 07:14:20 +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 8E34018AE947 for ; Fri, 11 Sep 2020 07:14:20 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105-qpNhXOXAMByaxn8tTV-T_A-1; Fri, 11 Sep 2020 03:14:18 -0400 Received: by mail-pf1-f196.google.com with SMTP id f18so6590050pfa.10; Fri, 11 Sep 2020 00:14:17 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:16 -0700 (PDT) X-MC-Unique: zjJGUWznPWSysoMXl5i2Qw-1 X-MC-Unique: qpNhXOXAMByaxn8tTV-T_A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IPw1yx5XuZyFANF6RjQBBEf6IB7XrxAFXma+cSP95J8=; b=DNFBfmFt0rNg5CxRwaGQJ7Qrv7PJHv8b3c3CJTKR58IG9paIEgSqQSFBi+d3//Y71M wc2fUhX+7Ng4tKWJEk2Y9MPF3a5iqcWZYKgfFe4GXvLFcEwi+XAJgtEI6OLe+TDgtLBC L+RC3PEG5iON4n3lUw7Oq3Mt8/VjWqHmiyp+vVXLFkPSfEWcr/a215KpABuLVnch6GKs yMkmyUzBOr0GEhf6Vp6uGkhOhEEqVn7OUrHQ/kRNV1nbzA/ApxDwzon4UJMHpwe5Be25 AA2SZDWm/FRzWE3Dag5RyyQC129K5hmeB6S+UhZOw+WhVvE1nBvI8a9H/uxbt9YwVrpd Azzw== X-Gm-Message-State: AOAM531Dt5LZmWrAzJGe66Me9FKXMXz9fa32GD0bouNWVhDvu6q0h1MF ce6KAo8O+33IeiYhojdvV5Bnux7XfcBhSA== X-Google-Smtp-Source: ABdhPJzwbh96uyRtSyDYucRhO/HmGeoIX1HWMwiEQ6wvf6924YwGkAjnsLSiXA6sDuR5MgMisbZP7A== X-Received: by 2002:a17:902:ff07:: with SMTP id f7mr729781plj.52.1599808456774; Fri, 11 Sep 2020 00:14:16 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 16/17] virsh: limit completion of backup-{begin, dumpxml} to active domains Date: Fri, 11 Sep 2020 15:13:17 +0800 Message-Id: <20200911071318.12495-17-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-backup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virsh-backup.c b/tools/virsh-backup.c index 04464c6bff..9125b7da97 100644 --- a/tools/virsh-backup.c +++ b/tools/virsh-backup.c @@ -36,7 +36,7 @@ static const vshCmdInfo info_backup_begin[] =3D { }; =20 static const vshCmdOptDef opts_backup_begin[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "backupxml", .type =3D VSH_OT_STRING, .help =3D N_("domain backup XML"), @@ -112,7 +112,7 @@ static const vshCmdInfo info_backup_dumpxml[] =3D { }; =20 static const vshCmdOptDef opts_backup_dumpxml[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D NULL} }; =20 --=20 2.26.0 From nobody Sat Apr 27 04:38:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599808478; cv=none; d=zohomail.com; s=zohoarc; b=Ll4dYNst/CA0CEWLNjOkXYach+wVrGLn+p5xnFGp0doJVdj2EKFdBvnkW8j2s2ulo/N7/HKRlS9lEJxAu6wsBoYwklLAbpVYm8WYb+tQEvLnLPArSG1JOM83OmSh441guySZpliI3gx6pB7/p09acYGNvMDpmWxPVrwmWI9zxyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599808478; 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=lpOo4gHWTGKB/qqX3wWGWtvqTZ98V3Jt8sXmGeIHWic=; b=oGhOzCeBGhAixzqCjdbt/J1SW4vha6Ie+WzwurmvRo7ZvpUOxgXxY3akY9hsA7VCCvIMQWfHPnmp3qF6mYmcHkSPUAIXxGbUWksE3cuAaaLKpYSDNP1gW4KzRPVjLGfBwgi1zFglO0OaqatDTfxG4hKGEFwjbp9pHAdRU8RBQ4o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159980847820838.05626421626994; Fri, 11 Sep 2020 00:14:38 -0700 (PDT) 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-455-eTjjm11aPTCzXCTsidFRqA-1; Fri, 11 Sep 2020 03:14:34 -0400 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 238CC85C733; Fri, 11 Sep 2020 07:14:29 +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 F31D527BD8; Fri, 11 Sep 2020 07:14: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 C0593181A87F; Fri, 11 Sep 2020 07:14:28 +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 08B7ERJP009309 for ; Fri, 11 Sep 2020 03:14:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B7A7100650D; Fri, 11 Sep 2020 07:14: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 6710A1006509 for ; Fri, 11 Sep 2020 07:14:25 +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 1020F858284 for ; Fri, 11 Sep 2020 07:14:25 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-Nzkt37FpNTGIzknP0vCAew-1; Fri, 11 Sep 2020 03:14:20 -0400 Received: by mail-pg1-f193.google.com with SMTP id l191so5995114pgd.5; Fri, 11 Sep 2020 00:14:20 -0700 (PDT) Received: from t440p.suse.asia (60-251-47-115.HINET-IP.hinet.net. [60.251.47.115]) by smtp.gmail.com with ESMTPSA id q13sm1055066pjj.14.2020.09.11.00.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 00:14:18 -0700 (PDT) X-MC-Unique: eTjjm11aPTCzXCTsidFRqA-1 X-MC-Unique: Nzkt37FpNTGIzknP0vCAew-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lpOo4gHWTGKB/qqX3wWGWtvqTZ98V3Jt8sXmGeIHWic=; b=CGR7Hd7J7oW2nrsdVSMZ8YGzjTh5SK6BL/EsvM2WTUbwbuQHaOVDLv9iClsrrQoEmP lsIgYmlEV+X9AmoYUF/leJE6rOe/JYB25SRxr+Su4jGlXlQcF0NfQS8ZOm58p/HC94mx IWJy+XP2hAUj5eaBGDo8vPMpABHzpyzzMmxwTV2LRuwvk4A8zNhAerAbsYkkrU7SGmYG 1Iex/qJhVhfFFEPlJr8GeOTT3vdEexyL6NIZGrLJwR2/AxwIe5ilQcShnhUEnz7AuLBC Xnrt0a1YGpCjY6//uRMAIVpC/aOFdCE4f6q4j+5EiNDH8e1Hl7pQxNJTNW9MpWH7eQ3y wcJQ== X-Gm-Message-State: AOAM533yF9Xr7BBY3r/UOBWHweLG/2A36Z1+4Tt/aXDhZO5P9NkxoVXw 6zeJFQkd6+6okVil5wWr5rcWOMUcfAVHgw== X-Google-Smtp-Source: ABdhPJwP6B8OexJThXDWofXaCNMrtd6fkbPIg5cmeEyslSdCyGWrfMf+JPjL3dDsP7/27fYv4g/RqQ== X-Received: by 2002:a63:348f:: with SMTP id b137mr725923pga.234.1599808459274; Fri, 11 Sep 2020 00:14:19 -0700 (PDT) From: Lin Ma X-Google-Original-From: Lin Ma To: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/17] virsh: limit completion of checkpoint-{create, delete} to active domains Date: Fri, 11 Sep 2020 15:13:18 +0800 Message-Id: <20200911071318.12495-18-lma@suse.de> In-Reply-To: <20200911071318.12495-1-lma@suse.de> References: <20200911071318.12495-1-lma@suse.de> MIME-Version: 1.0 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-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.002 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-checkpoint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index c4ff863802..33e70515ad 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -90,7 +90,7 @@ static const vshCmdInfo info_checkpoint_create[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_create[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "xmlfile", .type =3D VSH_OT_STRING, .help =3D N_("domain checkpoint XML") @@ -201,7 +201,7 @@ static const vshCmdInfo info_checkpoint_create_as[] =3D= { }; =20 static const vshCmdOptDef opts_checkpoint_create_as[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "name", .type =3D VSH_OT_STRING, .help =3D N_("name of checkpoint") @@ -1015,7 +1015,8 @@ static const vshCmdInfo info_checkpoint_delete[] =3D { }; =20 static const vshCmdOptDef opts_checkpoint_delete[] =3D { - VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT | + VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "checkpointname", .type =3D VSH_OT_STRING, .help =3D N_("checkpoint name"), --=20 2.26.0