From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTs63-0005Wa-Lv for qemu-devel@nongnu.org; Thu, 01 Nov 2012 06:34:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTs61-000626-VM for qemu-devel@nongnu.org; Thu, 01 Nov 2012 06:33:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTs61-00060P-Mb for qemu-devel@nongnu.org; Thu, 01 Nov 2012 06:33:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA1AXocR027898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Nov 2012 06:33:50 -0400 Message-ID: <5092500D.6000907@redhat.com> Date: Thu, 01 Nov 2012 11:33:49 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <833806772.25295125.1351765330902.JavaMail.root@redhat.com> In-Reply-To: <833806772.25295125.1351765330902.JavaMail.root@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] hw/qxl: inject interrupts in any state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org Hi, > This prevents a known abort on set_client_capabilities, that should be > fixed in upstream, but it should also be checked against in qxl. Checks > every other location that qxl_send_events is eventually possibly called Why check in all callers instead of qxl_send_events directly? Just print the warning about the spice server bug & possibly lost events and go on. With luck the event arrives nevertheless. And if not we at least sayed before it can happen ;) > +static void spice_server_bug(PCIQXLDevice *qxl, const char *msg, ...) > +{ > + va_list ap; > + va_start(ap, msg); > + fprintf(stderr, "qxl-%d: spice-server bug: ", qxl->id); > + vfprintf(stderr, msg, ap); > + fprintf(stderr, "\n"); > + va_end(ap); > +} > + > +#define SPICE_SERVER_BUG_ONCE(qxl, msg, ...) { \ > + static int called; \ > + if (!called) { \ > + called = 1; \ > + spice_server_bug(qxl, msg, __VA_ARGS__); \ > + } \ > +} That feels a bit like overkill too. cheers, Gerd