From nobody Sat Feb 7 05:14:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=fujitsu.com ARC-Seal: i=1; a=rsa-sha256; t=1669705294; cv=none; d=zohomail.com; s=zohoarc; b=OdhyCAtfgBoOFD/dgS5eRzrB0UfMhE2SwJXVyXa/0WdRzA5Zx7yUXBUmslxHK9q9Xn92+nh72/5CZlPRc6S0shuJw85Ib28A9G5RBg4wOwhVBVRpMdH7Ba7feWFVfJhb7iMfsqZ8SuW6JZr2YNQDe+mmrVneAigEsdIT2TRr3ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669705294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=AG0JYztuihIB4bfIZ3+kOJLNQ/lBbeIJtxpOb1uNqJM=; b=CYWBJqWX9E1Xskcx5sSjZJsabYMrpuC2anwJPug2qHUKD8Q7mAsFiF/7lfp9lC25vt7fy4ex4dHhVlejCmSsPZPpT6KFlNXRzckcEJyBWZO7prvc7QI4nYRXeGGCKYAnlxqpXnOOp3PhdUF0DcTX1NLgNesb3KAAyKpVejaxhXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1669705294252113.8964820941668; Mon, 28 Nov 2022 23:01:34 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-8xdhhdm_M5a8IWjJnmGqlw-1; Tue, 29 Nov 2022 02:01:28 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA97B18E53A9; Tue, 29 Nov 2022 07:01:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DE992024CB7; Tue, 29 Nov 2022 07:01:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DCA5F1946597; Tue, 29 Nov 2022 07:01:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 044B51946594 for ; Tue, 29 Nov 2022 07:01:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D83732024CC0; Tue, 29 Nov 2022 07:01: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 CFA652024CBF for ; Tue, 29 Nov 2022 07:01:18 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B13AE803D4A for ; Tue, 29 Nov 2022 07:01:18 +0000 (UTC) Received: from esa2.hc1455-7.c3s2.iphmx.com (esa2.hc1455-7.c3s2.iphmx.com [207.54.90.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-Sh4ze3_wNtCXIpvQR2EdUg-1; Tue, 29 Nov 2022 02:01:16 -0500 Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa2.hc1455-7.c3s2.iphmx.com with ESMTP; 29 Nov 2022 16:01:14 +0900 Received: from yto-m1.gw.nic.fujitsu.com (yto-nat-yto-m1.gw.nic.fujitsu.com [192.168.83.64]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 34854D66A0 for ; Tue, 29 Nov 2022 16:01:13 +0900 (JST) Received: from m3002.s.css.fujitsu.com (msm3.b.css.fujitsu.com [10.128.233.104]) by yto-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 75D7ACFBB3 for ; Tue, 29 Nov 2022 16:01:12 +0900 (JST) Received: from ohf37b.. (unknown [10.125.14.40]) by m3002.s.css.fujitsu.com (Postfix) with ESMTP id 5CF6E200B305; Tue, 29 Nov 2022 16:01:12 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669705292; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AG0JYztuihIB4bfIZ3+kOJLNQ/lBbeIJtxpOb1uNqJM=; b=ShkGT/VYxm4IkcLB9BoCO6rjkmqu7c5NP32/9QCfWhmm6d2sE2sEe86gb/Jj6vb7D/ZBp7 FbrpukB52WUJD37sr307LkRqmGjYsNv6Zdl1NAc3DQQVyfocFAXwV4WUNq7IkkZOdNN93x dxM6Yg8c8tZ6bDswQIn9c8q3llKk0wI= X-MC-Unique: 8xdhhdm_M5a8IWjJnmGqlw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Sh4ze3_wNtCXIpvQR2EdUg-1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="97925284" X-IronPort-AV: E=Sophos;i="5.96,202,1665414000"; d="scan'208";a="97925284" From: Haruka Ohata To: libvir-list@redhat.com Subject: [PATCH v3] virsh: Add message to terminal when running snapshot-revert Date: Tue, 29 Nov 2022 16:00:33 +0900 Message-Id: <20221129070033.162153-1-ohata.haruka@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 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 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ohata.haruka@fujitsu.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669705295252100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When running virsh snapshot-* command, such as snapshot-create-as / snapshot-delete, it prints a result message. On the other hand virsh snapshot-revert command doesn't print a result message. So, This patch fixes to add message when running virsh snapshot-revert command. --- # virsh snapshot-create-as vm1 test1 Domain snapshot test01 created # virsh snapshot-revert vm1 test1 # virsh snapshot-delete vm1 test1 Domain snapshot test01 deleted # --- Signed-off-by: Haruka Ohata --- tests/virsh-snapshot | 3 +++ tools/virsh-snapshot.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/virsh-snapshot b/tests/virsh-snapshot index 4c64bb537b..b09273917b 100755 --- a/tests/virsh-snapshot +++ b/tests/virsh-snapshot @@ -100,11 +100,14 @@ Domain snapshot s1 created =20 Domain snapshot s3 created Domain snapshot s2 created +Domain snapshot s3 reverted =20 Domain snapshot s6 created Domain snapshot s5 created +Domain snapshot s6 reverted =20 Domain snapshot s4 created +Domain snapshot s1 reverted =20 Domain snapshot s7 created Domain snapshot s8 created diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 8fa64ba903..b7ec675e61 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1783,7 +1783,11 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCm= d *cmd) result =3D virDomainRevertToSnapshot(snapshot, flags); } =20 - return result >=3D 0; + if (result < 0) + vshError(ctl, _("Failed to revert snapshot %s"), name); + else + vshPrintExtra(ctl, _("Domain snapshot %s reverted\n"), name); + return result; } =20 /* --=20 2.38.1