[PATCH spice 2/3] char_device: Don't set the write-retry timer when not running

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

 



The write-retry timer should not be set when we're leaving
spice_char_device_write_to_device because the char-dev has been stopped.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 server/char_device.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/server/char_device.c b/server/char_device.c
index 368c9bc..63afee1 100644
--- a/server/char_device.c
+++ b/server/char_device.c
@@ -468,10 +468,13 @@ static int spice_char_device_write_to_device(SpiceCharDeviceState *dev)
         dev->cur_write_buf_pos += n;
     }
     /* retry writing as long as the write queue is not empty */
-    if (dev->cur_write_buf) {
-        core->timer_start(dev->write_to_dev_timer, CHAR_DEVICE_WRITE_TO_TIMEOUT);
-    } else {
-        spice_assert(ring_is_empty(&dev->write_queue));
+    if (dev->running) {
+        if (dev->cur_write_buf) {
+            core->timer_start(dev->write_to_dev_timer,
+                              CHAR_DEVICE_WRITE_TO_TIMEOUT);
+        } else {
+            spice_assert(ring_is_empty(&dev->write_queue));
+        }
     }
     spice_char_device_state_unref(dev);
     dev->active = dev->active || total;
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]