All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] spice: misc bugfixes
@ 2010-11-02 11:56 Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 1/3] spice-core: fix watching for write events Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2010-11-02 11:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

This patch series brings a few bugfixes for spice.

please pull,

  Gerd

The following changes since commit 7d72e76228351d18a856f1e4f5365b59d3205dc3:

  intel-hda: documentation update (2010-11-02 00:41:04 +0300)

are available in the git repository at:
  git://anongit.freedesktop.org/spice/qemu bugfix.2

Gerd Hoffmann (2):
      spice-core: fix warning when building with spice < 0.6.0
      spice-display: replace private lock with qemu mutex.

Hans de Goede (1):
      spice-core: fix watching for write events

 ui/spice-core.c    |    6 +++---
 ui/spice-display.c |   27 ++++++++++++++-------------
 ui/spice-display.h |    1 -
 3 files changed, 17 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/3] spice-core: fix watching for write events
  2010-11-02 11:56 [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
@ 2010-11-02 11:56 ` Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 2/3] spice-core: fix warning when building with spice < 0.6.0 Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2010-11-02 11:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann

From: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 6a1cf17..45807ed 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -95,7 +95,7 @@ static void watch_update_mask(SpiceWatch *watch, int event_mask)
         on_read = watch_read;
     }
     if (watch->event_mask & SPICE_WATCH_EVENT_WRITE) {
-        on_read = watch_write;
+        on_write = watch_write;
     }
     qemu_set_fd_handler(watch->fd, on_read, on_write, watch);
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/3] spice-core: fix warning when building with spice < 0.6.0
  2010-11-02 11:56 [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 1/3] spice-core: fix watching for write events Gerd Hoffmann
@ 2010-11-02 11:56 ` Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 3/3] spice-display: replace private lock with qemu mutex Gerd Hoffmann
  2010-11-09 13:40 ` [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
  3 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2010-11-02 11:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 45807ed..e97a72d 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -240,7 +240,7 @@ void qemu_spice_init(void)
     char *x509_key_file = NULL,
         *x509_cert_file = NULL,
         *x509_cacert_file = NULL;
-    int port, tls_port, len, addr_flags, streaming_video;
+    int port, tls_port, len, addr_flags;
     spice_image_compression_t compression;
     spice_wan_compression_t wan_compr;
 
@@ -344,7 +344,7 @@ void qemu_spice_init(void)
 
     str = qemu_opt_get(opts, "streaming-video");
     if (str) {
-        streaming_video = parse_stream_video(str);
+        int streaming_video = parse_stream_video(str);
         spice_server_set_streaming_video(spice_server, streaming_video);
     }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 3/3] spice-display: replace private lock with qemu mutex.
  2010-11-02 11:56 [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 1/3] spice-core: fix watching for write events Gerd Hoffmann
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 2/3] spice-core: fix warning when building with spice < 0.6.0 Gerd Hoffmann
@ 2010-11-02 11:56 ` Gerd Hoffmann
  2010-11-09 13:40 ` [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
  3 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2010-11-02 11:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

qemu_spice_create_update() must aquire the global qemu mutex to
make sure DisplayState doesn't change while we are accessing it.

Once this is in place the private lock is pretty pointless as
everything it protects is covered by the global qemu mutex now.
Drop it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |   27 ++++++++++++++-------------
 ui/spice-display.h |    1 -
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 7b4f5c1..020b423 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -64,10 +64,10 @@ void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r)
 
 /*
  * Called from spice server thread context (via interface_get_command).
- * We do *not* hold the global qemu mutex here, so extra care is needed
- * when calling qemu functions.  Qemu interfaces used:
- *    - pflib (is re-entrant).
- *    - qemu_malloc (underlying glibc malloc is re-entrant).
+ *
+ * We must aquire the global qemu mutex here to make sure the
+ * DisplayState (+DisplaySurface) we are accessing doesn't change
+ * underneath us.
  */
 SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
 {
@@ -78,11 +78,12 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     uint8_t *src, *dst;
     int by, bw, bh;
 
+    qemu_mutex_lock_iothread();
     if (qemu_spice_rect_is_empty(&ssd->dirty)) {
+        qemu_mutex_unlock_iothread();
         return NULL;
     };
 
-    pthread_mutex_lock(&ssd->lock);
     dprint(2, "%s: lr %d -> %d,  tb -> %d -> %d\n", __FUNCTION__,
            ssd->dirty.left, ssd->dirty.right,
            ssd->dirty.top, ssd->dirty.bottom);
@@ -140,7 +141,7 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     cmd->data = (intptr_t)drawable;
 
     memset(&ssd->dirty, 0, sizeof(ssd->dirty));
-    pthread_mutex_unlock(&ssd->lock);
+    qemu_mutex_unlock_iothread();
     return update;
 }
 
@@ -184,14 +185,19 @@ void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
     surface.type       = 0;
     surface.mem        = (intptr_t)ssd->buf;
     surface.group_id   = MEMSLOT_GROUP_HOST;
+
+    qemu_mutex_unlock_iothread();
     ssd->worker->create_primary_surface(ssd->worker, 0, &surface);
+    qemu_mutex_lock_iothread();
 }
 
 void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
 {
     dprint(1, "%s:\n", __FUNCTION__);
 
+    qemu_mutex_unlock_iothread();
     ssd->worker->destroy_primary_surface(ssd->worker, 0);
+    qemu_mutex_lock_iothread();
 }
 
 void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)
@@ -201,7 +207,9 @@ void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)
     if (running) {
         ssd->worker->start(ssd->worker);
     } else {
+        qemu_mutex_unlock_iothread();
         ssd->worker->stop(ssd->worker);
+        qemu_mutex_lock_iothread();
     }
     ssd->running = running;
 }
@@ -219,31 +227,25 @@ void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
     update_area.top = y;
     update_area.bottom = y + h;
 
-    pthread_mutex_lock(&ssd->lock);
     if (qemu_spice_rect_is_empty(&ssd->dirty)) {
         ssd->notify++;
     }
     qemu_spice_rect_union(&ssd->dirty, &update_area);
-    pthread_mutex_unlock(&ssd->lock);
 }
 
 void qemu_spice_display_resize(SimpleSpiceDisplay *ssd)
 {
     dprint(1, "%s:\n", __FUNCTION__);
 
-    pthread_mutex_lock(&ssd->lock);
     memset(&ssd->dirty, 0, sizeof(ssd->dirty));
     qemu_pf_conv_put(ssd->conv);
     ssd->conv = NULL;
-    pthread_mutex_unlock(&ssd->lock);
 
     qemu_spice_destroy_host_primary(ssd);
     qemu_spice_create_host_primary(ssd);
 
-    pthread_mutex_lock(&ssd->lock);
     memset(&ssd->dirty, 0, sizeof(ssd->dirty));
     ssd->notify++;
-    pthread_mutex_unlock(&ssd->lock);
 }
 
 void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
@@ -398,7 +400,6 @@ void qemu_spice_display_init(DisplayState *ds)
     sdpy.ds = ds;
     sdpy.bufsize = (16 * 1024 * 1024);
     sdpy.buf = qemu_malloc(sdpy.bufsize);
-    pthread_mutex_init(&sdpy.lock, NULL);
     register_displaychangelistener(ds, &display_listener);
 
     sdpy.qxl.base.sif = &dpy_interface.base;
diff --git a/ui/spice-display.h b/ui/spice-display.h
index e17671c..aef0464 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -40,7 +40,6 @@ typedef struct SimpleSpiceDisplay {
     uint32_t unique;
     QemuPfConv *conv;
 
-    pthread_mutex_t lock;
     QXLRect dirty;
     int notify;
     int running;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] spice: misc bugfixes
  2010-11-02 11:56 [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2010-11-02 11:56 ` [Qemu-devel] [PATCH 3/3] spice-display: replace private lock with qemu mutex Gerd Hoffmann
@ 2010-11-09 13:40 ` Gerd Hoffmann
  2010-11-16 22:19   ` Anthony Liguori
  3 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2010-11-09 13:40 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 11/02/10 12:56, Gerd Hoffmann wrote:
>    Hi,
>
> This patch series brings a few bugfixes for spice.
>
> please pull,
>
>    Gerd
>
> The following changes since commit 7d72e76228351d18a856f1e4f5365b59d3205dc3:
>
>    intel-hda: documentation update (2010-11-02 00:41:04 +0300)
>
> are available in the git repository at:
>    git://anongit.freedesktop.org/spice/qemu bugfix.2

Ping?

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] spice: misc bugfixes
  2010-11-09 13:40 ` [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
@ 2010-11-16 22:19   ` Anthony Liguori
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2010-11-16 22:19 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 11/09/2010 07:40 AM, Gerd Hoffmann wrote:
> On 11/02/10 12:56, Gerd Hoffmann wrote:
>>    Hi,
>>
>> This patch series brings a few bugfixes for spice.
>>
>> please pull,
>>
>>    Gerd
>>
>> The following changes since commit 
>> 7d72e76228351d18a856f1e4f5365b59d3205dc3:
>>
>>    intel-hda: documentation update (2010-11-02 00:41:04 +0300)
>>
>> are available in the git repository at:
>>    git://anongit.freedesktop.org/spice/qemu bugfix.2
>
> Ping?

Got it.  In the future, please include a [PULL] in your subject line.

Regards,

Anthony Liguori

>
> cheers,
>   Gerd
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-16 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 11:56 [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
2010-11-02 11:56 ` [Qemu-devel] [PATCH 1/3] spice-core: fix watching for write events Gerd Hoffmann
2010-11-02 11:56 ` [Qemu-devel] [PATCH 2/3] spice-core: fix warning when building with spice < 0.6.0 Gerd Hoffmann
2010-11-02 11:56 ` [Qemu-devel] [PATCH 3/3] spice-display: replace private lock with qemu mutex Gerd Hoffmann
2010-11-09 13:40 ` [Qemu-devel] [PATCH 0/3] spice: misc bugfixes Gerd Hoffmann
2010-11-16 22:19   ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.