* [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
@ 2014-10-24 9:00 Marc-André Lureau
2014-10-24 9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2014-10-24 9:00 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, Marc-André Lureau, kraxel
When the virtio serial is writable, notify the chardev backend
with qemu_chr_accept_input().
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
Note:
This patch depends on Amit Shah patch:
"virtio: serial: expose a 'guest_writable' callback for users"
hw/char/virtio-console.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 752ed2c..2a867cb 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -95,6 +95,15 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
}
}
+static void guest_writable(VirtIOSerialPort *port)
+{
+ VirtConsole *vcon = VIRTIO_CONSOLE(port);
+
+ if (vcon->chr) {
+ qemu_chr_accept_input(vcon->chr);
+ }
+}
+
/* Readiness of the guest to accept data on a port */
static int chr_can_read(void *opaque)
{
@@ -188,6 +197,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data)
k->unrealize = virtconsole_unrealize;
k->have_data = flush_buf;
k->set_guest_connected = set_guest_connected;
+ k->guest_writable = guest_writable;
dc->props = virtserialport_properties;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-24 9:00 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
@ 2014-10-24 9:00 ` Marc-André Lureau
2014-10-27 8:08 ` Gerd Hoffmann
2014-10-27 12:43 ` Amit Shah
0 siblings, 2 replies; 11+ messages in thread
From: Marc-André Lureau @ 2014-10-24 9:00 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, Marc-André Lureau, kraxel
The spice server is polling on write, unless
SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must
call spice_server_char_device_wakeup() when the frontend is writable.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
spice-qemu-char.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 8106e06..3de01d1 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -111,6 +111,9 @@ static SpiceCharDeviceInterface vmc_interface = {
#if SPICE_SERVER_VERSION >= 0x000c02
.event = vmc_event,
#endif
+#if SPICE_SERVER_VERSION >= 0x000c06
+ .flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
+#endif
};
@@ -261,6 +264,13 @@ static void print_allowed_subtypes(void)
fprintf(stderr, "\n");
}
+static void spice_chr_accept_input(struct CharDriverState *chr)
+{
+ SpiceCharDriver *s = chr->opaque;
+
+ spice_server_char_device_wakeup(&s->sin);
+}
+
static CharDriverState *chr_open(const char *subtype,
void (*set_fe_open)(struct CharDriverState *, int))
@@ -280,6 +290,7 @@ static CharDriverState *chr_open(const char *subtype,
chr->chr_set_fe_open = set_fe_open;
chr->explicit_be_open = true;
chr->chr_fe_event = spice_chr_fe_event;
+ chr->chr_accept_input = spice_chr_accept_input;
QLIST_INSERT_HEAD(&spice_chars, s, next);
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-24 9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
@ 2014-10-27 8:08 ` Gerd Hoffmann
2014-10-27 11:45 ` Marc-André Lureau
2014-10-27 12:43 ` Amit Shah
1 sibling, 1 reply; 11+ messages in thread
From: Gerd Hoffmann @ 2014-10-27 8:08 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: amit.shah, qemu-devel
On Fr, 2014-10-24 at 11:00 +0200, Marc-André Lureau wrote:
> The spice server is polling on write, unless
> SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must
> call spice_server_char_device_wakeup() when the frontend is writable.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
> ---
> spice-qemu-char.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/spice-qemu-char.c b/spice-qemu-char.c
> index 8106e06..3de01d1 100644
> --- a/spice-qemu-char.c
> +++ b/spice-qemu-char.c
> @@ -111,6 +111,9 @@ static SpiceCharDeviceInterface vmc_interface = {
> #if SPICE_SERVER_VERSION >= 0x000c02
> .event = vmc_event,
> #endif
> +#if SPICE_SERVER_VERSION >= 0x000c06
> + .flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
> +#endif
> };
>
>
> @@ -261,6 +264,13 @@ static void print_allowed_subtypes(void)
> fprintf(stderr, "\n");
> }
>
> +static void spice_chr_accept_input(struct CharDriverState *chr)
> +{
> + SpiceCharDriver *s = chr->opaque;
> +
> + spice_server_char_device_wakeup(&s->sin);
Does this build on older spice versions? I'd suspect this needs #if
SPICE_SERVER_VERSION too ...
cheers,
Gerd
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-27 8:08 ` Gerd Hoffmann
@ 2014-10-27 11:45 ` Marc-André Lureau
2014-10-27 11:57 ` Gerd Hoffmann
0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2014-10-27 11:45 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: amit.shah, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Hi
On Mon, Oct 27, 2014 at 9:08 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> > +static void spice_chr_accept_input(struct CharDriverState *chr)
> > +{
> > + SpiceCharDriver *s = chr->opaque;
> > +
> > + spice_server_char_device_wakeup(&s->sin);
>
> Does this build on older spice versions? I'd suspect this needs #if
> SPICE_SERVER_VERSION too ...
There is already a spice_server_char_device_wakeup() call there. On older
servers, this additional call will trigger just a read try. With the
proposed patch in Spice server, it will do read & write try (I didn't see
the need to create a new function to do only read or write, both should be
fine)
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 1154 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-27 11:45 ` Marc-André Lureau
@ 2014-10-27 11:57 ` Gerd Hoffmann
2015-05-04 9:31 ` Amit Shah
0 siblings, 1 reply; 11+ messages in thread
From: Gerd Hoffmann @ 2014-10-27 11:57 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: amit.shah, qemu-devel
On Mo, 2014-10-27 at 12:45 +0100, Marc-André Lureau wrote:
> Hi
>
>
> On Mon, Oct 27, 2014 at 9:08 AM, Gerd Hoffmann <kraxel@redhat.com>
> wrote:
> > +static void spice_chr_accept_input(struct CharDriverState
> *chr)
> > +{
> > + SpiceCharDriver *s = chr->opaque;
> > +
> > + spice_server_char_device_wakeup(&s->sin);
>
>
> Does this build on older spice versions? I'd suspect this
> needs #if
> SPICE_SERVER_VERSION too ...
>
>
> There is already a spice_server_char_device_wakeup() call there. On
> older servers, this additional call will trigger just a read try. With
> the proposed patch in Spice server, it will do read & write try (I
> didn't see the need to create a new function to do only read or write,
> both should be fine)
Ok then. Added to spice queue. Fails to build, but that looks like
just being the dependency on amits patch and should go away once that
one is upstream.
cheers,
Gerd
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-27 11:57 ` Gerd Hoffmann
@ 2015-05-04 9:31 ` Amit Shah
2015-05-05 9:45 ` Gerd Hoffmann
0 siblings, 1 reply; 11+ messages in thread
From: Amit Shah @ 2015-05-04 9:31 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Marc-André Lureau, qemu-devel
Hi Gerd,
On (Mon) 27 Oct 2014 [12:57:57], Gerd Hoffmann wrote:
> On Mo, 2014-10-27 at 12:45 +0100, Marc-André Lureau wrote:
> > Hi
> >
> >
> > On Mon, Oct 27, 2014 at 9:08 AM, Gerd Hoffmann <kraxel@redhat.com>
> > wrote:
> > > +static void spice_chr_accept_input(struct CharDriverState
> > *chr)
> > > +{
> > > + SpiceCharDriver *s = chr->opaque;
> > > +
> > > + spice_server_char_device_wakeup(&s->sin);
> >
> >
> > Does this build on older spice versions? I'd suspect this
> > needs #if
> > SPICE_SERVER_VERSION too ...
> >
> >
> > There is already a spice_server_char_device_wakeup() call there. On
> > older servers, this additional call will trigger just a read try. With
> > the proposed patch in Spice server, it will do read & write try (I
> > didn't see the need to create a new function to do only read or write,
> > both should be fine)
>
> Ok then. Added to spice queue. Fails to build, but that looks like
> just being the dependency on amits patch and should go away once that
> one is upstream.
The dependency patch is now in tree, please pick this series up.
Thanks,
Amit
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2015-05-04 9:31 ` Amit Shah
@ 2015-05-05 9:45 ` Gerd Hoffmann
0 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2015-05-05 9:45 UTC (permalink / raw)
To: Amit Shah; +Cc: Marc-André Lureau, qemu-devel
Hi,
> > Ok then. Added to spice queue. Fails to build, but that looks like
> > just being the dependency on amits patch and should go away once that
> > one is upstream.
>
> The dependency patch is now in tree, please pick this series up.
Hmm, not in my queue any more, probably dropped at some point due
to the build failure.
Can you resend please?
thanks,
Gerd
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-24 9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
2014-10-27 8:08 ` Gerd Hoffmann
@ 2014-10-27 12:43 ` Amit Shah
2014-10-27 16:32 ` Marc-André Lureau
1 sibling, 1 reply; 11+ messages in thread
From: Amit Shah @ 2014-10-27 12:43 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel, kraxel
Hi,
On (Fri) 24 Oct 2014 [11:00:54], Marc-André Lureau wrote:
> The spice server is polling on write, unless
> SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must
> call spice_server_char_device_wakeup() when the frontend is writable.
Great, so there's no other change required to actually use the
functionality in my patch? Does my patch fit your need fine, or do
you need to tweak the notification somehow?
It would be great to get your reviewed-by to my patch in case
everything's fine.
Peter has asked me to update the comments on my patch; I'll fix that
up right away since this showed up.
Thanks!
Amit
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-27 12:43 ` Amit Shah
@ 2014-10-27 16:32 ` Marc-André Lureau
2014-10-28 14:51 ` Amit Shah
0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2014-10-27 16:32 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu-devel, Gerd Hoffmann
[-- Attachment #1: Type: text/plain, Size: 583 bytes --]
On Mon, Oct 27, 2014 at 1:43 PM, Amit Shah <amit.shah@redhat.com> wrote:
> Great, so there's no other change required to actually use the
> functionality in my patch? Does my patch fit your need fine, or do
> you need to tweak the notification somehow?
>
>
It seems to be working nicely.
> It would be great to get your reviewed-by to my patch in case
> everything's fine.
>
> Peter has asked me to update the comments on my patch; I'll fix that
> up right away since this showed up.
>
Sure, I'll wait for next updated patch then.
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 1231 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2014-10-27 16:32 ` Marc-André Lureau
@ 2014-10-28 14:51 ` Amit Shah
0 siblings, 0 replies; 11+ messages in thread
From: Amit Shah @ 2014-10-28 14:51 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel, Gerd Hoffmann
On (Mon) 27 Oct 2014 [17:32:31], Marc-André Lureau wrote:
> On Mon, Oct 27, 2014 at 1:43 PM, Amit Shah <amit.shah@redhat.com> wrote:
>
> > Great, so there's no other change required to actually use the
> > functionality in my patch? Does my patch fit your need fine, or do
> > you need to tweak the notification somehow?
> >
> >
> It seems to be working nicely.
>
>
> > It would be great to get your reviewed-by to my patch in case
> > everything's fine.
> >
> > Peter has asked me to update the comments on my patch; I'll fix that
> > up right away since this showed up.
> >
>
> Sure, I'll wait for next updated patch then.
Thanks, just sent a v3 out.
Amit
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
@ 2015-05-05 14:58 Marc-André Lureau
2015-05-05 14:58 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2015-05-05 14:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, kraxel
When the virtio serial is writable, notify the chardev backend
with qemu_chr_accept_input().
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
hw/char/virtio-console.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 752ed2c..2a867cb 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -95,6 +95,15 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
}
}
+static void guest_writable(VirtIOSerialPort *port)
+{
+ VirtConsole *vcon = VIRTIO_CONSOLE(port);
+
+ if (vcon->chr) {
+ qemu_chr_accept_input(vcon->chr);
+ }
+}
+
/* Readiness of the guest to accept data on a port */
static int chr_can_read(void *opaque)
{
@@ -188,6 +197,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data)
k->unrealize = virtconsole_unrealize;
k->have_data = flush_buf;
k->set_guest_connected = set_guest_connected;
+ k->guest_writable = guest_writable;
dc->props = virtserialport_properties;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
2015-05-05 14:58 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
@ 2015-05-05 14:58 ` Marc-André Lureau
0 siblings, 0 replies; 11+ messages in thread
From: Marc-André Lureau @ 2015-05-05 14:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, kraxel
The spice server is polling on write, unless
SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must
call spice_server_char_device_wakeup() when the frontend is writable.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
spice-qemu-char.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index a4f4e57..0f8903e 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -110,6 +110,9 @@ static SpiceCharDeviceInterface vmc_interface = {
#if SPICE_SERVER_VERSION >= 0x000c02
.event = vmc_event,
#endif
+#if SPICE_SERVER_VERSION >= 0x000c06
+ .flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
+#endif
};
@@ -260,6 +263,13 @@ static void print_allowed_subtypes(void)
fprintf(stderr, "\n");
}
+static void spice_chr_accept_input(struct CharDriverState *chr)
+{
+ SpiceCharDriver *s = chr->opaque;
+
+ spice_server_char_device_wakeup(&s->sin);
+}
+
static CharDriverState *chr_open(const char *subtype,
void (*set_fe_open)(struct CharDriverState *, int))
@@ -279,6 +289,7 @@ static CharDriverState *chr_open(const char *subtype,
chr->chr_set_fe_open = set_fe_open;
chr->explicit_be_open = true;
chr->chr_fe_event = spice_chr_fe_event;
+ chr->chr_accept_input = spice_chr_accept_input;
QLIST_INSERT_HEAD(&spice_chars, s, next);
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-05-05 14:59 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 9:00 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
2014-10-24 9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
2014-10-27 8:08 ` Gerd Hoffmann
2014-10-27 11:45 ` Marc-André Lureau
2014-10-27 11:57 ` Gerd Hoffmann
2015-05-04 9:31 ` Amit Shah
2015-05-05 9:45 ` Gerd Hoffmann
2014-10-27 12:43 ` Amit Shah
2014-10-27 16:32 ` Marc-André Lureau
2014-10-28 14:51 ` Amit Shah
-- strict thread matches above, loose matches on Subject: below --
2015-05-05 14:58 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
2015-05-05 14:58 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
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).