From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3jDb-00086X-RI for qemu-devel@nongnu.org; Tue, 21 Aug 2012 03:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3jDa-0006ZD-V1 for qemu-devel@nongnu.org; Tue, 21 Aug 2012 03:49:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3jDa-0006Z5-Mv for qemu-devel@nongnu.org; Tue, 21 Aug 2012 03:49:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7L6wsT2000300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Aug 2012 02:58:55 -0400 Message-ID: <503331AD.1010101@redhat.com> Date: Tue, 21 Aug 2012 08:58:53 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1345469176-1675-1-git-send-email-yhalperi@redhat.com> <1345469176-1675-3-git-send-email-yhalperi@redhat.com> In-Reply-To: <1345469176-1675-3-git-send-email-yhalperi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/5] spice: notify on vm state change only via spice_server_vm_start/stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yonit Halperin Cc: qemu-devel@nongnu.org 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