Skip to contentSkip to conversation

Dropping the MONITOR_CMD_ASYNC

Qemu-devel Luiz Capitulino 6 participants 21 messages Dec 8, 2011 – Dec 13, 2011

lore
Share & tools
lore
#0 lore raw

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

#1 lore raw
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Alon

#2 lore raw
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Stefan

#3 lore raw
Quoted 19 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 8 lines
Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Problem is this breaks the qemu <-> libvirt interface.

cheers,
Gerd

#4 lore raw
Quoted 26 lines · Gerd Hoffmann
Quoted 25 lines · Stefan Hajnoczi
Quoted 23 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Quoted 4 lines
Quoted 2 lines

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Problem is this breaks the qemu <-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Stefan

#5 lore raw
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu <-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

cheers,
Gerd

#6 lore raw
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu <-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case.  Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

Stefan

#15 lore raw
In reply to Luiz Capitulino
Quoted 6 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Why has it got to be dropped? can't it be declared as deprecated first?

Quoted 3 lines

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

#7 lore raw
In reply to Stefan Hajnoczi
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu <-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case.  Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it, then we can implement a QMP variant of client_migrate_info side by side, libvirt can learn to use it, and then (seeing as we are the only user) M_C_A can be dropped.

Quoted 3 lines

Stefan

#16 lore raw
In reply to Alon Levy
Quoted 9 lines · On Mon, 12 Dec 2011 17:50:46 +0200 Alon Levy <[email protected]> wrote:
Quoted 6 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Why has it got to be dropped? can't it be declared as deprecated first?

Well, after this thread looks like it's what we'll have to do...

Quoted 5 lines
Quoted 4 lines

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

#14 lore raw
In reply to Alon Levy
Quoted 7 lines · Alon Levy
Quoted 6 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Quoted 5 lines
Quoted 3 lines

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting

Then it's completely broken. CMD_ASYNC is broken and should have been removed a long time ago.

Unfortunately, we're going to have to remove this command until we can move to full QAPI. I see this went in through Gerd's tree:

commit edc5cb1a52b2847201acf78b0fba67ab3c2464d5

Author: Yonit Halperin <[email protected]>
Date:   Mon Oct 17 10:03:18 2011 +0200

spice: turn client_migrate_info to async

Changes to monitor commands really should at least carry an Acked-by from the QMP maintainer (Luiz). That would have prevented this from happening.

I'll try to be more diligent about enforcing this in the future.

Regards,

Anthony Liguori

Quoted 15 lines

an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Alon

#8 lore raw
In reply to Alon Levy
Quoted 76 lines · Alon Levy
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu<-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

Quoted 5 lines

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it,

It *has* to be dropped. Any command using it is fundamentally broken.

The command should have never been introduced in the first place to use async.

Regards,

Anthony Liguori

#17 lore raw
In reply to Luiz Capitulino
Quoted 6 lines · Luiz Capitulino
Quoted 3 lines · On Mon, 12 Dec 2011 17:50:46 +0200 Alon Levy<[email protected]> wrote:
Quoted 2 lines · Luiz Capitulino

Hi there,

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Why has it got to be dropped? can't it be declared as deprecated first?

Well, after this thread looks like it's what we'll have to do...\

Nope, it has to be dropped.

Commands using CMD_ASYNC may fail in arbitrary ways because of the way error reporting is done. This is an unfixable problem until we eliminate all uses of qerror_report().

We need to take the hit here and force the command to always fail. libvirt will need logic to use a different command with new versions. If we coordinate this with the libvirt folks, we can make the transition as smooth as possible.

Regards,

Anthony Liguori

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

#9 lore raw
In reply to Anthony Liguori
Quoted 77 lines · Anthony Liguori
Quoted 76 lines · Alon Levy
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu<-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

Quoted 8 lines
Quoted 5 lines

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it,

It *has* to be dropped. Any command using it is fundamentally broken.

Care to explain what is fundamental about it?

Quoted 1 line

The command should have never been introduced in the first place to use async.

Gerd gave a very good explanation of the requirement, I don't think I can add anything to it. What you suggest is to rewrite it, I just don't understand why we can't leave the MONITOR_CMD_ASYNC around until there is both an alternative and libvirt learns to use it.

Quoted 5 lines

Regards,

Anthony Liguori

#10 lore raw
Quoted 84 lines · Alon Levy
Quoted 83 lines · Anthony Liguori
Quoted 81 lines · Alon Levy
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu<-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it,

Quoted 4 lines
Quoted 2 lines

It *has* to be dropped. Any command using it is fundamentally broken.

Care to explain what is fundamental about it?

The commands are broken as they sit today. If you issue an async command and an error occurs, the error will not be associated with the right command.

Quoted 7 lines
Quoted 2 lines

The command should have never been introduced in the first place to use async.

Gerd gave a very good explanation of the requirement, I don't think I can add anything to it. What you suggest is to rewrite it, I just don't understand why we can't leave the MONITOR_CMD_ASYNC around until there is both an alternative and libvirt learns to use it.

It's broken and more importantly, the longer we leave it there the more likely people will use it and create more problems.

We aren't breaking an ABI here. libvirt can detect that this command is gone and probe for the new command.

This shouldn't have gone in in the first place and yes, that's my responsibility to enforce.

Regards,

Anthony Liguori

Quoted 7 lines
Quoted 6 lines

Regards,

Anthony Liguori

#11 lore raw
Quoted 102 lines · Anthony Liguori
Quoted 84 lines · Alon Levy
Quoted 83 lines · Anthony Liguori
Quoted 81 lines · Alon Levy
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu<-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it,

Quoted 4 lines
Quoted 2 lines

It *has* to be dropped. Any command using it is fundamentally broken.

Care to explain what is fundamental about it?

The commands are broken as they sit today. If you issue an async command and an error occurs, the error will not be associated with the right command.

Quoted 7 lines
Quoted 2 lines

The command should have never been introduced in the first place to use async.

Gerd gave a very good explanation of the requirement, I don't think I can add anything to it. What you suggest is to rewrite it, I just don't understand why we can't leave the MONITOR_CMD_ASYNC around until there is both an alternative and libvirt learns to use it.

Quoted 5 lines

It's broken and more importantly, the longer we leave it there the more likely people will use it and create more problems.

We aren't breaking an ABI here. libvirt can detect that this command is gone and probe for the new command.

Obviously this will break current libvirt. So it means we need to make sure we introduce the new command and libvirt's usage of it follows ASAP. Still won't help with <=current libvirt.

How do you call the monitor interface btw? I thought it was a sort of ABI.

Quoted 17 lines

This shouldn't have gone in in the first place and yes, that's my responsibility to enforce.

Regards,

Anthony Liguori

Quoted 7 lines
Quoted 6 lines

Regards,

Anthony Liguori

#13 lore raw
In reply to Anthony Liguori

Hi,

Quoted 2 lines

We aren't breaking an ABI here. libvirt can detect that this command is gone and probe for the new command.

Please stop this. There are libvirt versions in the wild which can't deal with this and thus will break, no matter how hard you try to wave it away. The question is not whenever something breaks or not, the question is how to deal with the breakage best.

Zapping async monitor commands *now* (i.e. early in the 1.1 release cycle) is probably the best way to handle it. It gives the libvirt folks time to get a new release out of the door before 1.1-final is released, which in turn allows distros to minimize the user-visible fallout.

Technically the switch is easy: migrate_connect_complete_cb() is called from spice-server on completion, we just have to emit a qmp event there instead of calling the monitor completion callback.

cheers,
Gerd

#18 lore raw
In reply to Anthony Liguori
Quoted 7 lines · Anthony Liguori

Nope, it has to be dropped.

Commands using CMD_ASYNC may fail in arbitrary ways because of the way error reporting is done. This is an unfixable problem until we eliminate all uses of qerror_report().

Why don't we eliminate all uses for qerror_report() then? Breaking our interfaces instead seems like a horrible idea.

Quoted 4 lines

We need to take the hit here and force the command to always fail. libvirt will need logic to use a different command with new versions. If we coordinate this with the libvirt folks, we can make the transition as smooth as possible.

I thought we've outgrown this. If we provide an interface, we should support it.

Signature · 1 line
error compiling committee.c: too many arguments to function
#12 lore raw
In reply to Alon Levy
Quoted 106 lines · Alon Levy
Quoted 105 lines · Anthony Liguori
Quoted 84 lines · Alon Levy
Quoted 83 lines · Anthony Liguori
Quoted 81 lines · Alon Levy
Quoted 64 lines · Stefan Hajnoczi
Quoted 52 lines · Gerd Hoffmann
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Gerd Hoffmann
Quoted 27 lines · Stefan Hajnoczi
Quoted 18 lines · Alon Levy
Quoted 9 lines · Luiz Capitulino

Hi there,

I'm about to completely drop the MONITOR_CMD_ASYNC API, but it turns out that the command client_migrate_info uses it. That's a legacy interface and has to be dropped, no command should be using it...

Something tells me that if I just drop it (and change the command to use the regular interface), bad things will happen. Am I right? :)

