* [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none
@ 2014-04-10 20:07 qemu Mailinglist
2014-04-10 20:29 ` Alex Williamson
0 siblings, 1 reply; 3+ messages in thread
From: qemu Mailinglist @ 2014-04-10 20:07 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none
2014-04-10 20:07 [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none qemu Mailinglist
@ 2014-04-10 20:29 ` Alex Williamson
2014-04-10 21:14 ` qemu Mailinglist
0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2014-04-10 20:29 UTC (permalink / raw)
To: qemu Mailinglist; +Cc: qemu-devel
On Thu, 2014-04-10 at 22:07 +0200, qemu Mailinglist wrote:
> 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;
>
I don't think vfio is the one to be creating a dummy console, besides
there's no reason you can't have multiple vfio devices with x-vga=on.
There should probably be some dummy console driver so you can add
-device dummy-console to the commandline if this is desired. Thanks,
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none
2014-04-10 20:29 ` Alex Williamson
@ 2014-04-10 21:14 ` qemu Mailinglist
0 siblings, 0 replies; 3+ messages in thread
From: qemu Mailinglist @ 2014-04-10 21:14 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Williamson
Am 10.04.2014 22:29, schrieb Alex Williamson:
> I don't think vfio is the one to be creating a dummy console, besides
> there's no reason you can't have multiple vfio devices with x-vga=on.
> There should probably be some dummy console driver so you can add
> -device dummy-console to the commandline if this is desired. Thanks,
>
> Alex
Hi Alex,
thanks for the fast answer, I had no luck with the dummy devices, so I
have to forward additional input devices via usbpassthru or pcipassthru
of a USB Card.
The other console_inits are in the device files like: ( some from 30
files total)
./hw/unicore32/puv3.c:101: graphic_console_init(NULL, 0, &no_ops, NULL);
./hw/display/pl110.c:467: s->con = graphic_console_init(dev, 0,
&pl110_gfx_ops, s);
./hw/display/vga-isa-mm.c:138: s->vga.con =
graphic_console_init(NULL, 0, s->vga.hw_ops, s);
./hw/display/exynos4210_fimd.c:1920: s->console =
graphic_console_init(DEVICE(dev), 0, &exynos4210_fimd_ops, s);
./hw/display/vmware_vga.c:1203: s->vga.con =
graphic_console_init(dev, 0, &vmsvga_ops, s);
./hw/display/cirrus_vga.c:2920: s->con = graphic_console_init(dev, 0,
s->hw_ops, s);
./hw/display/cirrus_vga.c:2966: s->vga.con =
graphic_console_init(DEVICE(dev), 0, s->vga.hw_ops, &s->vga);
./hw/display/vga-pci.c:154: s->con =
graphic_console_init(DEVICE(dev), 0, s->hw_ops, s);
But you are right, its more a feature with a additional parameter for x-vga.
Thanks,
Tobias
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-10 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10 20:07 [Qemu-devel] [PATCH] Keyboard/Mouse Console for vfio with active function x-vga ans -vga none qemu Mailinglist
2014-04-10 20:29 ` Alex Williamson
2014-04-10 21:14 ` qemu Mailinglist
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).