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

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

 



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>
---
 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");
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux