From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: [PATCH 4/6] kvm tools: Improve 'lkvm {pause,resume}'s output Date: Thu, 22 Dec 2011 10:10:45 +0800 Message-ID: <1324519847-19897-4-git-send-email-asias.hejun@gmail.com> References: <1324519847-19897-1-git-send-email-asias.hejun@gmail.com> Cc: Sasha Levin , Cyrill Gorcunov , Ingo Molnar , kvm@vger.kernel.org, Asias He To: Pekka Enberg Return-path: Received: from mail-tul01m020-f174.google.com ([209.85.214.174]:41609 "EHLO mail-tul01m020-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752957Ab1LVCMh (ORCPT ); Wed, 21 Dec 2011 21:12:37 -0500 Received: by obcwo16 with SMTP id wo16so3706331obc.19 for ; Wed, 21 Dec 2011 18:12:37 -0800 (PST) In-Reply-To: <1324519847-19897-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: lkvm {pause,resume} do not give any feedback to user who uses these commands in the console where the command run. This patch makes the command output in the command console instead of guest console. Signed-off-by: Asias He --- tools/kvm/builtin-pause.c | 10 +++++++++- tools/kvm/builtin-resume.c | 10 +++++++++- tools/kvm/builtin-run.c | 1 - 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/kvm/builtin-pause.c b/tools/kvm/builtin-pause.c index ee5a5b8..436963f 100644 --- a/tools/kvm/builtin-pause.c +++ b/tools/kvm/builtin-pause.c @@ -41,7 +41,15 @@ void kvm_pause_help(void) static int do_pause(const char *name, int sock) { - return kvm_ipc__send(sock, KVM_IPC_PAUSE); + int r; + + r = kvm_ipc__send(sock, KVM_IPC_PAUSE); + if (r) + return r; + + printf("Guest %s paused\n", name); + + return 0; } int kvm_cmd_pause(int argc, const char **argv, const char *prefix) diff --git a/tools/kvm/builtin-resume.c b/tools/kvm/builtin-resume.c index 9c47183..033a05b 100644 --- a/tools/kvm/builtin-resume.c +++ b/tools/kvm/builtin-resume.c @@ -41,7 +41,15 @@ void kvm_resume_help(void) static int do_resume(const char *name, int sock) { - return kvm_ipc__send(sock, KVM_IPC_RESUME); + int r; + + r = kvm_ipc__send(sock, KVM_IPC_RESUME); + if (r) + return r; + + printf("Guest %s resumed\n", name); + + return 0; } int kvm_cmd_resume(int argc, const char **argv, const char *prefix) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 80806a1..bf39cfb 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -522,7 +522,6 @@ static void handle_pause(int fd, u32 type, u32 len, u8 *msg) } is_paused = !is_paused; - pr_info("Guest %s\n", is_paused ? "paused" : "resumed"); } static void handle_vmstate(int fd, u32 type, u32 len, u8 *msg) -- 1.7.7.3