* [Qemu-devel] [PULL 1/4] virtio-console: notify chardev when writable
2015-05-29 8:26 [Qemu-devel] [PULL 0/4] spice patch queue Gerd Hoffmann
@ 2015-05-29 8:26 ` Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 2/4] spice-char: notify the server when chardev is writable Gerd Hoffmann
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2015-05-29 8:26 UTC (permalink / raw)
To: qemu-devel
Cc: Amit Shah, Marc-André Lureau, Gerd Hoffmann,
Michael S. Tsirkin
From: Marc-André Lureau <marcandre.lureau@gmail.com>
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>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/4] spice-char: notify the server when chardev is writable
2015-05-29 8:26 [Qemu-devel] [PULL 0/4] spice patch queue Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 1/4] virtio-console: notify chardev when writable Gerd Hoffmann
@ 2015-05-29 8:26 ` Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 3/4] spice: don't update mm_time when spice-server is stopped Gerd Hoffmann
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2015-05-29 8:26 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann
From: Marc-André Lureau <marcandre.lureau@gmail.com>
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>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.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);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/4] spice: don't update mm_time when spice-server is stopped.
2015-05-29 8:26 [Qemu-devel] [PULL 0/4] spice patch queue Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 1/4] virtio-console: notify chardev when writable Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 2/4] spice-char: notify the server when chardev is writable Gerd Hoffmann
@ 2015-05-29 8:26 ` Gerd Hoffmann
2015-05-29 8:26 ` [Qemu-devel] [PULL 4/4] spice: fix spice_chr_add_watch() pre-condition Gerd Hoffmann
2015-05-29 10:22 ` [Qemu-devel] [PULL 0/4] spice patch queue Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2015-05-29 8:26 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Skip mm_time updates (in qxl device memory) in case the guest is stopped.
Guest isn't able to look anyway, and it causes problems with migration.
Also make sure the initial state for spice server is stopped.
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/qxl.c | 4 ++++
ui/spice-core.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 8f40dfb..b220e2d 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -504,6 +504,10 @@ static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
{
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
+ if (!qemu_spice_display_is_running(&qxl->ssd)) {
+ return;
+ }
+
trace_qxl_interface_set_mm_time(qxl->id, mm_time);
qxl->shadow_rom.mm_clock = cpu_to_le32(mm_time);
qxl->rom->mm_clock = cpu_to_le32(mm_time);
diff --git a/ui/spice-core.c b/ui/spice-core.c
index f00e074..2e8384e 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -804,6 +804,7 @@ void qemu_spice_init(void)
qemu_spice_audio_init();
qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
+ qemu_spice_display_stop();
g_free(x509_key_file);
g_free(x509_cert_file);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 4/4] spice: fix spice_chr_add_watch() pre-condition
2015-05-29 8:26 [Qemu-devel] [PULL 0/4] spice patch queue Gerd Hoffmann
` (2 preceding siblings ...)
2015-05-29 8:26 ` [Qemu-devel] [PULL 3/4] spice: don't update mm_time when spice-server is stopped Gerd Hoffmann
@ 2015-05-29 8:26 ` Gerd Hoffmann
2015-05-29 10:22 ` [Qemu-devel] [PULL 0/4] spice patch queue Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2015-05-29 8:26 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann
From: Marc-André Lureau <marcandre.lureau@gmail.com>
Since e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3, add_watch() is called
with G_IO_HUP. Even if spice-qemu-char ignores this flag, the
precondition must be changed.
https://bugzilla.redhat.com/show_bug.cgi?id=1128992
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
spice-qemu-char.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 0f8903e..d41bb74 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -172,7 +172,7 @@ static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
SpiceCharDriver *scd = chr->opaque;
SpiceCharSource *src;
- assert(cond == G_IO_OUT);
+ assert(cond & G_IO_OUT);
src = (SpiceCharSource *)g_source_new(&SpiceCharSourceFuncs,
sizeof(SpiceCharSource));
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] spice patch queue
2015-05-29 8:26 [Qemu-devel] [PULL 0/4] spice patch queue Gerd Hoffmann
` (3 preceding siblings ...)
2015-05-29 8:26 ` [Qemu-devel] [PULL 4/4] spice: fix spice_chr_add_watch() pre-condition Gerd Hoffmann
@ 2015-05-29 10:22 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2015-05-29 10:22 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 29 May 2015 at 09:26, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> A number of small bugfixes accumulated in the spice patch queue.
> No major changes in there. Time to flush it.
>
> please pull,
> Gerd
>
> The following changes since commit ce0274f730eacbd24c706523ddbbabb6b95d0659:
>
> Revert "gdbstub: Do not kill target in system emulation mode" (2015-05-28 16:57:35 +0100)
>
> are available in the git repository at:
>
> git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150529-1
>
> for you to fetch changes up to f7a8beb5e6a13dc924895244777d9ef08b23b367:
>
> spice: fix spice_chr_add_watch() pre-condition (2015-05-29 09:56:01 +0200)
>
> ----------------------------------------------------------------
> spice: misc fixes.
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread