spice: misc fixes.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVaCBdAAoJEEy22O7T6HE4d/sP/2Qvyx+6aauXxtoW1BxoeR8c
 EnzkdqpXvA705jEZBMXoJts6Ejs3RwjbAlVXBvR/bBSFvDNYXG6H1yhXtVW03TZG
 NKhEaNKBLSYMCes4U5AP2U/2j0uODI9lCi14VFGQg48YiKlE9O2tFyiADJhmRKQE
 T4vlAB1B3cJGDkihZALmChMuhJ5z4W4s1abHSnqB7M/PKXcmKCSOF8LPGm7GXj+I
 0go5hU8aqLEiy4wG4w2tfTSmxSjAdslzwsQNSrjVUaePKJyImdoRDVOsXIVbZX9F
 5dsdBKlRTmsDQmvxiVo4X/Gb2M6b3P0qw/UWfFPy1r/onZhz/yD7hjAK2qox7p5L
 i76/AzZHV8nO1icx+dA2+3pzg2jzscoT32GR8kQFcpKJaaUydzZvuYgH52r0bdsx
 +XwkybIdwWr8988XiJBlzj3CpRfA1oPazIbr+lui0pz4nmIKi0F1CeJVwmpquPLZ
 3IBAfPEXzq11Z8ysMa1bClHHMGJCmYHMihZMF/hoSMl00nFJOJCE+J4F3wphhd8/
 Wj2lCMK1Q0ctUFvGG5DaCRpjVsQStN7iLtVFkgaLx93RNdNONkbNZviGS6V1cnpn
 25x6OdOSchGqomLSH7JYGJax+MHr1n2uK4oyLaKdFmOEn30jiztuaNHy0yVJDfns
 lSi9Uqsta9GSjVmHM1V5
 =99mn
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150529-1' into staging

spice: misc fixes.

# gpg: Signature made Fri May 29 09:16:29 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/spice/tags/pull-spice-20150529-1:
  spice: fix spice_chr_add_watch() pre-condition
  spice: don't update mm_time when spice-server is stopped.
  spice-char: notify the server when chardev is writable
  virtio-console: notify chardev when writable

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2015-05-29 10:17:48 +01:00
commit ba7c388963
4 changed files with 27 additions and 1 deletions

View File

@ -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 */ /* Readiness of the guest to accept data on a port */
static int chr_can_read(void *opaque) 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->unrealize = virtconsole_unrealize;
k->have_data = flush_buf; k->have_data = flush_buf;
k->set_guest_connected = set_guest_connected; k->set_guest_connected = set_guest_connected;
k->guest_writable = guest_writable;
dc->props = virtserialport_properties; dc->props = virtserialport_properties;
} }

View File

@ -504,6 +504,10 @@ static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
{ {
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl); 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); trace_qxl_interface_set_mm_time(qxl->id, mm_time);
qxl->shadow_rom.mm_clock = cpu_to_le32(mm_time); qxl->shadow_rom.mm_clock = cpu_to_le32(mm_time);
qxl->rom->mm_clock = cpu_to_le32(mm_time); qxl->rom->mm_clock = cpu_to_le32(mm_time);

View File

@ -110,6 +110,9 @@ static SpiceCharDeviceInterface vmc_interface = {
#if SPICE_SERVER_VERSION >= 0x000c02 #if SPICE_SERVER_VERSION >= 0x000c02
.event = vmc_event, .event = vmc_event,
#endif #endif
#if SPICE_SERVER_VERSION >= 0x000c06
.flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
#endif
}; };
@ -169,7 +172,7 @@ static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
SpiceCharDriver *scd = chr->opaque; SpiceCharDriver *scd = chr->opaque;
SpiceCharSource *src; SpiceCharSource *src;
assert(cond == G_IO_OUT); assert(cond & G_IO_OUT);
src = (SpiceCharSource *)g_source_new(&SpiceCharSourceFuncs, src = (SpiceCharSource *)g_source_new(&SpiceCharSourceFuncs,
sizeof(SpiceCharSource)); sizeof(SpiceCharSource));
@ -260,6 +263,13 @@ static void print_allowed_subtypes(void)
fprintf(stderr, "\n"); 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, static CharDriverState *chr_open(const char *subtype,
void (*set_fe_open)(struct CharDriverState *, int)) 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->chr_set_fe_open = set_fe_open;
chr->explicit_be_open = true; chr->explicit_be_open = true;
chr->chr_fe_event = spice_chr_fe_event; chr->chr_fe_event = spice_chr_fe_event;
chr->chr_accept_input = spice_chr_accept_input;
QLIST_INSERT_HEAD(&spice_chars, s, next); QLIST_INSERT_HEAD(&spice_chars, s, next);

View File

@ -804,6 +804,7 @@ void qemu_spice_init(void)
qemu_spice_audio_init(); qemu_spice_audio_init();
qemu_add_vm_change_state_handler(vm_change_state_handler, NULL); qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
qemu_spice_display_stop();
g_free(x509_key_file); g_free(x509_key_file);
g_free(x509_cert_file); g_free(x509_cert_file);