kvm tools: Improve 'lkvm {pause,resume}'s output

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>
This commit is contained in:
Asias He
2011-12-22 10:10:45 +08:00
committed by Will Deacon
parent 5bf27f057f
commit 2fa65af316
3 changed files with 18 additions and 3 deletions
+9 -1
View 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)
+9 -1
View 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)
-1
View 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)