[spice-protocol,2/2] qxl_dev: Move QXLReleaseInfoExt out of start/end-packed.h

Submitted by Frediano Ziglio on July 4, 2019, 1:56 p.m.

Details

Message ID 20190704135610.15771-2-fziglio@redhat.com
State Accepted
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio July 4, 2019, 1:56 p.m.
This structure is not declares as SPICE_ATTR_PACKED resulting it
as aligned and no packed using GCC (no MingW).
This structure is only packed under MingW or Microsoft compilers.
This structure is not technically a definition for QXL device but
is used only for spice-server QXL interface.
As said above this change could affect only MingW/Microsoft that is
only Windows ABI of spice-server (very recently added) so
following lines are really not much important.
Note that Windows does not support architectures with CPUs not
supporting unaligned access.
Under Win32 this change don't affect size so nothing much can change.
This structure is currently passed as value to release_resource
callback. Under Win64 this structure is passed like a
"const QXLReleaseInfoExt *" so even if the structure is 16 bytes instead
of 12 this is read the same way.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 spice/qxl_dev.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
index 659f930..c844d7b 100644
--- a/spice/qxl_dev.h
+++ b/spice/qxl_dev.h
@@ -280,11 +280,6 @@  typedef union SPICE_ATTR_PACKED QXLReleaseInfo {
     uint64_t next;    // out
 } QXLReleaseInfo;
 
-typedef struct QXLReleaseInfoExt {
-    QXLReleaseInfo *info;
-    uint32_t group_id;
-} QXLReleaseInfoExt;
-
 typedef struct  SPICE_ATTR_PACKED QXLDataChunk {
     uint32_t data_size;
     QXLPHYSICAL prev_chunk;
@@ -779,4 +774,9 @@  typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
 
 #include <spice/end-packed.h>
 
+typedef struct QXLReleaseInfoExt {
+    QXLReleaseInfo *info;
+    uint32_t group_id;
+} QXLReleaseInfoExt;
+
 #endif /* _H_QXL_DEV */

Comments

ping

> 
> This structure is not declares as SPICE_ATTR_PACKED resulting it
> as aligned and no packed using GCC (no MingW).
> This structure is only packed under MingW or Microsoft compilers.
> This structure is not technically a definition for QXL device but
> is used only for spice-server QXL interface.
> As said above this change could affect only MingW/Microsoft that is
> only Windows ABI of spice-server (very recently added) so
> following lines are really not much important.
> Note that Windows does not support architectures with CPUs not
> supporting unaligned access.
> Under Win32 this change don't affect size so nothing much can change.
> This structure is currently passed as value to release_resource
> callback. Under Win64 this structure is passed like a
> "const QXLReleaseInfoExt *" so even if the structure is 16 bytes instead
> of 12 this is read the same way.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  spice/qxl_dev.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
> index 659f930..c844d7b 100644
> --- a/spice/qxl_dev.h
> +++ b/spice/qxl_dev.h
> @@ -280,11 +280,6 @@ typedef union SPICE_ATTR_PACKED QXLReleaseInfo {
>      uint64_t next;    // out
>  } QXLReleaseInfo;
>  
> -typedef struct QXLReleaseInfoExt {
> -    QXLReleaseInfo *info;
> -    uint32_t group_id;
> -} QXLReleaseInfoExt;
> -
>  typedef struct  SPICE_ATTR_PACKED QXLDataChunk {
>      uint32_t data_size;
>      QXLPHYSICAL prev_chunk;
> @@ -779,4 +774,9 @@ typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
>  
>  #include <spice/end-packed.h>
>  
> +typedef struct QXLReleaseInfoExt {
> +    QXLReleaseInfo *info;
> +    uint32_t group_id;
> +} QXLReleaseInfoExt;
> +
>  #endif /* _H_QXL_DEV */