[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/12] xen: add vkbd support for PV on HVM guests
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 06/12] xen: add vkbd support for PV on HVM guests |
Date: |
Tue, 5 Jul 2011 18:51:07 +0200 |
From: Stefano Stabellini <address@hidden>
Register the vkbd backend even when running as device emulator for HVM
guests: it is useful because it doesn't need a frequent timer like usb.
Check whether the XenInput DisplayState has been set in the initialise
state, rather than the input state.
In case the DisplayState hasn't been set and there is no vfb for this
domain, then set the XenInput DisplayState to the default one.
Changed in v2:
- use qemu_free instead of free;
Signed-off-by: Stefano Stabellini <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/xenfb.c | 19 ++++++++++++-------
xen-all.c | 1 +
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/xenfb.c b/hw/xenfb.c
index 1db75fb..0a01ae3 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -347,13 +347,6 @@ static void xenfb_mouse_event(void *opaque,
static int input_init(struct XenDevice *xendev)
{
- struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
-
- if (!in->c.ds) {
- xen_be_printf(xendev, 1, "ds not set (yet)\n");
- return -1;
- }
-
xenstore_write_be_int(xendev, "feature-abs-pointer", 1);
return 0;
}
@@ -367,6 +360,18 @@ static int input_connect(struct XenDevice *xendev)
&in->abs_pointer_wanted) == -1)
in->abs_pointer_wanted = 0;
+ if (!in->c.ds) {
+ char *vfb = xenstore_read_str(NULL, "device/vfb");
+ if (vfb == NULL) {
+ /* there is no vfb, run vkbd on its own */
+ in->c.ds = get_displaystate();
+ } else {
+ qemu_free(vfb);
+ xen_be_printf(xendev, 1, "ds not set (yet)\n");
+ return -1;
+ }
+ }
+
rc = common_bind(&in->c);
if (rc != 0)
return rc;
diff --git a/xen-all.c b/xen-all.c
index 3d40ab0..fb9bcc8 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -868,6 +868,7 @@ int xen_hvm_init(void)
exit(1);
}
xen_be_register("console", &xen_console_ops);
+ xen_be_register("vkbd", &xen_kbdmouse_ops);
xen_be_register("qdisk", &xen_blkdev_ops);
return 0;
--
1.6.0.2
- [Qemu-devel] [PULL 00/12] Xen patch queue 2011-07-05, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 05/12] xen_console: fix memory leak, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 09/12] xen_disk: treat "aio" as "raw", Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 08/12] qemu_ram_ptr_length: take ram_addr_t as arguments, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 04/12] xen: enable console and disk backend in HVM mode, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 06/12] xen: add vkbd support for PV on HVM guests,
Alexander Graf <=
- [Qemu-devel] [PATCH 02/12] xen: Clean up map cache API naming, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 10/12] checkpatch: don't error out on }, { lines, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 07/12] xen_disk: cope with missing xenstore "params" node, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 01/12] xen: Clean up build system, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 11/12] xen_console: support the new extended xenstore protocol, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 03/12] xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 12/12] xen_console: fall back to qemu serial device, Alexander Graf, 2011/07/05
- Re: [Qemu-devel] [PULL 00/12] Xen patch queue 2011-07-05, Anthony Liguori, 2011/07/19