]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Improve 'lkvm {pause,resume}'s output
authorAsias He <asias.hejun@gmail.com>
Thu, 22 Dec 2011 02:10:45 +0000 (10:10 +0800)
committerPekka Enberg <penberg@kernel.org>
Thu, 22 Dec 2011 14:06:52 +0000 (16:06 +0200)
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 <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/builtin-pause.c
tools/kvm/builtin-resume.c
tools/kvm/builtin-run.c

index ee5a5b844a78a751718768e24db41b87677ec0db..436963f3e87b2f1535aa7e01dc2697609b40bf6a 100644 (file)
@@ -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)
index 9c47183c33c62b925682b42f08895446c57af05d..033a05b7d0a38cd68bcd5274a980d3fce82ee5dc 100644 (file)
@@ -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)
index 80806a1ae0735bf8565c1d84c8eadf024828b346..bf39cfb6790ce28c8769089cd2a575017f6df03c 100644 (file)
@@ -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)