From: Juan Quintela <quintela@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: amit.shah@redhat.com, jdenemar@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] migration: create migration event
Date: Wed, 17 Jun 2015 02:20:31 +0200 [thread overview]
Message-ID: <871thbi3sg.fsf@neno.neno> (raw)
In-Reply-To: <555CB022.50901@redhat.com> (Eric Blake's message of "Wed, 20 May 2015 10:02:42 -0600")
Eric Blake <eblake@redhat.com> wrote:
> On 05/20/2015 09:35 AM, Juan Quintela wrote:
>> We have one argument that tells us what event has happened.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>> docs/qmp/qmp-events.txt | 16 ++++++++++++++++
>> migration/migration.c | 12 ++++++++++++
>> qapi/event.json | 14 ++++++++++++++
>> 3 files changed, 42 insertions(+)
>>
>> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
>> index 4c13d48..3797709 100644
>> --- a/docs/qmp/qmp-events.txt
>> +++ b/docs/qmp/qmp-events.txt
>> @@ -473,6 +473,22 @@ Example:
>> { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
>> "event": "SPICE_MIGRATE_COMPLETED" }
>>
>> +MIGRATION
>> +---------
>> +
>> +Emitted when a migration event happens
>> +
>> +Data: None.
>> +
>> + - "status": migration status
>> + "": error has been ignored
>
> Uggh. Looking for an empty string is awkward.
We are using MigrationStatus from qapi-schema.json, add the comment
stating that.
>
>> + "report": error has been reported to the device
>> + "stop": the VM is going to stop because of the error
>> +
>> +Example:
>> +
>> +{"timestamp": {"seconds": 1432121972, "microseconds": 744001},
>> + "event": "MIGRATION", "data": {"status": "completed"}}
>
> The example lists "completed", but the documentation does not mention
> it. Might be good to expand the docs to mention all states, and/or point
> to the enum definition.
See above.
>
>
>> +++ b/qapi/event.json
>> @@ -243,6 +243,20 @@
>> { 'event': 'SPICE_MIGRATE_COMPLETED' }
>>
>> ##
>> +# @MIGRATION
>> +#
>> +# Emitted when a migration event happens
>> +#
>> +# @status: @MigrationStatus describing the current migration status.
>> +# If this field is not returned, no migration process
>> +# has been initiated
>
> Rather than returning an empty string,...
>
>> +#
>> +# Since: 2.4
>> +##
>> +{ 'event': 'MIGRATION',
>> + 'data': {'status': 'MigrationStatus'}}
>
> ...this field should be marked optional, as in '*status'. Then in your
> callers, you'll have to pass true or false for has_status, so that you
> can omit status when there is none. But really, when will this event
> ever be omitted if migration has not been initiated? Maybe it is just
> bogus documentation that you can return an empty string, as I didn't see
> any addition of a call to qapi_event_send_migration() that would pass an
> empty string on the wire. So it sounds to me like the interface is
> okay, but the documentation is wrong.
It is wrong documentation, sorry for the inconvenience.
Later, Juan.
next prev parent reply other threads:[~2015-06-17 0:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 15:35 [Qemu-devel] [PATCH v4 0/3] Migration Events Juan Quintela
2015-05-20 15:35 ` [Qemu-devel] [PATCH 1/3] migration: Remove duplicated assignement of SETUP status Juan Quintela
2015-05-20 15:58 ` Eric Blake
2015-05-20 16:03 ` John Snow
2015-06-03 9:14 ` Juan Quintela
2015-05-20 15:35 ` [Qemu-devel] [PATCH 2/3] migration: create migration event Juan Quintela
2015-05-20 16:02 ` Eric Blake
2015-05-21 9:49 ` Juan Quintela
2015-06-17 0:20 ` Juan Quintela [this message]
2015-05-29 11:45 ` Jiri Denemark
2015-06-17 0:12 ` Juan Quintela
2015-05-20 15:35 ` [Qemu-devel] [PATCH 3/3] migration: Add migration events on target side Juan Quintela
2015-05-20 16:10 ` Eric Blake
2015-05-21 9:57 ` Juan Quintela
2015-06-02 12:44 ` [Qemu-devel] [PATCH v4 0/3] Migration Events Jiri Denemark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871thbi3sg.fsf@neno.neno \
--to=quintela@redhat.com \
--cc=amit.shah@redhat.com \
--cc=eblake@redhat.com \
--cc=jdenemar@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.