qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/5] spice: notify on vm state change only vi


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v2 2/5] spice: notify on vm state change only via spice_server_vm_start/stop
Date: Tue, 21 Aug 2012 08:58:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120714 Thunderbird/10.0.6

  Hi,

> +#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
> +static void display_start(void)
> +{
> +    DisplayListItem *item;
> +
> +    QLIST_FOREACH(item, &display_list, link) {
> +        item->display->running = true;
> +    }
> +}

I think we should simply use a global variable for 'running' here.  It's
global state anyway.  Having this in per-display state struct buys us
nothing and adds alot of code for updating and display list maintainance.

>  void qemu_spice_vm_change_state_handler(void *opaque, int running,
>                                          RunState state)
>  {
> +#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
>      SimpleSpiceDisplay *ssd = opaque;

> +#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
>      qemu_add_vm_change_state_handler(qemu_spice_vm_change_state_handler, 
> &sdpy);
> +#endif

If you don't register qemu_spice_vm_change_state_handler on new
spice-server you should #ifdef the whole function, not the body only.

cheers,
  Gerd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]