From patchwork Thu Apr 10 20:07:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: qemu Mailinglist X-Patchwork-Id: 338270 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A638D14008E for ; Fri, 11 Apr 2014 06:07:56 +1000 (EST) Received: from localhost ([::1]:54154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYLGM-00078Y-M5 for incoming@patchwork.ozlabs.org; Thu, 10 Apr 2014 16:07:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYLG0-00070U-PK for qemu-devel@nongnu.org; Thu, 10 Apr 2014 16:07:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYLFu-00053J-VC for qemu-devel@nongnu.org; Thu, 10 Apr 2014 16:07:32 -0400 Received: from s11.pixelx.de ([80.86.184.26]:54481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYLFu-000530-Og for qemu-devel@nongnu.org; Thu, 10 Apr 2014 16:07:26 -0400 Received: from [192.168.7.10] (p5DC7F4A0.dip0.t-ipconnect.de [93.199.244.160]) by s11.pixelx.de (s11.pixelx.de) with ESMTPSA id B6154642441F; Thu, 10 Apr 2014 22:07:24 +0200 (CEST) Message-ID: <5346F9FC.10606@suppser.de> Date: Thu, 10 Apr 2014 22:07:24 +0200 From: qemu Mailinglist User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 80.86.184.26 Cc: alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org there are many discus about using keyboard and mouse with VGA passthru, so I add a graphic_console to vfio.c, like puv3.c. I test it with SDL and VNC Access, the Keyboard works, the mouse work good without absolute version like "-usbdevice mouse". Default it boot with "QEMU PS/2 Mouse", but this is changing to "vmmouse (absolute)" at boot time of gast system. I hope someone else can test. Signed-off-by: Tobias Nannen qemu@suppser.de --- hw/misc/vfio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index 9cf5b84..9294041 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -39,6 +39,7 @@ #include "qemu/range.h" #include "sysemu/kvm.h" #include "sysemu/sysemu.h" +#include "ui/console.h" /* #define DEBUG_VFIO */ #ifdef DEBUG_VFIO @@ -3586,6 +3587,10 @@ static int vfio_get_device(VFIOGroup *group, const char *name, VFIODevice *vdev) QLIST_INIT(&vdev->vga.region[QEMU_PCI_VGA_IO_HI].quirks); vdev->has_vga = true; + if (vga_interface_type == VGA_NONE) { + static const GraphicHwOps no_ops; + graphic_console_init(NULL, 0, &no_ops, NULL); + } } irq_info.index = VFIO_PCI_ERR_IRQ_INDEX;