From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqEaP-0006yo-87 for qemu-devel@nongnu.org; Mon, 09 Dec 2013 23:06:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqEaH-0006BW-Ay for qemu-devel@nongnu.org; Mon, 09 Dec 2013 23:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqEaH-0006BS-1d for qemu-devel@nongnu.org; Mon, 09 Dec 2013 23:06:09 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBA468uE006101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Dec 2013 23:06:08 -0500 Received: from dreadlord-bne-redhat-com.bne.redhat.com (dhcp-40-7.bne.redhat.com [10.64.40.7]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBA460lY024007 for ; Mon, 9 Dec 2013 23:06:07 -0500 From: Dave Airlie Date: Tue, 10 Dec 2013 14:05:55 +1000 Message-Id: <1386648358-25892-6-git-send-email-airlied@gmail.com> In-Reply-To: <1386648358-25892-1-git-send-email-airlied@gmail.com> References: <1386648358-25892-1-git-send-email-airlied@gmail.com> Subject: [Qemu-devel] [PATCH 5/8] console: add ability to wrap a console. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Dave Airlie In order to implement virtio-vga on top of virtio-gpu we need to be able to wrap the first console virtio-gpu registers from inside virtio-vga which initialises after virtio-gpu. With this interface virtio-vga can store the virtio-gpu interfaces, and call them from its own ones. Signed-off-by: Dave Airlie --- include/ui/console.h | 7 +++++++ ui/console.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index f6e8957..2ad9238 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -285,6 +285,13 @@ QemuConsole *graphic_console_init(DeviceState *dev, const GraphicHwOps *ops, void *opaque); +void graphic_console_wrap(QemuConsole *con, + DeviceState *dev, + const GraphicHwOps *ops, + void *opaque, + const GraphicHwOps **orig_ops, + void **orig_opaque); + void graphic_hw_update(QemuConsole *con); void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); diff --git a/ui/console.c b/ui/console.c index def11ea..f2d6721 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1619,6 +1619,19 @@ QemuConsole *graphic_console_init(DeviceState *dev, return s; } +void graphic_console_wrap(QemuConsole *con, + DeviceState *dev, + const GraphicHwOps *hw_ops, + void *opaque, + const GraphicHwOps **orig_ops, + void **orig_opaque) +{ + *orig_opaque = con->hw; + *orig_ops = con->hw_ops; + con->hw_ops = hw_ops; + con->hw = opaque; +} + QemuConsole *qemu_console_lookup_by_index(unsigned int index) { if (index >= MAX_CONSOLES) { -- 1.8.3.1