[Top][All Lists]
[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 09:17:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120714 Thunderbird/10.0.6 |
On 08/21/12 09:09, Yonit Halperin wrote:
> Hi,
> On 08/21/2012 09:58 AM, Gerd Hoffmann wrote:
>> 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.
>>
> ok, good point.
>>> 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.
>>
> qemu_spice_vm_change_state_handler is also called from qxl.c, as part of
> its own vm_change_state handler. I didn't want to add another ifdef there.
Fair point, but then you can drop the #ifdef for the
qemu_add_vm_change_state_handler call too.
cheers,
Gerd