[Spice-devel] [PATCH xf86-qxl 1/2] Assert on QXL_INTERRUPT_ERROR

Alon Levy alon at pobox.com
Sun Oct 12 11:48:33 PDT 2014


On 10/12/2014 03:24 PM, Marc-André Lureau wrote:
> From: Marc-Andre Lureau <marcandre.lureau at redhat.com>
> 
> When qemu qxl device reaches a guest bug, it might set the
> QXL_INTERRUPT_ERROR interrupt flag, and stops processing guest
> commands. Therefore, it makes sense to check that flag in the guest and
> quit, instead of running in infinite loop in X and consuming CPU.
> 
> Related to:
> https://bugzilla.redhat.com/show_bug.cgi?id=1151559

ACK both.

Not sure about the assert though.

> ---
>  src/qxl_io.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qxl_io.c b/src/qxl_io.c
> index 8fa90b6..15fd678 100644
> --- a/src/qxl_io.c
> +++ b/src/qxl_io.c
> @@ -43,9 +43,12 @@ qxl_wait_for_io_command (qxl_screen_t *qxl)
>  
>      ram_header = (void *)((unsigned long)qxl->ram + qxl->rom->ram_header_offset);
>  
> -    while (!(ram_header->int_pending & QXL_INTERRUPT_IO_CMD))
> +    while (!(ram_header->int_pending &
> +             (QXL_INTERRUPT_IO_CMD | QXL_INTERRUPT_ERROR)))
>  	usleep (1);
>  
> +    assert(!(ram_header->int_pending & QXL_INTERRUPT_ERROR));
> +
>      ram_header->int_pending &= ~QXL_INTERRUPT_IO_CMD;
>  }
>  
> 



More information about the Spice-devel mailing list