[tip:tools/kvm] kvm tools: Do not run guest if it is stopped.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  ead99857b8b3d6b23be0635b3beb057cbc913a70
Gitweb:     http://git.kernel.org/tip/ead99857b8b3d6b23be0635b3beb057cbc913a70
Author:     Asias He <asias.hejun@xxxxxxxxx>
AuthorDate: Wed, 21 Dec 2011 21:47:11 +0800
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Wed, 21 Dec 2011 22:32:02 +0200

kvm tools: Do not run guest if it is stopped.

If the guest is stopped, there is no need to run it.
This patch fixes this when running 'lkvm stop'.

   KVM_RUN failed: Bad address

Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/kvm-cpu.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
index bdefa09..12791dd 100644
--- a/tools/kvm/kvm-cpu.c
+++ b/tools/kvm/kvm-cpu.c
@@ -29,6 +29,9 @@ void kvm_cpu__run(struct kvm_cpu *vcpu)
 {
 	int err;
 
+	if (!vcpu->is_running)
+		return;
+
 	err = ioctl(vcpu->vcpu_fd, KVM_RUN, 0);
 	if (err < 0 && (errno != EINTR && errno != EAGAIN))
 		die_perror("KVM_RUN failed");
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux