* [Qemu-devel] [PULL 0/5] spice patch queue.
@ 2015-04-27 11:07 Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 1/5] monitor: Make client_migrate_info synchronous Gerd Hoffmann
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Here is the spice patch queue, carrying a bunch of minor
patches piled up during the freeze.
My spice patch queue is empty now, if I happened to have
missed anything please resend.
please pull,
Gerd
The following changes since commit f2a581010cb8e3a2564a45a2863a33a732cc2fc7:
Update version for v2.3.0-rc4 release (2015-04-20 17:13:16 +0100)
are available in the git repository at:
git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150427-1
for you to fetch changes up to 700cd855def54c2a9f2b6a016dcebf75fe19c238:
spice: learn to hide cursor (2015-04-27 12:47:04 +0200)
----------------------------------------------------------------
spice: misc fixes.
----------------------------------------------------------------
Gerd Hoffmann (1):
spice: fix simple display on bigendian hosts
Marc-André Lureau (3):
spice: fix mouse cursor position
spice: set pointer position on hotspot
spice: learn to hide cursor
Markus Armbruster (1):
monitor: Make client_migrate_info synchronous
hmp-commands.hx | 3 +--
include/ui/qemu-pixman.h | 2 ++
include/ui/qemu-spice.h | 7 ++-----
include/ui/spice-display.h | 3 ++-
monitor.c | 5 ++---
qmp-commands.hx | 3 +--
ui/spice-core.c | 26 +++++---------------------
ui/spice-display.c | 23 ++++++++++++++---------
8 files changed, 29 insertions(+), 43 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 1/5] monitor: Make client_migrate_info synchronous
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
@ 2015-04-27 11:07 ` Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 2/5] spice: fix simple display on bigendian hosts Gerd Hoffmann
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Luiz Capitulino, Markus Armbruster, Gerd Hoffmann
From: Markus Armbruster <armbru@redhat.com>
Live migration with spice works like this today:
(1) client_migrate_info monitor cmd
(2) spice server notifies client, client connects to target host.
(3) qemu waits until spice client connect is finished.
(4) send over vmstate (i.e. main part of live migration).
(5) spice handover to target host.
(3) is implemented by making client_migrate_info a async monitor
command. This is the only async monitor command we have.
The original reason to implement this dance was that qemu did not accept
new tcp connections while the incoming migration was running, so (2) and
(4) could not be done in parallel. That issue was fixed long ago though.
Qemu version 1.3.0 (released Dec 2012) and newer happily accept tcp
connects while the incoming migration runs.
Time to drop step (3). This patch does exactly that, by making the
monitor command synchronous and removing the code needed to handle the
async monitor command in ui/spice-core.c
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hmp-commands.hx | 3 +--
include/ui/qemu-spice.h | 7 ++-----
monitor.c | 5 ++---
qmp-commands.hx | 3 +--
ui/spice-core.c | 26 +++++---------------------
5 files changed, 11 insertions(+), 33 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 3089533..a6de819 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -998,8 +998,7 @@ ETEXI
.params = "protocol hostname port tls-port cert-subject",
.help = "send migration info to spice/vnc client",
.user_print = monitor_user_noop,
- .mhandler.cmd_async = client_migrate_info,
- .flags = MONITOR_CMD_ASYNC,
+ .mhandler.cmd_new = client_migrate_info,
},
STEXI
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index 25b94c7..42db3c1 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -42,8 +42,7 @@ int qemu_spice_set_passwd(const char *passwd,
bool fail_if_connected, bool disconnect_if_connected);
int qemu_spice_set_pw_expire(time_t expires);
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
- const char *subject,
- MonitorCompletion cb, void *opaque);
+ const char *subject);
CharDriverState *qemu_chr_open_spice_vmc(const char *type);
#if SPICE_SERVER_VERSION >= 0x000c02
@@ -70,10 +69,8 @@ static inline int qemu_spice_set_pw_expire(time_t expires)
return -1;
}
static inline int qemu_spice_migrate_info(const char *h, int p, int t,
- const char *s,
- MonitorCompletion cb, void *opaque)
+ const char *s)
{
- cb(opaque, NULL);
return -1;
}
diff --git a/monitor.c b/monitor.c
index 68873ec..4b64037 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1086,7 +1086,7 @@ static void hmp_info_trace_events(Monitor *mon, const QDict *qdict)
}
static int client_migrate_info(Monitor *mon, const QDict *qdict,
- MonitorCompletion cb, void *opaque)
+ QObject **ret_data)
{
const char *protocol = qdict_get_str(qdict, "protocol");
const char *hostname = qdict_get_str(qdict, "hostname");
@@ -1108,8 +1108,7 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict,
return -1;
}
- ret = qemu_spice_migrate_info(hostname, port, tls_port, subject,
- cb, opaque);
+ ret = qemu_spice_migrate_info(hostname, port, tls_port, subject);
if (ret != 0) {
qerror_report(QERR_UNDEFINED_ERROR);
return -1;
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 3a42ad0..35ef759 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -785,8 +785,7 @@ EQMP
.args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
.params = "protocol hostname port tls-port cert-subject",
.help = "send migration info to spice/vnc client",
- .mhandler.cmd_async = client_migrate_info,
- .flags = MONITOR_CMD_ASYNC,
+ .mhandler.cmd_new = client_migrate_info,
},
SQMP
diff --git a/ui/spice-core.c b/ui/spice-core.c
index c8f7f18..f00e074 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -273,14 +273,6 @@ static SpiceCoreInterface core_interface = {
.channel_event = channel_event,
};
-typedef struct SpiceMigration {
- SpiceMigrateInstance sin;
- struct {
- MonitorCompletion *cb;
- void *opaque;
- } connect_complete;
-} SpiceMigration;
-
static void migrate_connect_complete_cb(SpiceMigrateInstance *sin);
static void migrate_end_complete_cb(SpiceMigrateInstance *sin);
@@ -293,15 +285,11 @@ static const SpiceMigrateInterface migrate_interface = {
.migrate_end_complete = migrate_end_complete_cb,
};
-static SpiceMigration spice_migrate;
+static SpiceMigrateInstance spice_migrate;
static void migrate_connect_complete_cb(SpiceMigrateInstance *sin)
{
- SpiceMigration *sm = container_of(sin, SpiceMigration, sin);
- if (sm->connect_complete.cb) {
- sm->connect_complete.cb(sm->connect_complete.opaque, NULL);
- }
- sm->connect_complete.cb = NULL;
+ /* nothing, but libspice-server expects this cb being present. */
}
static void migrate_end_complete_cb(SpiceMigrateInstance *sin)
@@ -585,13 +573,10 @@ static void migration_state_notifier(Notifier *notifier, void *data)
}
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
- const char *subject,
- MonitorCompletion *cb, void *opaque)
+ const char *subject)
{
int ret;
- spice_migrate.connect_complete.cb = cb;
- spice_migrate.connect_complete.opaque = opaque;
ret = spice_server_migrate_connect(spice_server, hostname,
port, tls_port, subject);
spice_have_target_host = true;
@@ -812,9 +797,8 @@ void qemu_spice_init(void)
migration_state.notify = migration_state_notifier;
add_migration_state_change_notifier(&migration_state);
- spice_migrate.sin.base.sif = &migrate_interface.base;
- spice_migrate.connect_complete.cb = NULL;
- qemu_spice_add_interface(&spice_migrate.sin.base);
+ spice_migrate.base.sif = &migrate_interface.base;
+ qemu_spice_add_interface(&spice_migrate.base);
qemu_spice_input_init();
qemu_spice_audio_init();
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 2/5] spice: fix simple display on bigendian hosts
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 1/5] monitor: Make client_migrate_info synchronous Gerd Hoffmann
@ 2015-04-27 11:07 ` Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 3/5] spice: fix mouse cursor position Gerd Hoffmann
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Denis Kirjanov is busy getting spice run on ppc64 and trapped into this
one. Spice wire format is little endian, so we have to explicitly say
we want little endian when letting pixman convert the data for us.
Reported-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/qemu-pixman.h | 2 ++
ui/spice-display.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 5d7a9ac..e34c4ef 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -35,6 +35,7 @@
# define PIXMAN_BE_r8g8b8a8 PIXMAN_r8g8b8a8
# define PIXMAN_BE_x8b8g8r8 PIXMAN_x8b8g8r8
# define PIXMAN_BE_a8b8g8r8 PIXMAN_a8b8g8r8
+# define PIXMAN_LE_x8r8g8b8 PIXMAN_b8g8r8x8
#else
# define PIXMAN_BE_r8g8b8 PIXMAN_b8g8r8
# define PIXMAN_BE_x8r8g8b8 PIXMAN_b8g8r8x8
@@ -45,6 +46,7 @@
# define PIXMAN_BE_r8g8b8a8 PIXMAN_a8b8g8r8
# define PIXMAN_BE_x8b8g8r8 PIXMAN_r8g8b8x8
# define PIXMAN_BE_a8b8g8r8 PIXMAN_r8g8b8a8
+# define PIXMAN_LE_x8r8g8b8 PIXMAN_x8r8g8b8
#endif
/* -------------------------------------------------------------------- */
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 1644185..1a64e07 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -178,7 +178,7 @@ static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
image->bitmap.palette = 0;
image->bitmap.format = SPICE_BITMAP_FMT_32BIT;
- dest = pixman_image_create_bits(PIXMAN_x8r8g8b8, bw, bh,
+ dest = pixman_image_create_bits(PIXMAN_LE_x8r8g8b8, bw, bh,
(void *)update->bitmap, bw * 4);
pixman_image_composite(PIXMAN_OP_SRC, ssd->surface, NULL, ssd->mirror,
rect->left, rect->top, 0, 0,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 3/5] spice: fix mouse cursor position
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 1/5] monitor: Make client_migrate_info synchronous Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 2/5] spice: fix simple display on bigendian hosts Gerd Hoffmann
@ 2015-04-27 11:07 ` Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 4/5] spice: set pointer position on hotspot Gerd Hoffmann
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann
From: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 1a64e07..bf66cc9 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -734,7 +734,7 @@ static void display_mouse_set(DisplayChangeListener *dcl,
qemu_mutex_lock(&ssd->lock);
ssd->ptr_x = x;
- ssd->ptr_y = x;
+ ssd->ptr_y = y;
if (ssd->ptr_move) {
g_free(ssd->ptr_move);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 4/5] spice: set pointer position on hotspot
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
` (2 preceding siblings ...)
2015-04-27 11:07 ` [Qemu-devel] [PULL 3/5] spice: fix mouse cursor position Gerd Hoffmann
@ 2015-04-27 11:07 ` Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 5/5] spice: learn to hide cursor Gerd Hoffmann
2015-04-28 9:30 ` [Qemu-devel] [PULL 0/5] spice patch queue Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann
From: Marc-André Lureau <marcandre.lureau@gmail.com>
The Spice protocol uses cursor position on hotspot: the client is
applying hotspot offset when drawing the cursor.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/spice-display.h | 3 ++-
ui/spice-display.c | 10 ++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h
index 53883a1..b25328a 100644
--- a/include/ui/spice-display.h
+++ b/include/ui/spice-display.h
@@ -97,7 +97,8 @@ struct SimpleSpiceDisplay {
/* cursor (without qxl): displaychangelistener -> spice server */
SimpleSpiceCursor *ptr_define;
SimpleSpiceCursor *ptr_move;
- uint16_t ptr_x, ptr_y;
+ int16_t ptr_x, ptr_y;
+ int16_t hot_x, hot_y;
/* cursor (with qxl): qxl local renderer -> displaychangelistener */
QEMUCursor *cursor;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index bf66cc9..a09f6f8 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -275,8 +275,8 @@ qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd,
if (c) {
ccmd->type = QXL_CURSOR_SET;
- ccmd->u.set.position.x = ssd->ptr_x;
- ccmd->u.set.position.y = ssd->ptr_y;
+ ccmd->u.set.position.x = ssd->ptr_x + ssd->hot_x;
+ ccmd->u.set.position.y = ssd->ptr_y + ssd->hot_y;
ccmd->u.set.visible = true;
ccmd->u.set.shape = (uintptr_t)cursor;
cursor->header.unique = ssd->unique++;
@@ -290,8 +290,8 @@ qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd,
memcpy(cursor->chunk.data, c->data, size);
} else {
ccmd->type = QXL_CURSOR_MOVE;
- ccmd->u.position.x = ssd->ptr_x;
- ccmd->u.position.y = ssd->ptr_y;
+ ccmd->u.position.x = ssd->ptr_x + ssd->hot_x;
+ ccmd->u.position.y = ssd->ptr_y + ssd->hot_y;
}
ccmd->release_info.id = (uintptr_t)(&update->ext);
@@ -748,6 +748,8 @@ static void display_mouse_define(DisplayChangeListener *dcl,
SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
qemu_mutex_lock(&ssd->lock);
+ ssd->hot_x = c->hot_x;
+ ssd->hot_y = c->hot_y;
if (ssd->ptr_move) {
g_free(ssd->ptr_move);
ssd->ptr_move = NULL;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 5/5] spice: learn to hide cursor
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
` (3 preceding siblings ...)
2015-04-27 11:07 ` [Qemu-devel] [PULL 4/5] spice: set pointer position on hotspot Gerd Hoffmann
@ 2015-04-27 11:07 ` Gerd Hoffmann
2015-04-28 9:30 ` [Qemu-devel] [PULL 0/5] spice patch queue Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2015-04-27 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann
From: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-display.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index a09f6f8..c71a059 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -260,7 +260,8 @@ static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
static SimpleSpiceCursor*
qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd,
- QEMUCursor *c)
+ QEMUCursor *c,
+ int on)
{
size_t size = c ? c->width * c->height * 4 : 0;
SimpleSpiceCursor *update;
@@ -288,6 +289,8 @@ qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd,
cursor->data_size = size;
cursor->chunk.data_size = size;
memcpy(cursor->chunk.data, c->data, size);
+ } else if (!on) {
+ ccmd->type = QXL_CURSOR_HIDE;
} else {
ccmd->type = QXL_CURSOR_MOVE;
ccmd->u.position.x = ssd->ptr_x + ssd->hot_x;
@@ -738,7 +741,7 @@ static void display_mouse_set(DisplayChangeListener *dcl,
if (ssd->ptr_move) {
g_free(ssd->ptr_move);
}
- ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL);
+ ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL, on);
qemu_mutex_unlock(&ssd->lock);
}
@@ -757,7 +760,7 @@ static void display_mouse_define(DisplayChangeListener *dcl,
if (ssd->ptr_define) {
g_free(ssd->ptr_define);
}
- ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c);
+ ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, 0);
qemu_mutex_unlock(&ssd->lock);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PULL 0/5] spice patch queue.
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
` (4 preceding siblings ...)
2015-04-27 11:07 ` [Qemu-devel] [PULL 5/5] spice: learn to hide cursor Gerd Hoffmann
@ 2015-04-28 9:30 ` Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-04-28 9:30 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 27 April 2015 at 12:07, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> Here is the spice patch queue, carrying a bunch of minor
> patches piled up during the freeze.
>
> My spice patch queue is empty now, if I happened to have
> missed anything please resend.
>
> please pull,
> Gerd
>
> The following changes since commit f2a581010cb8e3a2564a45a2863a33a732cc2fc7:
>
> Update version for v2.3.0-rc4 release (2015-04-20 17:13:16 +0100)
>
> are available in the git repository at:
>
> git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150427-1
>
> for you to fetch changes up to 700cd855def54c2a9f2b6a016dcebf75fe19c238:
>
> spice: learn to hide cursor (2015-04-27 12:47:04 +0200)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-28 9:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-27 11:07 [Qemu-devel] [PULL 0/5] spice patch queue Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 1/5] monitor: Make client_migrate_info synchronous Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 2/5] spice: fix simple display on bigendian hosts Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 3/5] spice: fix mouse cursor position Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 4/5] spice: set pointer position on hotspot Gerd Hoffmann
2015-04-27 11:07 ` [Qemu-devel] [PULL 5/5] spice: learn to hide cursor Gerd Hoffmann
2015-04-28 9:30 ` [Qemu-devel] [PULL 0/5] spice patch queue Peter Maydell
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).