[Spice-commits] 5 commits - server/char-device.c server/char-device.h server/glz-encoder.c server/glz-encoder-priv.h server/reds.c server/red-worker.c server/spicevmc.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 2 10:01:07 UTC 2019
server/char-device.c | 6 ------
server/char-device.h | 8 +++-----
server/glz-encoder-priv.h | 2 +-
server/glz-encoder.c | 6 +++---
server/red-worker.c | 2 ++
server/reds.c | 2 +-
server/spicevmc.c | 2 +-
7 files changed, 11 insertions(+), 17 deletions(-)
New commits:
commit 2160b1ea393b344756ea58b56a136d49d6483654
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 30 09:39:58 2019 +0100
spicevmc: Remove reds parameter from spicevmc_device_disconnect
Unused.
Also the devices should be able to release themselves.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/char-device.h b/server/char-device.h
index c3c68bef..f4aae93d 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -237,8 +237,7 @@ void red_char_device_write_buffer_release(RedCharDevice *dev,
RedCharDevice *spicevmc_device_connect(RedsState *reds,
SpiceCharDeviceInstance *sin,
uint8_t channel_type);
-void spicevmc_device_disconnect(RedsState *reds,
- SpiceCharDeviceInstance *char_device);
+void spicevmc_device_disconnect(SpiceCharDeviceInstance *char_device);
SpiceCharDeviceInterface *spice_char_device_get_interface(SpiceCharDeviceInstance *instance);
diff --git a/server/reds.c b/server/reds.c
index 37854ace..a3795ab9 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3379,7 +3379,7 @@ static int spice_server_char_device_remove_interface(RedsState *reds, SpiceBaseI
#endif
else if (strcmp(char_device->subtype, SUBTYPE_USBREDIR) == 0 ||
strcmp(char_device->subtype, SUBTYPE_PORT) == 0) {
- spicevmc_device_disconnect(reds, char_device);
+ spicevmc_device_disconnect(char_device);
} else {
spice_warning("failed to remove char device %s", char_device->subtype);
}
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 84bbb73c..546fe774 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -812,7 +812,7 @@ RedCharDevice *spicevmc_device_connect(RedsState *reds,
}
/* Must be called from RedClient handling thread. */
-void spicevmc_device_disconnect(RedsState *reds, SpiceCharDeviceInstance *sin)
+void spicevmc_device_disconnect(SpiceCharDeviceInstance *sin)
{
g_object_unref(RED_CHAR_DEVICE(sin->st));
sin->st = NULL;
commit 67c7dacd07c04507eb756cdb0e254c37e7ccfae3
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 23 02:34:48 2019 +0100
red-worker: Remove warning
In some configuration _GNU_SOURCE is defined by the compiler
and defining again cause a warning.
Do not define again to avoid the warning.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/red-worker.c b/server/red-worker.c
index d64c26e8..b3335a53 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -17,7 +17,9 @@
*/
#include <config.h>
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
commit 75879867b7a8ab5a6d755029af7e910840c7959b
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 30 06:00:38 2019 +0100
char-device: Remove unused red_char_device_destroy function
g_object_unref is directly used.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/char-device.c b/server/char-device.c
index caabdd3e..2ddd34ef 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -688,12 +688,6 @@ void red_char_device_reset_dev_instance(RedCharDevice *dev,
g_object_notify(G_OBJECT(dev), "sin");
}
-void red_char_device_destroy(RedCharDevice *char_dev)
-{
- g_return_if_fail(RED_IS_CHAR_DEVICE(char_dev));
- g_object_unref(char_dev);
-}
-
static RedCharDeviceClient *red_char_device_client_new(RedClient *client,
int do_flow_control,
uint32_t max_send_queue_size,
diff --git a/server/char-device.h b/server/char-device.h
index 32ee4f78..c3c68bef 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -91,7 +91,7 @@ GType red_char_device_get_type(void) G_GNUC_CONST;
* How to use the api:
* ==================
* device attached: create new object instantiating a RedCharDevice child class
- * device detached: call red_char_device_destroy/reset
+ * device detached: call g_object_unref/red_char_device_reset
*
* client connected and associated with a device: red_char_device_client_add
* client disconnected: red_char_device_client_remove
@@ -120,7 +120,7 @@ GType red_char_device_get_type(void) G_GNUC_CONST;
* red_char_device_wakeup (for reading from the device)
*/
/* refcounting is used to protect the char_dev from being deallocated in
- * case red_char_device_destroy has been called
+ * case g_object_unref has been called
* during a callback, and we might still access the char_dev afterwards.
*/
@@ -160,7 +160,6 @@ typedef struct RedCharDeviceWriteBuffer {
void red_char_device_reset_dev_instance(RedCharDevice *dev,
SpiceCharDeviceInstance *sin);
-void red_char_device_destroy(RedCharDevice *dev);
/* only one client is supported */
void red_char_device_migrate_data_marshall(RedCharDevice *dev,
commit b22ce8b04298cc9f224a5c5ef7a462c3667224d7
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Jul 20 10:45:12 2019 +0100
glz-encoder: Remove useless __packed__ attribute
These structure contain only bytes, no need for this attribute.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/glz-encoder.c b/server/glz-encoder.c
index 34129403..ee9d95ae 100644
--- a/server/glz-encoder.c
+++ b/server/glz-encoder.c
@@ -168,18 +168,18 @@ void glz_encoder_destroy(GlzEncoderContext *opaque_encoder)
typedef uint8_t BYTE;
-typedef struct __attribute__ ((__packed__)) one_byte_pixel_t {
+typedef struct one_byte_pixel_t {
BYTE a;
} one_byte_pixel_t;
-typedef struct __attribute__ ((__packed__)) rgb32_pixel_t {
+typedef struct rgb32_pixel_t {
BYTE b;
BYTE g;
BYTE r;
BYTE pad;
} rgb32_pixel_t;
-typedef struct __attribute__ ((__packed__)) rgb24_pixel_t {
+typedef struct rgb24_pixel_t {
BYTE b;
BYTE g;
BYTE r;
commit ecd0d70a3d7f80a5cacb308eb249fa594edbe37b
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Jul 20 10:44:23 2019 +0100
glz-encoder-dict: Remove useless __packed__ attribute
The structure has no holes, adding this attribute could only
decrease efficiency.
Note that HashEntry structure is used for a large (8MB) array so
this won't affect much possible container size.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/glz-encoder-priv.h b/server/glz-encoder-priv.h
index 08dc007c..7757f232 100644
--- a/server/glz-encoder-priv.h
+++ b/server/glz-encoder-priv.h
@@ -76,7 +76,7 @@ struct WindowImageSegment {
};
-struct __attribute__ ((__packed__)) HashEntry {
+struct HashEntry {
uint32_t image_seg_idx;
uint32_t ref_pix_idx;
};
More information about the Spice-commits
mailing list