The monitor command client_migrate_info needs to complete after getting an ACK message from the currently connected spice client (this is the only case where this is required - if there is no client then the MONITOR_CMD_ASYNC API won't be used). This in turn requires the main thread to perform select and call the callback that will process this ACK. That's why the MONITOR_CMD_ASYNC API was used.

Quoted 5 lines

I'm not aware of any other way to do this, I'll be glad for any help here. Also, I understand this is not what is not true async, since one would expect a true async interface to support multiple in flight monitor commands. If there is any ETA or existing way to do this we could change the implementation of client_migrate_info.

Is it possible to use a QMP event to signal completion instead of a MONITOR_CMD_ASYNC command?

Quoted 7 lines
Quoted 1 line

Problem is this breaks the qemu<-> libvirt interface.

I had the same issue with the block_job_cancel command, which Adam Litke and Eric Blake helped us fix and find a backward-compatible libvirt solution for:

http://www.redhat.com/archives/libvir-list/2011-November/msg01351.html

Isn't going to fly as waiting for completion isn't optional in that case. Workflow is this:

(1) libvirt issues client_migrate_info command.
(2) qemu forwards it to spice-server, which in turn forwards it to the spice client (if connected).
(3) spice client connects to the migration target machine.
(4) spice client signals completion to spice-server, which in turn notifies qemu.
(5) qemu calls the monitor completion callback, libvirt gets client_migrate_info result.
(6) libvirt issues migrate command.

Quoted 6 lines

The problem is that (3) must be finished before (6) because qemu on the target side doesn't accept incoming tcp connections any more once the migration started.

I don't see a way to switch this to qmp events without breaking old libvirt versions managing new qemu.

I don't see a solution in this case either. Looks like libvirt supports this command since 0.9.2 so it's not a good idea to just yank it.

Quoted 5 lines

It might be possible for the QEMU client_migrate_info handler to run a nested event loop in the legacy libvirt case. This would suck since the VM is unresponsive while waiting for spice migration to complete. New libvirt would call the async version of the command which is well-behaved and uses a QMP event to signal completion.

I agree that a nested event loop would be a bad solution, the point is to let the guest continue to work while waiting, otherwise you destroy the live migration experience, might as well disconnect the client from the source and have it connect to the target.

I thought the whole point of MONITOR_CMD_ASYNC was to allow this scenario. So iiuc QMP is the alternative but it would require a rewrite, i.e. break existing users like libvirt. Hence my suggestion as a reply to Luiz's initial email that we just deprecate MONITOR_CMD_ASYNC right now instead of dropping it,

Quoted 4 lines
Quoted 2 lines

It *has* to be dropped. Any command using it is fundamentally broken.

Care to explain what is fundamental about it?

The commands are broken as they sit today. If you issue an async command and an error occurs, the error will not be associated with the right command.

Quoted 7 lines
Quoted 2 lines

The command should have never been introduced in the first place to use async.

Gerd gave a very good explanation of the requirement, I don't think I can add anything to it. What you suggest is to rewrite it, I just don't understand why we can't leave the MONITOR_CMD_ASYNC around until there is both an alternative and libvirt learns to use it.

It's broken and more importantly, the longer we leave it there the more likely people will use it and create more problems.

Quoted 6 lines
Quoted 2 lines

We aren't breaking an ABI here. libvirt can detect that this command is gone and probe for the new command.

Obviously this will break current libvirt. So it means we need to make sure we introduce the new command and libvirt's usage of it follows ASAP. Still won't help with<=current libvirt.

libvirt broke with QEMU 1.0 anyway so only new libvirts will work with QEMU 1.0+ so it's all rather moot.

Quoted 3 lines

How do you call the monitor interface btw? I thought it was a sort of ABI.

It is an ABI. But you can negotiate features while still having an ABI. We provide interfaces (query-commands) to list the features that are supported expressly for this purpose.

Worst case scenario, an old libvirt should be able to detect that the command is no longer valid and degrade gracefully.

Regards,

Anthony Liguori

Quoted 19 lines
Quoted 18 lines

This shouldn't have gone in in the first place and yes, that's my responsibility to enforce.

Regards,

Anthony Liguori

Quoted 7 lines
Quoted 6 lines

Regards,

Anthony Liguori

#19 lore raw
In reply to Avi Kivity
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Anthony Liguori

Nope, it has to be dropped.

Commands using CMD_ASYNC may fail in arbitrary ways because of the way error reporting is done. This is an unfixable problem until we eliminate all uses of qerror_report().

Why don't we eliminate all uses for qerror_report() then? Breaking our interfaces instead seems like a horrible idea.

That's what Luiz is doing right now.

Regards,

Anthony Liguori

Quoted 9 lines
Quoted 5 lines

We need to take the hit here and force the command to always fail. libvirt will need logic to use a different command with new versions. If we coordinate this with the libvirt folks, we can make the transition as smooth as possible.

I thought we've outgrown this. If we provide an interface, we should support it.

#20 lore raw
Quoted 10 lines · Anthony Liguori
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Anthony Liguori

Nope, it has to be dropped.

Commands using CMD_ASYNC may fail in arbitrary ways because of the way error reporting is done. This is an unfixable problem until we eliminate all uses of qerror_report().

Quoted 5 lines
Quoted 2 lines

Why don't we eliminate all uses for qerror_report() then? Breaking our interfaces instead seems like a horrible idea.

That's what Luiz is doing right now.

So, the plan to drop MONITOR_CMD_ASYNC was dropped?

Signature · 1 line
error compiling committee.c: too many arguments to function