[Spice-devel] [PATCH] Allow Qemu to pass maximum head to guest

Marc-André Lureau mlureau at redhat.com
Mon Jun 8 09:38:47 PDT 2015


Hi Frediano

----- Original Message -----
> Add a max_head field to QXLRom so Qemu can specify the maximum heads it
> wants. This to support heads argument in libvirt properly.
> Padding fields are added to make the structure multiple of 8 bytes. This
> as Qemu append to this structure some fields for mode settings. As
> this structure is packed not adding padding could lead to unaligned
> memory accesses.

I suspect this to be just a hint, as the guest may still request any configuration.

Isn't it enough to rely on driver/kernel level hints then? (kernel qxl num_heads for ex?)

otherwise, looks ok to me.

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  spice/qxl_dev.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
> index a3e91a5..b5c97e9 100644
> --- a/spice/qxl_dev.h
> +++ b/spice/qxl_dev.h
> @@ -164,8 +164,14 @@ typedef struct SPICE_ATTR_PACKED QXLRom {
>          uint16_t padding;
>          QXLURect heads[64];
>      } client_monitors_config;
> +    uint16_t max_heads;               /* valid if flags contains
> QXL_ROM_FLAG_MAX_HEADS */
> +    /* align structure to 8 bytes */
> +    uint16_t padding_end1;
> +    uint32_t padding_end2;
>  } QXLRom;
>  
> +#define QXL_ROM_FLAG_MAX_HEADS          (1<<0)
> +
>  #define CLIENT_MONITORS_CONFIG_CRC32_POLY 0xedb88320
>  
>  /* qxl-1 compat: fixed */
> --
> 2.1.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list