Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 207

kvm-83-164.el5_5.30.src.rpm

From cea092a88b1fc02f130b536ea9b3e949e2301646 Mon Sep 17 00:00:00 2001
From: Dor Laor <dlaor@redhat.com>
Date: Wed, 29 Jul 2009 17:20:24 +0300
Subject: [PATCH 2/2] Work around VM state change handlers running out of order.

Here is a new patch, written by Yaniv, acked by myself:

>From 6253b79afa02e87e016b2dd4cfae4fb83897c4dd Mon Sep 17 00:00:00 2001
From: Yaniv Kamay <ykamay@redhat.com>
Date: Wed, 29 Jul 2009 17:16:31 +0300
Subject: [PATCH] Work around VM state change handlers running out of order.
 Bug 511038

Instead of issuing large scale change, just fix the effected devices.

Signed-off-by: Yaniv Kamay <ykamay@redhat.com>
Signed-off-by: Dor Laor <dor@redhat.com>
Message-ID: <4A705AA8.4090504@redhat.com>
Obsoletes: <87my6ovbt0.fsf@pike.pond.sub.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: 511038
RH-Upstream-status: not-applicable
Acked-by: Dor Laor <dor@redhat.com>
Acked-by: "Yonit Halperin" <yhalperi@redhat.com>
Acked-by: Izik Eidus <ieidus@redhat.com>
Acked-by: Arnon Gilboa <agilboa@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
---
 qemu/hw/qxl.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/qemu/hw/qxl.c b/qemu/hw/qxl.c
index 8a02d07..c3322b5 100644
--- a/qemu/hw/qxl.c
+++ b/qemu/hw/qxl.c
@@ -1414,6 +1414,10 @@ static void qxl_vm_change_state_handler(void *opaque, int running)
 
     printf("QXL: %s: running=%d\n", __FUNCTION__, running);
 
+    if (running == d->state.running) {
+        return;
+    }
+
     if (running) {
         d->state.running = TRUE;
         qemu_set_fd_handler(d->pipe_fd[0], qxl_pipe_read, NULL, d);
@@ -1825,6 +1829,10 @@ static void vdi_port_vm_change_state_handler(void *opaque, int running)
 {
     PCIVDIPortDevice* d=(PCIVDIPortDevice*)opaque;
 
+    if (running == d->running ) {
+        return;
+    }
+
     if (running) {
         d->running = TRUE;
         if (d->new_gen_on_resume) {
-- 
1.6.3.rc4.29.g8146