All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] xen: enable PV backends for HVM guests
@ 2011-06-24 14:53 ` Stefano Stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: Stefano Stabellini @ 2011-06-24 14:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Alexander Graf, Stefano Stabellini

Hi all,
this small patch series enables console, disk and kbd backends for HVM
guests, for the benefit of Linux and Windows PV on HVM drivers.

Stefano Stabellini (2):
      xen: enable console and disk backend in HVM mode
      xen: add vkbd support for PV on HVM guests

 hw/xenfb.c |   19 ++++++++++++-------
 xen-all.c  |    9 +++++++++
 2 files changed, 21 insertions(+), 7 deletions(-)

Cheers,

Stefano

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 0/2] xen: enable PV backends for HVM guests
@ 2011-06-24 14:53 ` Stefano Stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: Stefano Stabellini @ 2011-06-24 14:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Stabellini, Alexander Graf

Hi all,
this small patch series enables console, disk and kbd backends for HVM
guests, for the benefit of Linux and Windows PV on HVM drivers.

Stefano Stabellini (2):
      xen: enable console and disk backend in HVM mode
      xen: add vkbd support for PV on HVM guests

 hw/xenfb.c |   19 ++++++++++++-------
 xen-all.c  |    9 +++++++++
 2 files changed, 21 insertions(+), 7 deletions(-)

Cheers,

Stefano

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 1/2] xen: enable console and disk backend in HVM mode
  2011-06-24 14:53 ` Stefano Stabellini
@ 2011-06-24 14:54   ` stefano.stabellini
  -1 siblings, 0 replies; 11+ messages in thread
From: stefano.stabellini @ 2011-06-24 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, agraf, Stefano Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Initialize the Xen console backend and the Xen disk backend even when
running in HVM mode so that PV on HVM drivers can connect to them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-all.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index b0b2f10..93fa2ee 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -862,6 +862,14 @@ int xen_hvm_init(void)
     cpu_register_phys_memory_client(&state->client);
     state->log_for_dirtybit = NULL;
 
+    /* Initialize backend core & drivers */
+    if (xen_be_init() != 0) {
+        fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
+        exit(1);
+    }
+    xen_be_register("console", &xen_console_ops);
+    xen_be_register("qdisk", &xen_blkdev_ops);
+
     return 0;
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 1/2] xen: enable console and disk backend in HVM mode
@ 2011-06-24 14:54   ` stefano.stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: stefano.stabellini @ 2011-06-24 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, agraf, Stefano Stabellini, Stefano.Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Initialize the Xen console backend and the Xen disk backend even when
running in HVM mode so that PV on HVM drivers can connect to them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-all.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index b0b2f10..93fa2ee 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -862,6 +862,14 @@ int xen_hvm_init(void)
     cpu_register_phys_memory_client(&state->client);
     state->log_for_dirtybit = NULL;
 
+    /* Initialize backend core & drivers */
+    if (xen_be_init() != 0) {
+        fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
+        exit(1);
+    }
+    xen_be_register("console", &xen_console_ops);
+    xen_be_register("qdisk", &xen_blkdev_ops);
+
     return 0;
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/2] xen: add vkbd support for PV on HVM guests
  2011-06-24 14:53 ` Stefano Stabellini
@ 2011-06-24 14:54   ` stefano.stabellini
  -1 siblings, 0 replies; 11+ messages in thread
From: stefano.stabellini @ 2011-06-24 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, agraf, Stefano Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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 a3301ac..13b9b1b 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;
 }
@@ -363,6 +356,18 @@ static int input_initialise(struct XenDevice *xendev)
     struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
     int rc;
 
+    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 {
+            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 93fa2ee..6099bff 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.7.2.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] xen: add vkbd support for PV on HVM guests
@ 2011-06-24 14:54   ` stefano.stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: stefano.stabellini @ 2011-06-24 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, agraf, Stefano Stabellini, Stefano.Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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 a3301ac..13b9b1b 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;
 }
@@ -363,6 +356,18 @@ static int input_initialise(struct XenDevice *xendev)
     struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
     int rc;
 
+    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 {
+            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 93fa2ee..6099bff 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.7.2.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] xen: add vkbd support for PV on HVM guests
  2011-06-24 14:54   ` stefano.stabellini
  (?)
@ 2011-06-24 15:19   ` Peter Maydell
  2011-06-24 16:34       ` Stefano Stabellini
  -1 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2011-06-24 15:19 UTC (permalink / raw)
  To: stefano.stabellini; +Cc: xen-devel, qemu-devel, agraf

On 24 June 2011 15:54,  <stefano.stabellini@eu.citrix.com> wrote:

> +    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 {
> +            free(vfb);

xenstore_read_str() returns a pointer from a qemu_strdup()
so strictly this should be a qemu_free(), I think?

-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] xen: add vkbd support for PV on HVM guests
  2011-06-24 15:19   ` [Qemu-devel] " Peter Maydell
