Re: [Spice-devel] [PATCH] qxl_driver.c: fix compiler warning 'defined but not used' qxl_kernel_mode_enabled

2014-06-25 Thread Alon Levy
 On Mon, Jun 09, 2014 at 04:08:37PM +0300, Alon Levy wrote:
  Signed-off-by: Alon Levy al...@redhat.com
  ---
   src/qxl_driver.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/src/qxl_driver.c b/src/qxl_driver.c
  index b9aa0e9..d9bf447 100644
  --- a/src/qxl_driver.c
  +++ b/src/qxl_driver.c
  @@ -1242,7 +1242,7 @@ qxl_init_scrn (ScrnInfoPtr pScrn, Bool kms)
   pScrn-ValidMode= NULL;
   }
   
  -#ifdef XF86DRM_MODE
  +#if defined(XF86DRM_MODE)  !defined(XSPICE)
   static char *
   CreatePCIBusID(const struct pci_device *dev)
   {
  --
  1.9.3
 
 ACK, though we could also ensure that XF86DRM_MODE is never defined when
 XSPICE is ?
 

You're right, but it's more work - mainly deciding what I want done - should 
configure not allow both drm and xspice? probably. Later patch?
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH] qxl_driver.c: fix compiler warning 'defined but not used' qxl_kernel_mode_enabled

2014-06-25 Thread Christophe Fergeau
On Wed, Jun 25, 2014 at 06:14:18AM -0400, Alon Levy wrote:
  On Mon, Jun 09, 2014 at 04:08:37PM +0300, Alon Levy wrote:
   Signed-off-by: Alon Levy al...@redhat.com
   ---
src/qxl_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
   
   diff --git a/src/qxl_driver.c b/src/qxl_driver.c
   index b9aa0e9..d9bf447 100644
   --- a/src/qxl_driver.c
   +++ b/src/qxl_driver.c
   @@ -1242,7 +1242,7 @@ qxl_init_scrn (ScrnInfoPtr pScrn, Bool kms)
pScrn-ValidMode= NULL;
}

   -#ifdef XF86DRM_MODE
   +#if defined(XF86DRM_MODE)  !defined(XSPICE)
static char *
CreatePCIBusID(const struct pci_device *dev)
{
   --
   1.9.3
  
  ACK, though we could also ensure that XF86DRM_MODE is never defined when
  XSPICE is ?
  
 
 You're right, but it's more work - mainly deciding what I want done - should 
 configure not allow both drm and xspice? probably. Later patch?

Sure, can even wait until next time there is a similar issue ;)

Christophe


pgpKnbaDyZiSa.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH] qxl_image.c: fix compilation break

2014-06-25 Thread Alon Levy
Since 3d511c30206bd8c9a207c436186a03af0bb02962 Xspice building is broken
due to undefined MAX_RELOCS when not building with XF86DRM_MODE.
---
 src/qxl_image.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qxl_image.c b/src/qxl_image.c
index eb66b63..8927fd4 100644
--- a/src/qxl_image.c
+++ b/src/qxl_image.c
@@ -159,6 +159,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
 
chunk_size = MAX (512 * 512, dest_stride);
 
+#ifdef XF86DRM_MODE
/* ensure we will not create too many pieces and overflow
 * the command buffer (MAX_RELOCS).  if so, increase the chunk_size.
 * each loop creates at least 2 cmd buffer entries, and
@@ -170,6 +171,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
ErrorF (adjusted chunk_size to %d\n, chunk_size);
 #endif
}
+#endif
 
while (h)
{
-- 
1.9.3

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


[Spice-devel] [PATCH spice] server: don't assert on invalid client message

2014-06-25 Thread Marc-André Lureau
Some users have been reaching this error:
snd_receive: ASSERT n failed

A misbehaving client could easily hit that condition by sending too big
messages. Instead of assert(), replace with a warning. When a message
too big to fit is received, it will simply disconnect the channel.

https://bugzilla.redhat.com/show_bug.cgi?id=962187
---
 server/snd_worker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/snd_worker.c b/server/snd_worker.c
index 7d52ded..70148b7 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -421,7 +421,7 @@ static void snd_receive(void* data)
 for (;;) {
 ssize_t n;
 n = channel-receive_data.end - channel-receive_data.now;
-spice_assert(n);
+spice_warn_if(n = 0);
 n = reds_stream_read(channel-stream, channel-receive_data.now, n);
 if (n = 0) {
 if (n == 0) {
-- 
1.9.3

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


Re: [Spice-devel] [PATCH spice] server: don't assert on invalid client message

2014-06-25 Thread Uri Lublin

On 06/25/2014 03:36 PM, Marc-André Lureau wrote:

Some users have been reaching this error:
snd_receive: ASSERT n failed

A misbehaving client could easily hit that condition by sending too big
messages. Instead of assert(), replace with a warning. When a message
too big to fit is received, it will simply disconnect the channel.

https://bugzilla.redhat.com/show_bug.cgi?id=962187
---
  server/snd_worker.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/snd_worker.c b/server/snd_worker.c
index 7d52ded..70148b7 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -421,7 +421,7 @@ static void snd_receive(void* data)
  for (;;) {
  ssize_t n;
  n = channel-receive_data.end - channel-receive_data.now;
-spice_assert(n);
+spice_warn_if(n = 0);
  n = reds_stream_read(channel-stream, channel-receive_data.now, n);
  if (n = 0) {
  if (n == 0) {


Ack.

If n is 0, it will disconnect the channel and return, in following lines 
not shown here.
If n  0 (if possible), there is going to be a problem 
(signed-unsigned). But that problem already exists

in the current code too.

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