[Spice-commits] 2 commits - server/dcc.c server/dcc-send.c server/tests
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon May 13 13:16:07 UTC 2019
server/dcc-send.c | 4 +++-
server/dcc.c | 3 ++-
server/tests/test-display-base.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 07adcce16e8549c22cbce641757446c503b000bf
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed May 8 14:06:05 2019 +0100
dcc: Avoid usage of not aligned GlzEncDictRestoreData structure
Copy to/from unaligned field to avoid potential unaligned access.
Although it adds a copy it's not in a hot path (migration) and
the structure is pretty small.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/dcc-send.c b/server/dcc-send.c
index e8df1fb3..ea2128e2 100644
--- a/server/dcc-send.c
+++ b/server/dcc-send.c
@@ -1825,6 +1825,7 @@ static void display_channel_marshall_migrate_data(RedChannelClient *rcc,
DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
ImageEncoders *encoders = dcc_get_encoders(dcc);
SpiceMigrateDataDisplay display_data = {0,};
+ GlzEncDictRestoreData glz_dict_data;
display_channel = DISPLAY_CHANNEL(red_channel_client_get_channel(rcc));
@@ -1846,7 +1847,8 @@ static void display_channel_marshall_migrate_data(RedChannelClient *rcc,
sizeof(display_data.pixmap_cache_clients));
image_encoders_glz_get_restore_data(encoders, &display_data.glz_dict_id,
- &display_data.glz_dict_data);
+ &glz_dict_data);
+ display_data.glz_dict_data = glz_dict_data;
/* all data besided the surfaces ref */
spice_marshaller_add(base_marshaller,
diff --git a/server/dcc.c b/server/dcc.c
index 7751f430..acc1ca38 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -1250,10 +1250,11 @@ bool dcc_handle_message(RedChannelClient *rcc, uint16_t type, uint32_t size, voi
static int dcc_handle_migrate_glz_dictionary(DisplayChannelClient *dcc,
SpiceMigrateDataDisplay *migrate)
{
+ GlzEncDictRestoreData glz_dict_data = migrate->glz_dict_data;
return image_encoders_restore_glz_dictionary(&dcc->priv->encoders,
red_channel_client_get_client(RED_CHANNEL_CLIENT(dcc)),
migrate->glz_dict_id,
- &migrate->glz_dict_data);
+ &glz_dict_data);
}
static bool restore_surface(DisplayChannelClient *dcc, uint32_t surface_id)
commit 753ebc0e7ce55485e34293e1c9ea57c9c7698783
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed May 8 14:03:39 2019 +0100
test-display-base: Use SPICE_CONTAINEROF to avoid alignment warning
This change prevent a warning issued by GCC 9 and potentially
other compilers.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/tests/test-display-base.c b/server/tests/test-display-base.c
index 31d856ae..49e99343 100644
--- a/server/tests/test-display-base.c
+++ b/server/tests/test-display-base.c
@@ -670,7 +670,7 @@ static void release_resource(SPICE_GNUC_UNUSED QXLInstance *qin,
spice_assert(release_info.group_id == MEM_SLOT_GROUP_ID);
switch (ext->cmd.type) {
case QXL_CMD_DRAW:
- test_spice_destroy_update((void*)ext);
+ test_spice_destroy_update(SPICE_CONTAINEROF(ext, SimpleSpiceUpdate, ext));
break;
case QXL_CMD_SURFACE:
g_free(ext);
More information about the Spice-commits
mailing list