@ 2011-06-24 16:34       ` Stefano Stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: Stefano Stabellini @ 2011-06-24 16:34 UTC (permalink / raw)
  To: Peter Maydell
  Cc: agraf@suse.de, xen-devel@lists.xensource.com,
	qemu-devel@nongnu.org, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

On Fri, 24 Jun 2011, Peter Maydell wrote:
> On 24 June 2011 15:54,  <stefano.stabellini@eu.citrix.com> wrote:
> 
> > +    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 {
> > +            free(vfb);
> 
> xenstore_read_str() returns a pointer from a qemu_strdup()
> so strictly this should be a qemu_free(), I think?
 
Yes, it should be, I'll send a second version of the patch.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] xen: add vkbd support for PV on HVM guests
@ 2011-06-24 16:34       ` Stefano Stabellini
  0 siblings, 0 replies; 11+ messages in thread
From: Stefano Stabellini @ 2011-06-24 16:34 UTC (permalink / raw)
  To: Peter Maydell
  Cc: agraf@suse.de, xen-devel@lists.xensource.com,
	qemu-devel@nongnu.org, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

On Fri, 24 Jun 2011, Peter Maydell wrote:
> On 24 June 2011 15:54,  <stefano.stabellini@eu.citrix.com> wrote:
> 
> > +    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 {
> > +            free(vfb);
> 
> xenstore_read_str() returns a pointer from a qemu_strdup()
> so strictly this should be a qemu_free(), I think?
 
Yes, it should be, I'll send a second version of the patch.

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] xen: enable console and disk backend in HVM mode
  2011-06-24 14:54   ` stefano.stabellini
@ 2011-06-30 15:09     ` Alexander Graf
  -1 siblings, 0 replies; 11+ messages in thread
From: Alexander Graf @ 2011-06-30 15:09 UTC (permalink / raw)
  To: stefano.stabellini; +Cc: xen-devel, qemu-devel

On 06/24/2011 04:54 PM, stefano.stabellini@eu.citrix.com wrote:
> From: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
>
> Initialize the Xen console backend and the Xen disk backend even when
> running in HVM mode so that PV on HVM drivers can connect to them.

Thanks, applied to xen-next branch.

Alex

> Signed-off-by: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
> ---
>   xen-all.c |    8 ++++++++
>   1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/xen-all.c b/xen-all.c
> index b0b2f10..93fa2ee 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -862,6 +862,14 @@ int xen_hvm_init(void)
>       cpu_register_phys_memory_client(&state->client);
>       state->log_for_dirtybit = NULL;
>
> +    /* Initialize backend core&  drivers */
> +    if (xen_be_init() != 0) {
> +        fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
> +        exit(1);
> +    }
> +    xen_be_register("console",&xen_console_ops);
> +    xen_be_register("qdisk",&xen_blkdev_ops);
> +
>       return 0;
>   }
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] xen: enable console and disk backend in HVM mode
@ 2011-06-30 15:09     ` Alexander Graf
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Graf @ 2011-06-30 15:09 UTC (permalink / raw)
  To: stefano.stabellini; +Cc: xen-devel, qemu-devel

On 06/24/2011 04:54 PM, stefano.stabellini@eu.citrix.com wrote:
> From: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
>
> Initialize the Xen console backend and the Xen disk backend even when
> running in HVM mode so that PV on HVM drivers can connect to them.

Thanks, applied to xen-next branch.

Alex

> Signed-off-by: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
> ---
>   xen-all.c |    8 ++++++++
>   1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/xen-all.c b/xen-all.c
> index b0b2f10..93fa2ee 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -862,6 +862,14 @@ int xen_hvm_init(void)
>       cpu_register_phys_memory_client(&state->client);
>       state->log_for_dirtybit = NULL;
>
> +    /* Initialize backend core&  drivers */
> +    if (xen_be_init() != 0) {
> +        fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
> +        exit(1);
> +    }
> +    xen_be_register("console",&xen_console_ops);
> +    xen_be_register("qdisk",&xen_blkdev_ops);
> +
>       return 0;
>   }
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-30 15:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24 14:53 [Qemu-devel] [PATCH 0/2] xen: enable PV backends for HVM guests Stefano Stabellini
2011-06-24 14:53 ` Stefano Stabellini
2011-06-24 14:54 ` [Qemu-devel] [PATCH 1/2] xen: enable console and disk backend in HVM mode stefano.stabellini
2011-06-24 14:54   ` stefano.stabellini
2011-06-30 15:09   ` [Qemu-devel] " Alexander Graf
2011-06-30 15:09     ` Alexander Graf
2011-06-24 14:54 ` [Qemu-devel] [PATCH 2/2] xen: add vkbd support for PV on HVM guests stefano.stabellini
2011-06-24 14:54   ` stefano.stabellini
2011-06-24 15:19   ` [Qemu-devel] " Peter Maydell
2011-06-24 16:34     ` Stefano Stabellini
2011-06-24 16:34       ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.