From nobody Wed May 15 05:35:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1669795488; cv=none; d=zohomail.com; s=zohoarc; b=R4CPztEgpdCnzTcR20v9oh8+cmwqs4IupPuJY1YkqTIkScK7Cq0lq384Rl7JNIpiECtU9OP0ApsKWPEGYyQOmt83ilq/1VkbVBMmY8gvheKOKG5gZ7tX2Juz9Irh7oQM34HB50DGTPw06WFq05sJBvzNwwobXcNiEQPgICMQSBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669795488; 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=GJcyl5DEfG1mpe26IFzkRppeLeeH1f/mstf6QcbTi6g=; b=W9zxF20d8iVjnPgJA8fx2MuHRSLSjulhHUiIBsHqwXBKnKjavX81WqRCSwbtWhEJS7tmJXp8dSSC4rI1TEz1bH7myyrMAJD096ELX0EV7NUOIfrmOVTfYDNmQu9GzH2yKMaQvP4e9eKmafnHhPnG/WVdWWd7wE2qB32vuGHHUWI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1669795488381715.1024751525309; Wed, 30 Nov 2022 00:04:48 -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-382-oImfctkyM3C2Fgcmdp_SYw-1; Wed, 30 Nov 2022 03:04:43 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23D69811E75; Wed, 30 Nov 2022 08:04:42 +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 B1F9B1401C24; Wed, 30 Nov 2022 08:04:39 +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 7A9E519465A2; Wed, 30 Nov 2022 08:04:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 89FBA19465A0 for ; Wed, 30 Nov 2022 08:04:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7C74240C83D9; Wed, 30 Nov 2022 08:04:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 751A040C2066 for ; Wed, 30 Nov 2022 08:04:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 597E6101A54E for ; Wed, 30 Nov 2022 08:04:37 +0000 (UTC) Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-LMNk4bMDOBmL-D_5OJajBw-1; Wed, 30 Nov 2022 03:04:35 -0500 Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP; 30 Nov 2022 17:04:34 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 380C5E0AC0 for ; Wed, 30 Nov 2022 17:04:32 +0900 (JST) Received: from m3004.s.css.fujitsu.com (m3004.s.css.fujitsu.com [10.128.233.124]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 7D37031914 for ; Wed, 30 Nov 2022 17:04:31 +0900 (JST) Received: from ohf37b.. (unknown [10.125.14.40]) by m3004.s.css.fujitsu.com (Postfix) with ESMTP id 57B11203EBC8; Wed, 30 Nov 2022 17:04:31 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669795486; 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=GJcyl5DEfG1mpe26IFzkRppeLeeH1f/mstf6QcbTi6g=; b=NFIgt5Al1a6s1VXZCkjhW8qPL+5yxmxDjVn+C//GY617FPtXjJzEfeFJiYnM8Yg6bvW2AN UQXPtBFz1h3Zdg1dSu090uj8BAlF1QoDH/DUixhGB0ws2CRuREopsgs3kAgQ2cgVRUktMv 5EMFG+RzPz6nZrFG0KOjNI4DsKnjqTg= X-MC-Unique: oImfctkyM3C2Fgcmdp_SYw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: LMNk4bMDOBmL-D_5OJajBw-1 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="98122866" X-IronPort-AV: E=Sophos;i="5.96,205,1665414000"; d="scan'208";a="98122866" From: Haruka Ohata To: libvir-list@redhat.com Subject: [PATCH v4] virsh: Add message to terminal when running snapshot-revert Date: Wed, 30 Nov 2022 17:04:07 +0900 Message-Id: <20221130080407.195599-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.1 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.7 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: 1669795490074100001 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. Reviewed-by: J=C3=A1n Tomko --- # 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 | 4 ++++ 2 files changed, 7 insertions(+) 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..68908cd10a 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1783,6 +1783,10 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCm= d *cmd) result =3D virDomainRevertToSnapshot(snapshot, flags); } =20 + if (result < 0) + vshError(ctl, _("Failed to revert snapshot %s"), name); + else + vshPrintExtra(ctl, _("Domain snapshot %s reverted\n"), name); return result >=3D 0; } =20 --=20 2.38.1